//public void SetMyAttacker(Transform attacker) //{ // myAttacker = attacker; //} public void Distract(Vector3 distractionPos) { locationOfInterest = distractionPos; if (currentState == patrolState) { currentState = alertState; } }
void ActivateFleeState() { if (currentState == struckState) { capturedState = fleeState; return; } currentState = fleeState; }
IEnumerator RecoverFromStruckState() { yield return(new WaitForSeconds(1.5f)); nPCMaster.CallEventNPCRecoveredAnim(); if (rangeWeapon != null) { rangeWeapon.SetActive(true); } if (myNavMeshAgent.enabled) { myNavMeshAgent.isStopped = false; } currentState = capturedState; }
void ActivateStruckState(int dummy) { StopAllCoroutines(); if (currentState != struckState) { capturedState = currentState; } if (rangeWeapon != null) { rangeWeapon.SetActive(false); } if (myNavMeshAgent.enabled) { myNavMeshAgent.isStopped = true; } currentState = struckState; isMeleeAttacking = false; nPCMaster.CallEventNPCStruckAnim(); StartCoroutine(RecoverFromStruckState()); }
void ActivatePatrolState() { currentState = patrolState; }