Exemplo n.º 1
0
 /// <summary>
 ///   Event - fired after movement mode key was pressed.
 /// </summary>
 private void PlayerInputOnMovementModeKeyPressed()
 {
     if (Mover is Mover)
     {
         Mover = new NavMeshMover(this, _moverType);
     }
     else
     {
         Mover = new Mover(this, _moverType);
     }
 }
Exemplo n.º 2
0
    void Start()
    {
        SoundsManager = GetComponentInParent <AudioManager>();
        AttackSource  = SoundsManager.AttackSource;
        Me            = gameObject.GetComponent <UnitComponent>();
        AttackThese   = new List <GameObject>();
        //AttackDistance = 2f;
        //Using Player1 and Player2 for future implementation of multiplayer
        if (gameObject.CompareTag("Player1"))
        {
            AttackTag = "Player2";
        }
        if (gameObject.CompareTag("Player2"))
        {
            AttackTag = "Player1";
        }

        meshMover = gameObject.GetComponent <NavMeshMover>();
    }
Exemplo n.º 3
0
 void Awake()
 {
     attacker = GetComponent <Attacker> ();
     mover    = GetComponent <NavMeshMover> ();
 }
Exemplo n.º 4
0
 void Awake()
 {
     finder = GetComponent <FriendFinder> ();
     mover  = GetComponent <NavMeshMover> ();
 }
Exemplo n.º 5
0
 void Awake()
 {
     mover = GetComponent <NavMeshMover> ();
 }
Exemplo n.º 6
0
 void Start()
 {
     mover = GetComponent <NavMeshMover> ();
     agent = GetComponent <NavMeshAgent> ();
     MoveIntoRandomDirection();
 }