Beispiel #1
0
        public virtual void Awake()
        {
            IsFirstGameAfterLoading = true;
            IntroGary      = null;
            m_minigame     = MinigameManager.GetActive <mg_JetpackReboot>();
            m_gameBalance  = base.gameObject.AddComponent <mg_jr_GameData>();
            ScrollingSpeed = base.gameObject.AddComponent <mg_jr_ScrollingSpeed>();
            Odometer       = base.gameObject.AddComponent <mg_jr_Odometer>();
            Odometer.Init(m_gameBalance, m_minigame.GoalManager);
            m_timeToZoomCameraForTurbo = m_gameBalance.TurboCameraZoomRate * Mathf.Abs(1.1600001f);
            ScrollingSpeed.Init(m_gameBalance, Odometer);
            ScrollingSpeed.ScrollingEnabled = false;
            Player = m_minigame.Resources.GetPooledResourceByComponent <mg_jr_Penguin>(mg_jr_ResourceList.GAME_PREFAB_PENGUIN);
            Player.transform.parent = base.transform;
            GameObject pooledResource = m_minigame.Resources.GetPooledResource(mg_jr_ResourceList.GAME_PREFAB_EFFECT_TRANSITION);

            m_transition = pooledResource.GetComponent <mg_jr_Transition>();
            m_transition.transform.parent = base.transform;
            GameObject gameObject = new GameObject("mg_jr_EnvironmentManager");

            gameObject.transform.parent = base.transform;
            EnvironmentManager          = gameObject.AddComponent <mg_jr_EnvironmentManager>();
            GameObject gameObject2 = new GameObject("mg_jr_LevelContainer");

            gameObject2.transform.parent = base.transform;
            m_levelManager = gameObject2.AddComponent <mg_jr_LevelManager>();
            m_levelManager.Init(ScrollingSpeed, this);
            m_turboSpeedLines = m_minigame.Resources.GetPooledResourceByComponent <mg_jr_SpeedLineScreenFx>(mg_jr_ResourceList.PREFAB_TURBO_SPEEDLINES);
            m_turboSpeedLines.transform.parent = base.transform;
            m_turboSpeedLines.gameObject.SetActive(value: false);
            m_turboPlayArea = new Bounds(Vector3.zero, new Vector3(10f * Camera.main.aspect, 10f, 40f));
        }
Beispiel #2
0
 private void Awake()
 {
     base.gameObject.SetActive(value: false);
     SpriteRenderer[] componentsInChildren = GetComponentsInChildren <SpriteRenderer>(includeInactive: true);
     foreach (SpriteRenderer spriteRenderer in componentsInChildren)
     {
         if (spriteRenderer.gameObject.name.Equals("mg_jr_TransitionWhiteOverlay"))
         {
             m_whiteSplash = spriteRenderer;
             m_whiteSplash.sortingOrder = mg_jr_SpriteDrawingLayers.Instance.SpriteOrder(mg_jr_SpriteDrawingLayers.DrawingLayers.MAX);
         }
         else if (spriteRenderer.gameObject.name.Equals("mg_jr_TransitionBackground"))
         {
             spriteRenderer.sortingOrder = mg_jr_SpriteDrawingLayers.Instance.SpriteOrder(mg_jr_SpriteDrawingLayers.DrawingLayers.TRANSITION_BG);
         }
     }
     m_speedLineFX = GetComponentsInChildren <mg_jr_SpeedLineScreenFx>(includeInactive: true)[0];
     Assert.NotNull(m_whiteSplash, "White splash renderer not found");
 }