// Use this for initialization void Start() { fOV = GetComponent <FieldOfView>(); anim = GetComponent <Animator>(); scan = GetComponent <Scan>(); distract = GetComponent <Distractable>(); hearing = GetComponent <Hearing>(); scanCompleteString = "ScanComplete"; playerLostString = "PlayerLost"; playerSpottedString = "PlayerSpotted"; enemyDistractedString = "Distracted"; }
// OnStateEnter is called when a transition starts and the state machine starts to evaluate this state override public void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { distract = animator.gameObject.GetComponent <Distractable>(); moveToPoint = animator.gameObject.GetComponent <MoveToPoint>(); }