public void StartGame(bool _startWithBonusRobot = false) { Assert.IsTrue(m_currentGameState.GetType() == typeof(GameLogicStateLaunchPad), "Not in valid state to start game"); UIManager.Instance.ClearScreenStack(); UIManager.Instance.OpenScreen("mg_jr_GameScreen", toShowDarkMask: false, null, null); m_minigame.MusicManager.SelectTrack(mg_jr_Sound.THEME_SONG_AMBIENT.ClipName(), _restart: true); if (_startWithBonusRobot) { Player.AddFreeRobotPenguin(); } Player.Launch(); ChangeState(new GameLogicStateNormalMode(this)); m_levelManager.AddEmptyLevelToQueue(m_gameBalance.EmptySpaceAtStartOfLevel); m_levelManager.ContinuousLevels = true; mg_jr_Scroller component = m_startPlatform.GetComponent <mg_jr_Scroller>(); component.enabled = true; }
private void SpawnStartPlatform() { if (m_startPlatform != null) { m_minigame.Resources.ReturnPooledResource(m_startPlatform); } m_startPlatform = m_minigame.Resources.GetInstancedResource(mg_jr_ResourceList.PREFAB_START_PLATFORM); Vector3 position = m_startPlatform.transform.position; position.x = m_minigame.VisibleWorldBounds.min.x; m_startPlatform.transform.position = position; m_startPlatform.transform.parent = base.transform; mg_jr_Scroller component = m_startPlatform.GetComponent <mg_jr_Scroller>(); component.enabled = false; SpriteRenderer component2 = m_startPlatform.GetComponent <SpriteRenderer>(); component2.sortingOrder = mg_jr_SpriteDrawingLayers.Instance.SpriteOrder(mg_jr_SpriteDrawingLayers.DrawingLayers.START_PLATFORM); }