Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
 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);
             }
         }
     }
 }
Exemplo n.º 3
0
    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);
    }
Exemplo n.º 4
0
    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);
                }
            }
        }
    }
Exemplo n.º 5
0
    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);
    }
Exemplo n.º 6
0
 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;
 }