public static void Reset() { GameMetrics.Init(); instance.Init(); SegmentManager.activeTrack.UnhideObstacles(); if (instance.m_resultsScreen) { instance.m_resultsScreen.Deactivate(); } // create a ghost ship // GameObject ghostgo = (GameObject)Instantiate(MenuManager.shipGhostPrefabs[GameMetrics.selectedShip]); }
void Start() { _backEnd = new Backend(); if (instance == null) { instance = this; } else { Destroy(instance); } GameMetrics.Init(_defaultSprite, 4); _mapdata = new MapData(); _model = new DataModel(_levelGenerator.CreateField(ref _mapdata)); ReadMapData(); }
void Init() { if (Application.isEditor && GameMetrics.activeGameMode == GameMode.None) { GameMetrics.activeGameMode = GameMode.Speed; GameMetrics.selectedTrack = 1; } SetGameState(GameState.Loading); //instance.m_player = (Player)FindObjectOfType(typeof(Player)); MusicManager.Init(); instance.m_player = (Player)GameObject.FindObjectOfType(typeof(Player)); if (instance.m_player == null) { print("creating player"); GameObject playergo = (GameObject)Instantiate(MenuManager.shipPrefabs[GameMetrics.selectedShip]); instance.m_player = (Player)playergo.GetComponent(typeof(Player)); } instance.m_player.Init(); gameMode = GameMetrics.activeGameMode; print(gameMode + " " + Application.loadedLevelName); GameMetrics.Init(); ComboSystem.Init(); // GhostManager.Init(); m_endlessModeRemainingLives = m_endlessModeStartingLives; m_lapTime = 0f; m_bestLapTime = 1000f; m_currentLap = 0; m_firstService = true; m_speedModeTimeLeft = m_speedModeTime; m_targetTunnelColor = speedLevelData[0].tunnelColor; }