// Use this for initialization void Start() { currentState = States.Navigating; _navMeshInterface = gameObject.GetComponent <AlienNavMeshInterface>(); _health = gameObject.GetComponent <SmallAlienHealth>(); anims = gameObject.GetComponent <Animator>(); SplashDamage = GameObject.Find("SplashDamage").GetComponent <SplashDamageScript>(); }
// 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) { startAttackTime = Time.time; HitTime = Time.time + (stateInfo.length / 3f); SplashDamage = GameObject.Find("SplashDamage").GetComponent <SplashDamageScript>(); _nav = animator.gameObject.GetComponent <AlienNavMeshInterface>(); playerHealth = GameObject.Find("PlayerSpawnLocation").GetComponent <PlayerHealthScript>(); }