Exemple #1
0
        private void Awake()
        {
            m_PuffleContainer   = MinigameSpriteHelper.CreateContainer("mg_pr_PuffleContainer");
            m_ObsticleContainer = MinigameSpriteHelper.CreateContainer("mg_pr_ObsticleContainer");
            Minigame            = MinigameManager.GetActive <mg_PuffleRoundup>();
            penBoundsGO         = Minigame.transform.Find("mg_pr_GameContainer/mg_pr_pf_GameBG(Clone)/mg_pr_pf_Pen").gameObject;
            GameObject baseContainer = GetComponent <mg_pr_GameLogic>().BaseContainer;

            MinigameSpriteHelper.AssignParent(m_PuffleContainer, baseContainer);
            MinigameSpriteHelper.AssignParent(m_ObsticleContainer, baseContainer);
        }
        protected void Awake()
        {
            BaseContainer = MinigameSpriteHelper.CreateContainer("mg_pr_GameContainer");
            mg_PuffleRoundup active = MinigameManager.GetActive <mg_PuffleRoundup>();

            m_background = active.Resources.GetInstancedResource(mg_pr_EResourceList.GAME_ASSET_BACKGROUND);
            MinigameSpriteHelper.SetSpriteLayer(m_background, -100);
            Vector3 localScale = m_background.transform.localScale;

            MinigameSpriteHelper.FitSpriteToScreen(active.MainCamera, m_background, _preserveAspect: false);
            MinigameSpriteHelper.AssignParent(m_background, BaseContainer);
            BaseContainer.transform.localScale = m_background.transform.localScale;
            m_background.transform.localScale  = localScale;
            BaseContainer.transform.parent     = active.transform;
            m_caughtGo  = GetComponentInChildren <mg_pr_UICaughtCount>();
            m_escapedGo = GetComponentInChildren <mg_pr_UIEscapedCount>();
        }