protected virtual void OnEnable() { wizard = GetComponent <Wizard>(); Assert.IsNotNull(wizard, "Wizard not found"); stateMachine = wizard.stateMachine; Assert.IsNotNull(stateMachine, "Wizard State Machine not found"); }
private WizardStateMachine GetStateMachine(Animator animator) { if (wizardStateMachine != null) { return(wizardStateMachine); } wizardStateMachine = animator.gameObject.GetComponent <WizardStateMachine>(); Assert.IsNotNull(wizardStateMachine, "Wizard State Machine not found"); return(wizardStateMachine); }