///////////////////////////// ////////// Service ////////// /// <summary> /// Attempt to load the start action state /// </summary> /// <remarks> /// First function to be called at the beginning /// </remarks> private void AttemptToLoadStartActionState() { _currentActionState = _startActionState; if (!_currentActionState) { Debug.LogError("There is no start action state!", gameObject); enabled = false; } }
/// <summary> /// Transit to the next action state /// </summary> private void TransitToNextActionState(AActionState nextActionState) { _currentActionState.EndAction(this, _inputInformation); _previousActionState = _currentActionState; _currentActionState = nextActionState; _currentActionState.BeginAction(this, _inputInformation); if (_shouldDisplayTransition) { Debug.Log(_previousActionState.GetType().Name + " --> " + _currentActionState.GetType().Name, gameObject); } }