Esempio n. 1
0
    void OnClickNext()
    {
        Time.timeScale = 1f;
        AudioController.StopMusic();
        CorePlayManager.Instance.CleanAll();
        StaticMonoBehaviour.Instance.StopAllCoroutines();
        ObjectPool.ClearPool("RhythmController");

        LevelData levelData = LevelConfig.AllLevelDic[StaticData.NowLevelData.nextLevelID];

        var levelStatus = SelfPlayerData.Instance.GetLevelStatusByLevelId(levelData.levelID);

        if (levelStatus.isPay || DebugConfigController.Instance._Debug)
        {
            if (levelStatus.isUnLock)
            {
                StaticData.LevelID         = levelData.levelID;
                CorePlayData.BossLife      = levelData.bosslife;
                CorePlayData.SongOffset    = SongConfig.Instance.GetSongOffsetBySongIDAndLevelDiffculty(LanguageManager.GetSongIdFromLanguage(levelData.songID), levelData.LevelDifficulty);
                CorePlayData.SongID        = LanguageManager.GetSongIdFromLanguage(levelData.songID);
                CorePlayData.EducationText = SongConfig.Instance.m_items[LanguageManager.GetSongIdFromLanguage(levelData.songID)]["educationText"];
                LoadSceneManager.Instance.LoadPlayScene(levelData);
                Close();
            }
            else
            {
                CommonPromptNode node = PageManager.Instance.CurrentPage.AddNode <CommonPromptNode> (true) as CommonPromptNode;
                node.InitPrompt(false, SelfType.Prompt, SelfType.NeedUnlock,
                                LanguageManager.languageType == LanguageType.Chinese ? TexSure : TexSure_EN,
                                LanguageManager.languageType == LanguageType.Chinese ? TexCancel : TexCancel_EN,
                                null, null);
            }
        }
        else
        {
            switch (StaticData.LevelID)
            {
            case 1004:
                AnalysisManager.Instance.OnEvent("payNode_level4", null);
                break;

            case 1020:
                AnalysisManager.Instance.OnEvent("payNode_level20", null);
                break;

            case 1032:
                AnalysisManager.Instance.OnEvent("payNode_level32", null);
                break;

            default:
                break;
            }
            PageManager.Instance.CurrentPage.AddNode <CommonPromptNode> (true);
            m_promptNode = PageManager.Instance.CurrentPage.AddNode <CommonPromptNode> (true) as CommonPromptNode;
            m_promptNode.InitPrompt(false, SelfType.Prompt, SelfType.NeedPay,
                                    LanguageManager.languageType == LanguageType.Chinese ? TexUnlock : TexUnlock_EN,
                                    LanguageManager.languageType == LanguageType.Chinese ? TexCancel : TexCancel_EN,
                                    this.OpenPay, null);
        }
    }
Esempio n. 2
0
    private void OnGetGameInfoFailiOS()
    {
        CommonPromptNode node = PageManager.Instance.CurrentPage.AddNode <CommonPromptNode>(true) as CommonPromptNode;

        node.InitPrompt(true, SelfType.Prompt, SelfType.NeedRecontact,
                        LanguageManager.languageType == LanguageType.Chinese ? m_recontact : m_recontact_en, null,
                        onClickRecontact, null, true);
    }
Esempio n. 3
0
 public static void LoginOnOtherDivices(bool bReloadNow = true)
 {
     if (bReloadNow)
     {
         CommonPromptNode node = PageManager.Instance.CurrentPage.AddNode <CommonPromptNode>(true) as CommonPromptNode;
         node.InitPrompt(true, SelfType.Prompt, SelfType.LoginOnOtherDivice,
                         LanguageManager.languageType == LanguageType.Chinese ? m_spriteSure : m_spriteSure_EN, null,
                         GameLogOut, null, true);
     }
     else
     {
         m_bNeedLogout = true;
     }
 }
