【发布时间】:2014-05-14 17:49:55
【问题描述】:
public var Locked : Texture;
public var Locking : Texture;
var cam : Camera;
public var trans : Transform;
function Start() {
trans = trasform;
}
function Update() {
if(enemyAI.Locked > 0 ) {
guiTexture.texture = enabled; //build error -> cannot convert 'boolean' to 'UnityEngine.Texture'. (BCE0022)
guiTexture.texture = Locked;
transform.position = cam.WorldToViewportPoint(enemyAI.Locked.position);
}
if(enemyAI.Locking > 0 ) {
guitexture.texture = enabled; //equal error
guiTexture.texture = Locking;
transform.position = cam.WorldToViewportPoint(enemyAI.Locking.position);
}
else
guiTexture.texture = false; //equal error
}
在enemyAI.js 中,如果敌人进入Lock-on Range,则更改标签和Locked 会增加每个敌人。锁定整数后 3 秒 = 锁定。如果敌人离开锁定范围,锁定--
如何修复此代码?当目标在我想要的代码指定的范围内时..
【问题讨论】:
标签: unity3d unityscript