Пример #1
0
    // Update is called once per frame
    void Update()
    {
        if (Camera.main != null && !setAudioTime)
        {
            //Camera.mainCamera.audio.time = GameApp.GetInstance().GetGameState().MenuMusicTime;
            setAudioTime = true;
        }


        ArenaMenuPanel panel = panels[MenuName.ARENA] as ArenaMenuPanel;

        if (panel != null)
        {
            panel.Update();
        }

        for (int i = 0; i < MenuName.MENU_COUNT; i++)
        {
            if (panels[i] != null)
            {
                panels[i].UpdateLogic();
            }
        }



        ShopUI shopUI = panels[MenuName.SHOP] as ShopUI;

        if (shopUI != null)
        {
            shopUI.GetPurchaseStatus();
        }

        if (!ReviewDialogUI.GetInstance().IsVisible())
        {
            foreach (UITouchInner touch in iPhoneInputMgr.MockTouches())
            {
                if (m_UIManager != null)
                {
                    if (m_UIManager.HandleInput(touch))
                    {
                        continue;
                    }
                }
            }
        }
    }
Пример #2
0
    public void Update()
    {
        /*
         * if (Camera.mainCamera != null)
         * {
         *  if (!Camera.mainCamera.audio.isPlaying && !BattlePressed)
         *  {
         *      Camera.mainCamera.audio.Play();
         *  }
         * }
         */

        if (Time.time - startTime > 1.5f)
        {
            if (!GameApp.GetInstance().GetGameState().AlreadyCountered)
            {
                GameApp.GetInstance().GetGameState().AddScore(1);
                GameApp.GetInstance().GetGameState().AlreadyCountered = true;
            }

            if (!GameApp.GetInstance().GetGameState().AlreadyPopReview)
            {
                if (GameApp.GetInstance().GetGameState().GetScore() == 3 || GameApp.GetInstance().GetGameState().GetScore() == 6 || GameApp.GetInstance().GetGameState().GetScore() == 9)
                {
                    Debug.Log("Pop Review " + GameApp.GetInstance().GetGameState().GetScore());
                    ReviewDialogUI.GetInstance().ShowDialog();

                    GameApp.GetInstance().GetGameState().AlreadyPopReview = true;
                }
            }
        }


        if (avatar3DFrame != null)
        {
            avatar3DFrame.UpdateAnimation();
        }


        if (fadeTimer.Ready())
        {
            if (fadeTimer.Name == "StartMenu")
            {
                UIResourceMgr.GetInstance().UnloadAllUIMaterials();
                //GameApp.GetInstance().GetGameState().MenuMusicTime = Camera.mainCamera.audio.time;
                Application.LoadLevel(SceneName.START_MENU);
            }
            else
            {
                UIResourceMgr.GetInstance().UnloadAllUIMaterials();
                //GameApp.GetInstance().GetGameState().FirstTimeGame = false;
                GameApp.GetInstance().GetGameState().FromShopMenu = true;

                Application.LoadLevel(SceneName.MAP);

                /*
                 * if (GameApp.GetInstance().GetGameState().FirstTimeGame)
                 * {
                 *  Application.LoadLevel(SceneName.SCENE_TUTORIAL);
                 * }
                 * else
                 * {
                 *  int rnd = Random.RandomRange(0, 100);
                 *  int mod = GameApp.GetInstance().GetGameState().LevelNum % 2;
                 *  if (mod == 0)
                 *  {
                 *      Application.LoadLevel(SceneName.SCENE_HOSPITAL);
                 *  }
                 *  else
                 *  {
                 *      Application.LoadLevel(SceneName.SCENE_ARENA);
                 *  }
                 *
                 *  //else
                 *  {
                 *  //    Application.LoadLevel(SceneName.SCENE_PARKING);
                 *  }
                 * }
                 */
            }

            fadeTimer.Do();
        }
    }