Exemplo n.º 1
0
        public void StartNewGameEventHandler(StartNewGameEvent @event)
        {
            Log.Game.Write("Starting new game with scene: " + @event.NewGameScene.FullName);
            _eventsDispatcher.Dispatch <SaveGameStateEvent>(new SaveGameStateEvent());

            Scene.SwitchTo(@event.NewGameScene);
        }
    public void OnMMEvent(StartNewGameEvent eventType)
    {
        // starts an offline network session
        StartOfflineHost();

        // create a brand new save game file
        (GameSaveData, int)newGameSave = CreateNewSaveGame();
        // trigger event to denote that new save game file was created
        NewSaveCreatedEvent.Trigger(newGameSave.Item1, newGameSave.Item2);

        // create a player (with no parent as network objects should be on root??)
        //GameObject createdPlayer = Instantiate(playerPrefab);
        //createdPlayer.GetComponent<PlayerNetworkCoordinator>();
    }
Exemplo n.º 3
0
 public void ButtonPressYes()
 {
     // trigger event to denote that a new game should be started
     StartNewGameEvent.Trigger();
 }