private void Awake() { recorder.Init(); recordingButton.onClick.AddListener(OnRecordingButtonClick); recordingButtonText = recordingButton.GetComponentInChildren <Text>(); recordingButtonImage = recordingButton.GetComponent <Image>(); recordingTimeText.text = StartTimeText; animator = recorder.GetComponent <Animator>(); cancelReplayButton.onClick.AddListener(OnCancelReplayButtonClick); cancelReplayButton.gameObject.SetActive(false); replayText.gameObject.SetActive(false); meshToggle.onValueChanged.AddListener(value => { mesh.enabled = value; }); state = State.Idle; instance = this; }
// 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) //{ // //} // OnStateUpdate is called on each Update frame between OnStateEnter and OnStateExit callbacks //override public void OnStateUpdate(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) //{ // //} // OnStateExit is called when a transition ends and the state machine finishes evaluating this state override public void OnStateExit(Animator animator, AnimatorStateInfo stateInfo, int layerIndex) { RigAnimationRecordingPanel recordingPanel = animator.GetComponent <CharacterPanels>().RigAnimationRecordingPanel; recordingPanel.OnRecordedStateExit(); }