public bool GoTo <T>() where T : UnityState, new() { if (CanGoTo <T>()) { _currentState.OnExit(); _currentState = new T(); _currentState.OnEnter(); return(true); } return(false); }
private void Awake() { Type type = Type.GetType(_firstState); _currentState = (UnityState)Activator.CreateInstance(type); }