public void RegisterTranslationComplete(GameStateTranslation translator) { if (translator == currentTranslation) { translator.enabled = false; currentTranslation = null; EnableState(nextState, nextStateModel); nextStateModel = null; } else { Debug.LogError("RegisterTranslationComplete(): unexpected translator passed"); } }
public void EnableStateWithTranslation(GameStateBase state, GameStateTranslation translation, object stateModel, object translationModel) { if (IsInTranslation) { Logs.Instance.ProcessError("Already in translation!"); return; } nextStateModel = stateModel; nextState = state; currentTranslation = translation; translation.PreviousState = CurrentState; translation.NextState = state; translation.OnTranslationBegin(translationModel); translation.enabled = true; CurrentState.OnTranslationFromStateBegin(); state.OnTranslationToStateBegin(); }