void OnEnable() { dialog = JsonUtility.FromJson <DialogData>(dialogJson.text); uiState = FindObjectOfType <UIState>(); if (resetSaveInEditor) { TutorialShowedStatus.ClearAllStatePrefs(); } HideAll(); uiState.OnStateChanged += OnStateChanged; }
void OnStateChanged(UIState.State state) { // check if we should start a dialog TutorialShowedStatus.ShowTutorialIfNeeded(state, () => Show(state, dialog.tutorials.GetTutorialForState(state))); }