public bool Transition(string transitionName, GUIStateData data = null) { bool success = false; if(transitionName.Equals(kBackTransition)) { BackTransition(); } else { GUIState endState = GetTransition(_currentState, transitionName); endState.data = data; Transition(endState); } return success; }
public void SpawnPopup(GUIStateData data = null, string prefabName = kSchedulePopup) { Object popupPrefab = Resources.Load(kPrefabsFolder+kPopupsFolder+prefabName); if(popupPrefab != null) { GameObject prefabObject = Instantiate(popupPrefab) as GameObject; if(prefabObject != null) { prefabObject.transform.SetParent(this.transform, false); IScreen screen = prefabObject.GetComponent<IScreen>(); if(screen != null) { screen.TransitionUpdate(data); } } } }
public bool Transition(string transitionName, GUIStateData data = null) { bool success = false; if (transitionName.Equals(kBackTransition)) { BackTransition(); } else { GUIState endState = GetTransition(_currentState, transitionName); endState.data = data; Transition(endState); } return(success); }
public void SpawnPopup(GUIStateData data = null, string prefabName = kSchedulePopup) { Object popupPrefab = Resources.Load(kPrefabsFolder + kPopupsFolder + prefabName); if (popupPrefab != null) { GameObject prefabObject = Instantiate(popupPrefab) as GameObject; if (prefabObject != null) { prefabObject.transform.SetParent(this.transform, false); IScreen screen = prefabObject.GetComponent <IScreen>(); if (screen != null) { screen.TransitionUpdate(data); } } } }
private GUIState GetTransition(GUIState startState, string transitionName, GUIStateData data = null) { GUIState endState = null; if (startState != null) { if (_transitions.ContainsKey(startState.screenName)) { Dictionary <string, string> options = _transitions[startState.screenName]; if (options.ContainsKey(transitionName)) { endState = new GUIState(); endState.screenName = options[transitionName]; endState.data = data; } } } return(endState); }
private GUIState GetTransition(GUIState startState, string transitionName, GUIStateData data = null) { GUIState endState = null; if(startState != null) { if(_transitions.ContainsKey(startState.screenName)) { Dictionary<string, string> options = _transitions[startState.screenName]; if(options.ContainsKey(transitionName)) { endState = new GUIState(); endState.screenName = options[transitionName]; endState.data = data; } } } return endState; }