public void Start()
        {
            DatabaseId = ArgumentStore.IdToLoad ?? DatabaseId;

            DbHandler = new EvolutionDatabaseHandler();

            EvolutionConfig = DbHandler.ReadConfig(DatabaseId);

            DbHandler.SetAutoloadId(DatabaseId);

            if (EvolutionConfig == null || EvolutionConfig.DatabaseId != DatabaseId)
            {
                throw new Exception("Did not retrieve expected config from database");
            }

            _matchControl = gameObject.GetComponent <EvolutionMatchController>();
            if (_matchControl == null)
            {
                _matchControl = gameObject.AddComponent <EvolutionMatchController>();
            }

            _mutationControl.Config = EvolutionConfig.MutationConfig;
            _matchControl.Config    = EvolutionConfig.MatchConfig;
            ShipConfig.Config       = EvolutionConfig.MatchConfig;

            ReadInGeneration();

            SpawnRaceGoal();

            SpawnShips();

            SpawnDrones();
        }
示例#2
0
 private void ReturnToMainMenu()
 {
     if (!string.IsNullOrEmpty(MainMenuSceneToLoad))
     {
         ArgumentStore.IdToLoad = null;
         _handler.SetAutoloadId(null);
         SceneManager.LoadScene(MainMenuSceneToLoad);
     }
 }