コード例 #1
0
ファイル: Unit.AI.cs プロジェクト: KroneckerX/WCell
		/// <summary>
		/// Moves towards the given target and then executes the given action
		/// </summary>
		/// <remarks>Requires Brain</remarks>
		public void MoveToThenExecute(Vector3 pos, UnitActionCallback actionCallback)
		{
			if (CheckBrain())
			{
				//m_brain.StopCurrentAction();
				m_Movement.MoveTo(pos);
				m_brain.CurrentAction = new AIMoveThenExecAction(this, actionCallback);
			}
		}
コード例 #2
0
ファイル: Unit.AI.cs プロジェクト: KroneckerX/WCell
		/// <summary>
		/// Moves towards the given target and then executes the given action
		/// </summary>
		/// <remarks>Requires Brain</remarks>
		public void MoveToPointsThenExecute(List<Vector3> points, UnitActionCallback actionCallback)
		{
			if (CheckBrain())
			{
				//m_brain.StopCurrentAction();
				m_Movement.MoveToPoints(points);
				m_brain.CurrentAction = new AIMoveThenExecAction(this, actionCallback);
			}
		}
コード例 #3
0
ファイル: Unit.AI.cs プロジェクト: KroneckerX/WCell
		/// <summary>
		/// Moves to the given target and once within the given range, executes the given action
		/// </summary>
		/// <remarks>Requires Brain</remarks>
		public void MoveToThenExecute(GameObject go, SimpleRange range, UnitActionCallback actionCallback)
		{
			MoveToThenExecute(go, range, actionCallback, 0);
		}
コード例 #4
0
ファイル: Unit.AI.cs プロジェクト: KroneckerX/WCell
		/// <summary>
		/// Moves to the given target and once within the given range, executes the given action
		/// </summary>
		/// <remarks>Requires Brain</remarks>
		public void MoveToThenExecute(Unit unit, SimpleRange range, UnitActionCallback actionCallback)
		{
			MoveToThenExecute(unit, range, actionCallback, 0);
		}
コード例 #5
0
ファイル: Unit.AI.cs プロジェクト: KroneckerX/WCell
		/// <summary>
		/// Moves to the given gameobject and once within default range, executes the given action
		/// </summary>
		/// <remarks>Requires Brain</remarks>
		public void MoveToThenExecute(GameObject go, float angle, UnitActionCallback callback, int millisTimeout)
		{
			if (CheckBrain())
			{
				//m_brain.StopCurrentAction();

				var action = new AIMoveToGameObjectIntoAngleThenExecAction(this, go, angle, callback)
				{
					TimeoutMillis = millisTimeout
				};

				m_brain.CurrentAction = action;
			}
		}
コード例 #6
0
ファイル: Unit.AI.cs プロジェクト: KroneckerX/WCell
		/// <summary>
		/// Moves to the given target and once within default range, executes the given action
		/// </summary>
		/// <remarks>Requires Brain</remarks>
		public void MoveToThenExecute(Unit unit, float angle, UnitActionCallback callback, int millisTimeout)
		{
			if (CheckBrain())
			{
				//m_brain.StopCurrentAction();

				Target = unit;
				var action = new AIMoveIntoAngleThenExecAction(this, angle, callback)
				{
					TimeoutMillis = millisTimeout
				};

				m_brain.CurrentAction = action;
			}
		}
コード例 #7
0
		public AIMoveToGameObjectIntoAngleThenExecAction(Unit owner, GameObject go, float angle, UnitActionCallback actionCallback)
			: base(owner, actionCallback)
		{
			_angle = angle;
			_gameObject = go;
		}
コード例 #8
0
ファイル: Unit.AI.cs プロジェクト: KroneckerX/WCell
		/// <summary>
		/// Moves to the given target and once within default range, executes the given action
		/// </summary>
		/// <remarks>Requires Brain</remarks>
		public void MoveToThenExecute(Unit unit, UnitActionCallback actionCallback)
		{
			MoveToThenExecute(unit, actionCallback, 0);
		}
コード例 #9
0
ファイル: Unit.AI.cs プロジェクト: KroneckerX/WCell
		/// <summary>
		/// Moves to the given target and once within default range, executes the given action
		/// </summary>
		/// <remarks>Requires Brain</remarks>
		public void MoveBehindThenExecute(GameObject go, UnitActionCallback actionCallback)
		{
			MoveBehindThenExecute(go, actionCallback, 0);
		}
コード例 #10
0
ファイル: Unit.AI.cs プロジェクト: KroneckerX/WCell
		/// <summary>
		/// Moves in front of the given target and once within default range, executes the given action
		/// </summary>
		/// <remarks>Requires Brain</remarks>
		public void MoveInFrontThenExecute(GameObject go, UnitActionCallback actionCallback, int millisTimeout)
		{
			MoveToThenExecute(go, 0f, actionCallback);
		}
