// 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) { control = animator.GetComponent <CannonHackerControl> (); state = animator.GetComponent <LaserCannonState> (); if (state) { state.TurnOnHint(); } }
// 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) { state = animator.GetComponent <LaserCannonState> (); cs = animator.GetComponentInChildren <ControlStatus> (); control = animator.GetComponent <CannonHackerControl> (); hackerSwitcher = cs.Hacker.GetComponent <FacingSpriteSwitcher> (); hackerAim = cs.Hacker.GetComponentInChildren <PlayerAim> (); // // initially point to hacker // state.playerAimPos = cs.Hacker.position; if (state) { state.PlayerUpdateAimLaser(); state.aimLaser.GetComponent <AimLaserUpdate> ().SnapPosition(); state.aimLaser.gameObject.SetActive(true); state.TurnOnHint(); } }