public SceneController(
     ISceneTransition transition,
     ISceneReference startScene)
 {
     _transition   = transition;
     _currentScene = startScene;
     _loadingState = LoadingState.Idle;
 }
Ejemplo n.º 2
0
 public SceneController(
     ISceneTransition transition,
     GameState gameState,
     IEventBus gameEventBus)
 {
     _transition   = transition;
     _gameState    = gameState;
     _gameEventBus = gameEventBus;
 }
Ejemplo n.º 3
0
        public void ChangeScene(string name, ISceneTransition transition)
        {
            Scene nextScene = _scenes[name];

            Transition = transition;
            Transition.Begin(CurrentScene, nextScene);

            CurrentScene = nextScene;
        }
Ejemplo n.º 4
0
        public void ChangeScene(string name, ISceneTransition transition)
        {
            Scene nextScene = _scenes[name];

            Transition = transition;
            Transition.Begin(CurrentScene, nextScene);

            CurrentScene = nextScene;
        }
Ejemplo n.º 5
0
    public void StartTransition(ISceneTransition transition, int dstScene)
    {
        this.transition = transition;

        m_dst = dstScene;

        Material.shader            = this.transition.GetShader();
        m_transitionCamera.enabled = true;

        OnTransitionStarted?.Invoke();

        StartCoroutine(this.transition.OnScreenObscured(Instance));
    }
Ejemplo n.º 6
0
 public void Update(GameTime gameTime)
 {
     if (Transition != null)
     {
         Transition.Update(gameTime);
         if (Transition.IsFinished)
         {
             Transition = null;
         }
     }
     else
     {
         CurrentScene.Update(gameTime);
     }
 }
    public void Construct(
        IFogOfWar fogOfWar,
        IReposition reposition,
        ITurn turn,
        ISceneTransition sceneTransition)
    {
        _fogOfWar        = fogOfWar;
        _reposition      = reposition;
        _turn            = turn;
        _sceneTransition = sceneTransition;

        players = GameObject.FindObjectsOfType(typeof(Player)) as Player[];
        if (StaticVariables.numberOfPlayers == 2)
        {
            Destroy(players[2].gameObject);
            Destroy(players[3].gameObject);
            numberOfPlayers = 2;
            players         = new Player[]
            {
                players[0],
                players[1]
            };
            players[0].name = StaticVariables.player1Name;
            players[1].name = StaticVariables.player2Name;
        }
        else if (StaticVariables.numberOfPlayers == 3)
        {
            Destroy(players[3].gameObject);
            numberOfPlayers = 3;
            players         = new Player[]
            {
                players[0],
                players[1],
                players[2]
            };
            players[0].name = StaticVariables.player1Name;
            players[1].name = StaticVariables.player2Name;
            players[2].name = StaticVariables.player3Name;
        }
        else if (StaticVariables.numberOfPlayers == 4)
        {
            numberOfPlayers = 4;
            players[0].name = StaticVariables.player1Name;
            players[1].name = StaticVariables.player2Name;
            players[2].name = StaticVariables.player3Name;
            players[3].name = StaticVariables.player4Name;
        }
    }
Ejemplo n.º 8
0
    public static void TransitionToScene(string sceneID, params object[] transferData)
    {
        if (s_SceneTransitions.ContainsKey(sceneID))
        {
            ISceneTransition transition        = s_SceneTransitions[sceneID];
            bool             transitionResults = transition.TransitionTo(sceneID, transferData);

            if (transitionResults == false)
            {
                Debug.LogWarning(string.Format("{0} failed to transition to {1}. Falling back on default transition!", transition.GetType().Name, sceneID));
                DefaultTransition(sceneID);
            }
        }
        else
        {
            DefaultTransition(sceneID);
        }
    }
Ejemplo n.º 9
0
 // -Public API-
 public static void SetSceneTransition(string sceneID, ISceneTransition sceneTransition)
 {
     Debug.Assert(s_SceneTransitions.ContainsKey(sceneID) == false);
     s_SceneTransitions.Add(sceneID, sceneTransition);
 }
Ejemplo n.º 10
0
        public void Setup()
        {
            var gameFactory = Resources.Load <GameFactory>("Settings/Game/GameFactory");

            _transition = gameFactory.SceneTransition;
        }
Ejemplo n.º 11
0
 public void Update(GameTime gameTime)
 {
     if (Transition != null)
     {
         Transition.Update(gameTime);
         if (Transition.IsFinished)
             Transition = null;
     }
     else
     {
         CurrentScene.Update(gameTime);
     }
 }