当前位置: 首页>>代码示例>>C#>>正文


C# GameObject.GetBehavior方法代码示例

本文整理汇总了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);
		}
	}
开发者ID:igoromi4,项目名称:Dogma-In-Blade,代码行数:7,代码来源:KnightBehavior.cs

示例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);
		}
	}	
开发者ID:igoromi4,项目名称:Dogma-In-Blade,代码行数:7,代码来源:KnightBehavior.cs

示例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);
		}
	}
开发者ID:igoromi4,项目名称:Dogma-In-Blade,代码行数:9,代码来源:Zone.cs

示例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);
		}
	}
开发者ID:igoromi4,项目名称:Dogma-In-Blade,代码行数:9,代码来源:KnightBehavior.cs

示例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);
			}
		}
	}
开发者ID:igoromi4,项目名称:Dogma-In-Blade,代码行数:12,代码来源:SlimeBehavior.cs

示例6: OnUnitVisible

	public void OnUnitVisible (GameObject unit) {
		if (unit.GetBehavior().playerID != behavior.state.playerID) {
			(behavior.motor as CharacterMotor).MoveToPoint(unit.transform.position);
		}
	}
开发者ID:igoromi4,项目名称:Dogma-In-Blade,代码行数:5,代码来源:KnightBehavior.cs


注:本文中的GameObject.GetBehavior方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。