Exemplo n.º 1
0
    public void InitializeFlowManager(GV.SCENENAMES _scene)
    {
        TimerManager.Instance.Init();

        currentScene = _scene;
        currentFlow  = CreateFlow(_scene);
    }
Exemplo n.º 2
0
    private Flow CreateFlow(GV.SCENENAMES _flow)
    {
        Flow flow;

        switch (_flow)
        {
        case GV.SCENENAMES.StartScene:
            flow = new StartSceneFlow();
            break;

        case GV.SCENENAMES.MainMenu:
            flow = new MainMenuFlow();
            break;

        case GV.SCENENAMES.GameScene:
            flow = new GameFlow();
            break;

        default:
            flow = null;
            break;
        }

        if (flow != null)
        {
            SceneManager.Instance.LoadScene(_flow.ToString(), SceneLoaded);
        }

        return(flow);
    }
Exemplo n.º 3
0
 /// <summary>
 /// Switch flow and scene
 /// </summary>
 /// <param name="_flowToLoad">name of the scene (you have to update CreateFlow() to manage new scenes/flows)</param>
 /// <param name="toCall">Optionnal, this delegate will be call just after the scene generation</param>
 public void ChangeFlows(GV.SCENENAMES _flowToLoad, ToCallOnStart toCall = null)
 {
     this.toCall     = toCall ?? Empty;
     flowInitialized = false;
     currentFlow.Finish();
     currentFlow = CreateFlow(_flowToLoad);
 }
Exemplo n.º 4
0
    private Flow CreateFlow(GV.SCENENAMES _flow)
    {
        Flow flow;


        switch (_flow)
        {
        case GV.SCENENAMES.MainEntryScene:
            flow = new MainEntryFlow();
            break;

        case GV.SCENENAMES.MainMenu:
            flow = new MainMenuFlow();
            break;

        case GV.SCENENAMES.MainScene:
            flow = new MainSceneFlow();
            break;

        case GV.SCENENAMES.BattleScene:
            flow = new BattleFlow();
            break;

        case GV.SCENENAMES.MacroScene:
            flow = new MacroSceneFlow();
            break;

        default:
            flow = new MainSceneFlow();
            break;
        }

        if (_flow != GV.SCENENAMES.MainEntryScene)
        {
            SceneManager.Instance.LoadScene(_flow.ToString(), SceneLoaded);
        }

        return(flow);
    }
Exemplo n.º 5
0
 public void ChangeFlows(GV.SCENENAMES _flowToLoad)
 {
     flowInitialized = false;
     currentFlow.Finish();
     currentFlow = CreateFlow(_flowToLoad);
 }