void Awake() { instance = this; charController = GetComponent <CharController>(); animator = GetComponent <Animator>(); source = GetComponent <AudioSource>(); }
// 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) { CatboyController cont = CatboyController.instance; if (tempFollowTarget != "") { cont.followOverride = GameObject.Find(tempFollowTarget).transform; } else { cont.followOverride = null; } if (startFollowPlayer) { cont.followingPlayer = true; } if (stopFollowPlayer) { cont.followingPlayer = false; } }