public void ProvideAction(TestUnit activePlayer) {
		if (Input.GetKey (KeyCode.W)) {
			activePlayer.Move (1);
			return;
		}
		if (Input.GetKey (KeyCode.E)) {
			activePlayer.Move (2);
			return;
		}
		if (Input.GetKey (KeyCode.D)) {
			activePlayer.Move (3);
			return;
		}
		if (Input.GetKey (KeyCode.X)) {
			activePlayer.Move (4);
			return;
		}
		if (Input.GetKey (KeyCode.Z)) {
			activePlayer.Move (5);
			return;
		}
		if (Input.GetKey (KeyCode.A)) {
			activePlayer.Move (6);
			return;
		}
		if (Input.GetKey (KeyCode.F)) {
			activePlayer.possibleAttack ();
			return;
		}
	}
Пример #2
0
    // Start is called before the first frame update

    /// <summary>
    /// Движение для юнита (navmesh.destination)
    /// </summary>
    /// <param name="unit">Кому нужно двигаться</param>
    /// <param name="dest">Куда нужно двигаться</param>
    public void MoveOrder(TestUnit unit, Vector3 dest)
    {
        unit.Move(dest);
    }