Esempio n. 4
0
 public void OnPointerClick(PointerEventData eventData)
 {
     if (_bookSceneManager != null)
     {
         var levelStatus = SelfPlayerData.Instance.GetLevelStatusByLevelId(levelData.levelID);
         //bool pay = levelData.levelID % 100 > 8 ? true : false;
         if (levelStatus.isPay || DebugConfigController.Instance._Debug)
         {
             if (levelStatus.isUnLock || DebugConfigController.Instance._Debug)
             {
                 if (SelfPlayerData.Instance.GetMaxLevelId() == levelData.levelID)
                 {
                     LoadSceneManager.Instance.LoadPlayScene(levelData);
                 }
                 else
                 {
                     _bookSceneManager.onReceiveLevelData.Invoke(levelData);
                 }
             }
             else
             {
                 CommonPromptNode node = PageManager.Instance.CurrentPage.AddNode <CommonPromptNode> (true) as CommonPromptNode;
                 node.InitPrompt(false, SelfType.Prompt, SelfType.NeedUnlock,
                                 LanguageManager.languageType == LanguageType.Chinese ? m_page.TexSure : m_page.TexSure_EN,
                                 LanguageManager.languageType == LanguageType.Chinese ? m_page.TexCancel : m_page.TexCancel_EN,
                                 null, null);
             }
         }
         else
         {
             AnalysisManager.Instance.OnEvent("payNode_other", null);
             PageManager.Instance.CurrentPage.AddNode <CommonPromptNode> (true);
             m_promptNode = PageManager.Instance.CurrentPage.AddNode <CommonPromptNode> (true) as CommonPromptNode;
             m_promptNode.InitPrompt(false, SelfType.Prompt, SelfType.NeedPay,
                                     LanguageManager.languageType == LanguageType.Chinese ? m_page.TexUnlock : m_page.TexUnlock_EN,
                                     LanguageManager.languageType == LanguageType.Chinese ? m_page.TexCancel : m_page.TexCancel_EN,
                                     this.OpenPay, null);
         }
     }
 }
Esempio n. 5
0
    /// <summary>
    /// 获取游戏信息的回调函数,这个版本只有版本号,之后热更新一类的可以放在里面
    /// </summary>
    /// <param name="result">Result.</param>
    private void OnGetGameInfoSuccessiOS(string result)
    {
        //success
        JsonData resultData = JsonMapper.ToObject(result);

        bool bSuccess = false;

        if (null == resultData["status"] || !bool.TryParse(resultData["status"].ToString(), out bSuccess))
        {
            LogManager.LogError("[OnGetGameInfoSuccess]result has no statues\n",
                                "server result", result);
            return;
        }

        JsonData data = resultData["data"];

        if (bSuccess)
        {
            string[] curVersion       = AppInfo.AppVersion.Split('.');
            string[] serverVersion    = data["version"].ToString().Split('.');
            string[] serverMinVersion = data["minVersion"].ToString().Split('.');
            //测试代码
            //string testVersion = "1.05.02";
            //serverMinVersion = testVersion.Split('.');

            if (curVersion.Length != 3 || serverVersion.Length != 3 || serverMinVersion.Length != 3)
            {
                LogManager.LogError("[OnGetGameInfoSuccess]version invalid\n",
                                    "cur app version:", AppInfo.AppVersion + "\n",
                                    "server result", result);
                return;
            }
            //version com
            bool bMatch = true;
            for (int i = 0; i < 3; ++i)
            {
                if (int.Parse(curVersion[i]) < int.Parse(serverMinVersion[i]))
                {
                    bMatch = false;
                    break;
                }
            }

            if (bMatch)
            {
                ShowMainGame();
            }
            else
            {
                CommonPromptNode node = PageManager.Instance.CurrentPage.AddNode <CommonPromptNode>(true) as CommonPromptNode;
                node.InitPrompt(true, SelfType.Prompt, SelfType.NeedUpdateApp,
                                LanguageManager.languageType == LanguageType.Chinese ? m_sure : m_sure_en, null,
                                onClickUpdateApp, null, false);
            }
        }
        else
        {
            //not success
            CommonPromptNode node = PageManager.Instance.CurrentPage.AddNode <CommonPromptNode>(true) as CommonPromptNode;
            node.InitPrompt(true, SelfType.Prompt, SelfType.NeedRecontact,
                            LanguageManager.languageType == LanguageType.Chinese ? m_recontact : m_recontact_en, null,
                            onClickRecontact, null, true);
        }
    }