本文整理汇总了C#中GameObject.GetBehavior方法的典型用法代码示例。如果您正苦于以下问题:C# GameObject.GetBehavior方法的具体用法?C# GameObject.GetBehavior怎么用?C# GameObject.GetBehavior使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameObject
的用法示例。
在下文中一共展示了GameObject.GetBehavior方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnUnitLost
public void OnUnitLost (GameObject unit) {
//Debug.Log ("OnFind");
if (unit.GetBehavior().playerID != behavior.state.playerID) {
(behavior.motor as CharacterMotor).MoveToPoint(unit.transform.position);
//Debug.DrawLine(transform.position, unit.transform.position);
}
}
示例2: OnUnitFind
public void OnUnitFind (GameObject unit) {
//Debug.Log ("OnFind");
if (unit.GetBehavior().playerID != behavior.state.playerID) {
(behavior.motor as CharacterMotor).FollowUnit(unit);
attack.SetTarget (unit);
}
}
示例3: OnColliderUnitEnter
public void OnColliderUnitEnter (GameObject unit) {
UnitBehavior behavior = unit.GetBehavior ();
if (behavior.buffs != null) {
StunBuff heal = new StunBuff ();
heal.targetUnit = unit;
heal.recoveryPerSecond = -10f;
behavior.buffs.Add (heal);
}
}
示例4: OnUnitNoise
public void OnUnitNoise (GameObject unit, float f) {
if (unit.GetBehavior().playerID != behavior.state.playerID) {
(behavior.motor as CharacterMotor).MoveToPoint(unit.transform.position);
(behavior.motor as CharacterMotor).FollowUnit(unit);
attack.SetTarget (unit);
//Debug.Log(Time.time);
//MoveToPos (unit.transform.position);
}
}
示例5: OnUnitInSphere
public void OnUnitInSphere (GameObject unit) {
UnitBehavior otherBehavior = unit.GetBehavior();
if (!otherBehavior.state.isAlive) return;
if (otherBehavior.state.playerID != behavior.state.playerID) {
if (!attack.HasTarget()) {
//behavior.motor.FollowUnit (unit);
attack.SetTarget (unit);
} else {
//behavior.motor.FollowUnit (attack.target);
}
}
}
示例6: OnUnitVisible
public void OnUnitVisible (GameObject unit) {
if (unit.GetBehavior().playerID != behavior.state.playerID) {
(behavior.motor as CharacterMotor).MoveToPoint(unit.transform.position);
}
}