コード例 #1
0
    void OnBoxClick()
    {
        if (false == m_BoxCanGet.activeInHierarchy)
        {
            return;
        }

        Tab_StoryCopySceneChapter tabChapter = TableManager.GetStoryCopySceneChapterByID(m_ChapterId, 0);

        if (tabChapter == null)
        {
            return;
        }

        if (m_AwardIndex < 0 || m_AwardIndex >= tabChapter.getLevelAwardCount())
        {
            return;
        }

        GameManager.gameManager.PlayerDataPool.JuQingCopySceneData.ReqChapterLevelAward(m_ChapterId, m_AwardIndex);

        if (JuQingWindow.Instance() != null && JuQingWindow.Instance().NewPlayerGuideIndex == 1)
        {
            if (GameManager.gameManager.PlayerDataPool.JuQingCopySceneData != null)
            {
                // 算总星星数的 应该可以提出个函数来
                List <StoryCopySceneChapterInfo> chapterInfoList = GameManager.gameManager.PlayerDataPool.JuQingCopySceneData.GetChapterInfoList();
                if (chapterInfoList == null || chapterInfoList.Count <= 0)
                {
                    JuQingWindow.Instance().NewPlayerGuideIndex = GlobeVar.INVALID_ID;
                    NewPlayerGuidLogic.CloseWindow();
                    return;
                }

                int nTotalStarCount = 0;
                StoryCopySceneChapterInfo currentChapterInfo = chapterInfoList[0];
                for (int i = 0; i < currentChapterInfo._ContaindLevelList.Count; i++)
                {
                    int levelID    = currentChapterInfo._ContaindLevelList[i];
                    int nStarCount = GameManager.gameManager.PlayerDataPool.JuQingCopySceneData.GetLevelByLevelID(levelID).GetStarCount();
                    nTotalStarCount += nStarCount;
                }

                if (nTotalStarCount < JuQingCopySceneData.ChapterAwardStarReq[0])
                {
                    JuQingWindow.Instance().NewPlayerGuideIndex = GlobeVar.INVALID_ID;
                    NewPlayerGuidLogic.CloseWindow();
                    return;
                }

                JuQingWindow.Instance().NewPlayerGuide(2);
            }
        }
    }
コード例 #2
0
    void OnLevel4Clicked()
    {
        var chapterInfoList = GameManager.gameManager.PlayerDataPool.JuQingCopySceneData.GetChapterInfoList();

        if (chapterInfoList == null || currentSelectedChapterIdx <= 0 || currentSelectedChapterIdx > chapterInfoList.Count)
        {
            return;
        }
        StoryCopySceneChapterInfo currentChapterInfo = chapterInfoList[currentSelectedChapterIdx - 1];
        int levelID = currentChapterInfo._ContaindLevelList [3];

        if (GameManager.gameManager.PlayerDataPool.JuQingCopySceneData.IsStoryCopySceneLocked(levelID))
        {
            GUIData.AddNotifyData("#{11143}");
            return;
        }
        UIManager.ShowUI(UIInfo.StoryCopySceneInfoRoot, SetStoryCopySceneInfoWindowData, levelID);
    }
コード例 #3
0
    void UpdateChapterAward()
    {
        bool bHide = false;

        if (TabBg.activeSelf)
        {
            bHide = true;
        }
        else
        {
            bHide = false;
        }
        var chapterInfoList = GameManager.gameManager.PlayerDataPool.JuQingCopySceneData.GetChapterInfoList();

        if (chapterInfoList == null || currentSelectedChapterIdx <= 0 || currentSelectedChapterIdx > chapterInfoList.Count)
        {
            return;
        }
        StoryCopySceneChapterInfo currentChapterInfo = chapterInfoList[currentSelectedChapterIdx - 1];

        for (int i = 0; i < m_ChapterAwardItem.Length && i < JuQingCopySceneData.ChapterAwardStarReq.Length; i++)
        {
            if (currentChapterInfo.m_bAwardGot.Count <= 0)
            {
                m_ChapterAwardItem[i].Init(currentSelectedChapterIdx, i, m_nTotalStar, false, bHide);
            }
            else if (i < currentChapterInfo.m_bAwardGot.Count)
            {
                m_ChapterAwardItem[i].Init(currentSelectedChapterIdx, i, m_nTotalStar, currentChapterInfo.m_bAwardGot[i], bHide);
            }
        }

        m_ChapterAwardSprite.fillAmount = (float)m_nTotalStar / (float)(JuQingCopySceneData.ChapterAwardStarReq[JuQingCopySceneData.ChapterAwardStarReq.Length - 1]);


        if (m_ChapterAwardLabel != null)
        {
            m_ChapterAwardLabel.text = m_nTotalStar + "/12";
        }
    }
