Пример #1
0
		/// <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
		/// <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
		/// <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
		/// <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
		/// <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
		/// <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
		/// <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
		/// <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
		/// <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
		/// <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
		/// <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
		/// <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
		/// <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
		/// <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
		/// <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
		/// <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
		/// <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;
		}