/// <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); } }
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>(); }
void Awake() { attacker = GetComponent <Attacker> (); mover = GetComponent <NavMeshMover> (); }
void Awake() { finder = GetComponent <FriendFinder> (); mover = GetComponent <NavMeshMover> (); }
void Awake() { mover = GetComponent <NavMeshMover> (); }
void Start() { mover = GetComponent <NavMeshMover> (); agent = GetComponent <NavMeshAgent> (); MoveIntoRandomDirection(); }