コード例 #4
0
    public void NewPlayerGuide(int nIndex)
    {
        var chapterInfoList = GameManager.gameManager.PlayerDataPool.JuQingCopySceneData.GetChapterInfoList();

        if (null == chapterInfoList || 0 >= chapterInfoList.Count)
        {
            return;
        }
        StoryCopySceneChapterInfo currentChapterInfo = chapterInfoList[0];

        m_NewPlayerGuideIndex = nIndex;
        switch (nIndex)
        {
        case 1:
            // 第一步删除
            if (m_FirstLevelAwardBtn)
            {
                if (currentChapterInfo.m_bLevelAwardGot[0])
                {
                    NewPlayerGuide(2);
                }
                else
                {
                    NewPlayerGuidLogic.OpenWindow_Circle(m_FirstLevelAwardBtn, 100, "", "left", 0, true, true);
                }
            }
            break;

        case 2:
            if (m_FirstChapterAwardBtn && !currentChapterInfo.m_bAwardGot[0])
            {
                NewPlayerGuidLogic.OpenWindow_Circle(m_FirstChapterAwardBtn, 100, "", "left", 0, true, true);
            }
            break;
        }
    }
コード例 #5
0
    void UpdateLevels()
    {
        UpdateBuyCount();

//        for (int i = 0; i < m_LevelArrowNor.Length && i < m_LevelArrowDis.Length; i++ )
//        {
//            m_LevelArrowNor[i].SetActive(false);
//            m_LevelArrowDis[i].SetActive(false);
//        }

        if (currentSelectedChapterIdx < 1)
        {
            currentSelectedChapterIdx = 1;
        }
        //StoryCopySceneScoreInfo lastScore = GameManager.gameManager.PlayerDataPool.JuQingCopySceneData.GetAndClearLastScore();
        var chapterInfoList = GameManager.gameManager.PlayerDataPool.JuQingCopySceneData.GetChapterInfoList();

        if (chapterInfoList == null || currentSelectedChapterIdx <= 0 || currentSelectedChapterIdx > chapterInfoList.Count)
        {
            return;
        }
        StoryCopySceneChapterInfo currentChapterInfo = chapterInfoList[currentSelectedChapterIdx - 1];

        Tab_StoryCopySceneChapter chapter = TableManager.GetStoryCopySceneChapterByID(currentChapterInfo.m_nID, 0);

        if (chapter != null)
        {
            ChapterTitleLabel.text = chapter.ChapterName;
        }

        m_nTotalStar = 0;
        for (int i = 0; i < 4; i++)
        {
            JuQingLevelItem item = null;
            switch (i)
            {
            case 0:
            {
                item = Level1;
                break;
            }

            case 1:
            {
                item = Level2;
                break;
            }

            case 2:
            {
                item = Level3;
                break;
            }

            case 3:
            {
                item = Level4;
                break;
            }
            }

            if (item == null)
            {
                continue;
            }

            if (i >= currentChapterInfo._ContaindLevelList.Count)
            {
                item.gameObject.SetActive(false);
                continue;
            }

            item.gameObject.SetActive(true);
            int levelID    = currentChapterInfo._ContaindLevelList [i];
            int nStarCount = GameManager.gameManager.PlayerDataPool.JuQingCopySceneData.GetLevelByLevelID(levelID).GetStarCount();
            item.Init(currentSelectedChapterIdx, levelID);
            m_nTotalStar += nStarCount;
        }

        UpdateChapterAward();
    }