コード例 #11
0
ファイル: Unit.AI.cs プロジェクト: KroneckerX/WCell
		/// <summary>
		/// Moves in front of the given target and once within default range, executes the given action
		/// </summary>
		/// <remarks>Requires Brain</remarks>
		public void MoveInFrontThenExecute(Unit unit, UnitActionCallback actionCallback, int millisTimeout)
		{
			MoveToThenExecute(unit, 0f, actionCallback);
		}
コード例 #12
0
ファイル: Unit.AI.cs プロジェクト: KroneckerX/WCell
		/// <summary>
		/// Moves to the given target and once within default range, executes the given action
		/// </summary>
		/// <remarks>Requires Brain</remarks>
		public void MoveToThenExecute(Unit unit, UnitActionCallback actionCallback, int millisTimeout)
		{
			if (CheckBrain())
			{
				//m_brain.StopCurrentAction();
				Target = unit;
				m_brain.CurrentAction = new AIMoveToThenExecAction(this, actionCallback);
			}
		}
コード例 #13
0
ファイル: Unit.AI.cs プロジェクト: ray2006/WCell
		/// <summary>
		/// Moves towards the given target and then executes the given action
		/// </summary>
		/// <remarks>Requires Brain</remarks>
		public void MoveToThenExecute(Vector3 pos, UnitActionCallback actionCallback)
		{
			MoveToThenExecute(pos, true, actionCallback);
		}
コード例 #14
0
		public AIMoveIntoRangeThenExecAction(Unit owner, SimpleRange range, UnitActionCallback actionCallback)
			: base(owner, actionCallback)
		{
			m_Range = range;
		}
コード例 #15
0
		public AIMoveIntoAngleThenExecAction(Unit owner, float angle, UnitActionCallback actionCallback)
			: base(owner, actionCallback)
		{
			m_Angle = angle;
		}
コード例 #16
0
ファイル: Unit.AI.cs プロジェクト: KroneckerX/WCell
		/// <summary>
		/// Moves to the given target and once within the given range, executes the given action
		/// </summary>
		/// <remarks>Requires Brain</remarks>
		public void MoveToThenExecute(Unit unit, SimpleRange range, UnitActionCallback actionCallback, int millisTimeout)
		{
			if (CheckBrain())
			{
				//m_brain.StopCurrentAction();
				Target = unit;
				m_brain.CurrentAction = new AIMoveIntoRangeThenExecAction(this, range, actionCallback)
				{
					TimeoutMillis = millisTimeout
				};
			}
		}
コード例 #17
0
ファイル: Unit.AI.cs プロジェクト: KroneckerX/WCell
		/// <summary>
		/// Moves to the given target and once within the given range, executes the given action
		/// </summary>
		/// <remarks>Requires Brain</remarks>
		public void MoveToThenExecute(GameObject go, SimpleRange range, UnitActionCallback actionCallback, int millisTimeout)
		{
			if (CheckBrain())
			{
				m_brain.CurrentAction = new AIMoveIntoRangeOfGOThenExecAction(this, go, range, actionCallback)
				{
					TimeoutMillis = millisTimeout
				};
			}
		}
コード例 #18
0
ファイル: Unit.AI.cs プロジェクト: KroneckerX/WCell
		/// <summary>
		/// Moves to the given target and once within default range, executes the given action
		/// </summary>
		/// <remarks>Requires Brain</remarks>
		public void MoveBehindThenExecute(Unit unit, UnitActionCallback actionCallback, int millisTimeout)
		{
			MoveToThenExecute(unit, MathUtil.PI, actionCallback);
		}
コード例 #19
0
ファイル: Unit.AI.cs プロジェクト: KroneckerX/WCell
		/// <summary>
		/// Moves to the given target and once within default range, executes the given action
		/// </summary>
		/// <remarks>Requires Brain</remarks>
		public void MoveBehindThenExecute(GameObject go, UnitActionCallback actionCallback, int millisTimeout)
		{
			MoveToThenExecute(go, MathUtil.PI, actionCallback);
		}
コード例 #20
0
ファイル: Unit.AI.cs プロジェクト: KroneckerX/WCell
		/// <summary>
		/// Moves to the given target and once within default range, executes the given action
		/// </summary>
		/// <remarks>Requires Brain</remarks>
		public void MoveToThenExecute(GameObject go, float angle, UnitActionCallback actionCallback)
		{
			MoveToThenExecute(go, angle, actionCallback, 0);
		}
コード例 #21
0
		public AIMoveThenExecAction(Unit owner, UnitActionCallback actionCallback)
			: base(owner)
		{
			ActionCallback = actionCallback;
		}
コード例 #22
0
		public AIMoveIntoRangeOfGOThenExecAction(Unit owner, GameObject go, SimpleRange range, UnitActionCallback actionCallback)
			: base(owner, actionCallback)
		{
			_gameObject = go;
			m_Range = range;
		}