Пример #1
0
    public override void Update()
    {
        if (!NrTSingleton <ContentsLimitManager> .Instance.IsWillSpend())
        {
            return;
        }
        NrMyCharInfo kMyCharInfo = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo;

        if (kMyCharInfo == null)
        {
            return;
        }
        if (this.m_nCurrentActivity != kMyCharInfo.m_nActivityPoint || this.m_nMaxActivity != kMyCharInfo.m_nMaxActivityPoint)
        {
            this.m_nCurrentActivity = kMyCharInfo.m_nActivityPoint;
            this.m_nMaxActivity     = kMyCharInfo.m_nMaxActivityPoint;
            this.SetActivityPointUI();
        }
        if (this.m_fActivityUpdateTime < Time.realtimeSinceStartup)
        {
            MyCharInfoDlg myCharInfoDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.MYCHARINFO_DLG) as MyCharInfoDlg;

            if (myCharInfoDlg == null)
            {
                return;
            }
            this.m_lbActivityTime.SetText(myCharInfoDlg.StrActivityTime);
            this.m_fActivityUpdateTime = Time.realtimeSinceStartup + 1f;
            this.SetActivityPointUI();
        }
    }
Пример #2
0
    public void SetActivityPointUI()
    {
        MyCharInfoDlg myCharInfoDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.MYCHARINFO_DLG) as MyCharInfoDlg;

        if (myCharInfoDlg == null)
        {
            return;
        }
        if (this.m_nBeforeActivity == myCharInfoDlg.CurrentActivity)
        {
            return;
        }
        this.m_nBeforeActivity = myCharInfoDlg.CurrentActivity;
        string empty = string.Empty;

        if (myCharInfoDlg.CurrentActivity > myCharInfoDlg.MaxActivity)
        {
            string textColor = NrTSingleton <CTextParser> .Instance.GetTextColor("1304");

            string textColor2 = NrTSingleton <CTextParser> .Instance.GetTextColor("1002");

            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
            {
                NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2791"),
                "CurrentNum",
                textColor + myCharInfoDlg.CurrentActivity.ToString() + textColor2,
                "MaxNum",
                myCharInfoDlg.MaxActivity
            });
        }
        else
        {
            NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
            {
                NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("2791"),
                "CurrentNum",
                myCharInfoDlg.CurrentActivity,
                "MaxNum",
                myCharInfoDlg.MaxActivity
            });
        }
        this.m_lb_WillNum.SetText(empty);
    }
    public override void Update()
    {
        base.Update();
        MyCharInfoDlg myCharInfoDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.MYCHARINFO_DLG) as MyCharInfoDlg;

        if (myCharInfoDlg != null)
        {
            myCharInfoDlg.Update();
        }
        if (this.m_bAniPlay && !this.m_goAnimation.animation.isPlaying)
        {
            SoldierBatch.DailyDungeonDifficulty = this.m_nDifficult;
            SoldierBatch.SOLDIER_BATCH_MODE     = eSOLDIER_BATCH_MODE.MODE_DAILYDUNGEON;
            FacadeHandler.PushStage(Scene.Type.SOLDIER_BATCH);
            this.m_bAniPlay        = false;
            this.m_bRestoreReserve = true;
            UIDataManager.MuteSound(false);
        }
    }
Пример #4
0
    public void SetReload()
    {
        BookmarkDlg bookmarkDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.BOOKMARK_DLG) as BookmarkDlg;

        if (bookmarkDlg != null)
        {
            bookmarkDlg.SetBookmarkInfo();
        }
        MainMenuDlg mainMenuDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.MAINMENU_DLG) as MainMenuDlg;

        if (mainMenuDlg != null)
        {
            mainMenuDlg.ShowHideButton();
        }
        MyCharInfoDlg myCharInfoDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.MYCHARINFO_DLG) as MyCharInfoDlg;

        if (myCharInfoDlg != null)
        {
            myCharInfoDlg.SetCurrentNoticeUpdate();
        }
    }
Пример #5
0
    public void PlayEnd(int tableIndex, int index, long money, ITEM item)
    {
        this.m_bSkip        = false;
        this.m_Skip.Visible = false;
        this.resultTextTime = Time.realtimeSinceStartup;
        this.request        = true;
        NrMyCharInfo kMyCharInfo = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo;

        if (kMyCharInfo == null)
        {
            return;
        }
        if (this.m_fActivityUpdateTime < Time.realtimeSinceStartup)
        {
            MyCharInfoDlg myCharInfoDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.MYCHARINFO_DLG) as MyCharInfoDlg;

            if (myCharInfoDlg == null)
            {
                return;
            }
            this.m_lbActivityTime.SetText(myCharInfoDlg.StrActivityTime);
            this.m_fActivityUpdateTime = Time.realtimeSinceStartup + 1f;
            this.SetActivityPointUI();
        }
        this.textureKey = string.Empty;
        ExplorationTable explorationTable = NrTSingleton <ExplorationManager> .Instance.GetExplorationTable(kMyCharInfo.GetLevel(), tableIndex);

        if (explorationTable != null)
        {
            this.textureKey = this.m_szPath + explorationTable.m_szTexture[index];
            if (null == NrTSingleton <UIImageBundleManager> .Instance.GetTexture(this.textureKey))
            {
                string  str     = string.Format("{0}", "UI/Exploration/" + this.textureKey + NrTSingleton <UIDataManager> .Instance.AddFilePath);
                WWWItem wWWItem = Holder.TryGetOrCreateBundle(str + Option.extAsset, NkBundleCallBack.UIBundleStackName);
                wWWItem.SetItemType(ItemType.USER_ASSETB);
                wWWItem.SetCallback(new PostProcPerItem(this.SetBundleImage), this.textureKey);
                TsImmortal.bundleService.RequestDownloadCoroutine(wWWItem, DownGroup.RUNTIME, true);
            }
            if (0L < money)
            {
                this.resultText = string.Empty;
                string textFromInterface = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1928");

                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref this.resultText, new object[]
                {
                    textFromInterface,
                    "count",
                    money
                });
            }
            else if (0 < item.m_nItemUnique)
            {
                this.resultText = string.Empty;
                string textFromInterface2 = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1929");

                NrTSingleton <CTextParser> .Instance.ReplaceParam(ref this.resultText, new object[]
                {
                    textFromInterface2,
                    "itemname",
                    NrTSingleton <ItemManager> .Instance.GetItemNameByItemUnique(item.m_nItemUnique),
                    "count",
                    item.m_nItemNum
                });
            }
        }
        base.SetShowLayer(1, false);
        if (NrTSingleton <ContentsLimitManager> .Instance.IsWillSpend())
        {
            if (0L < kMyCharInfo.m_nActivityPoint)
            {
                base.SetShowLayer(2, true);
                this.m_bContinue = true;
                base.SetShowLayer(3, true);
            }
            else
            {
                base.SetShowLayer(2, true);
                base.SetShowLayer(3, true);
            }
        }
    }
Пример #6
0
    public override void Update()
    {
        if (NrTSingleton <ContentsLimitManager> .Instance.IsWillSpend())
        {
            NrMyCharInfo kMyCharInfo = NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo;
            if (kMyCharInfo == null)
            {
                return;
            }
            if (this.m_nCurrentActivity != kMyCharInfo.m_nActivityPoint || this.m_nMaxActivity != kMyCharInfo.m_nMaxActivityPoint)
            {
                this.m_nBeforeActivity  = this.m_nCurrentActivity;
                this.m_nCurrentActivity = kMyCharInfo.m_nActivityPoint;
                this.m_nMaxActivity     = kMyCharInfo.m_nMaxActivityPoint;
            }
            if (this.m_fActivityUpdateTime < Time.realtimeSinceStartup)
            {
                MyCharInfoDlg myCharInfoDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.MYCHARINFO_DLG) as MyCharInfoDlg;

                if (myCharInfoDlg == null)
                {
                    return;
                }
                this.m_lbActivityTime.SetText(myCharInfoDlg.StrActivityTime);
                this.m_fActivityUpdateTime = Time.realtimeSinceStartup + 1f;
                this.SetActivityPointUI();
            }
        }
        if (!this.m_bSkip && !this.sendPacket && null != this.walkAniGameObject && !this.walkAniGameObject.animation.isPlaying && this.walkGameObject.activeInHierarchy)
        {
            this.walkGameObject.SetActive(false);
            this.rootGameObject.SetActive(true);
            if (null != this.childGameObject)
            {
                this.childGameObject.SetActive(false);
            }
            this.aniGameObject.animation.Play();
            this.resultTextTime = Time.realtimeSinceStartup;
            GS_EXPLORATION_REQ gS_EXPLORATION_REQ = new GS_EXPLORATION_REQ();
            int num = 0;
            foreach (NkSoldierInfo current in NrTSingleton <ExplorationManager> .Instance.GetSolInfo())
            {
                if (num >= 6)
                {
                    break;
                }
                gS_EXPLORATION_REQ.m_nSolID[num] = current.GetSolID();
                num++;
            }
            SendPacket.GetInstance().SendObject(eGAME_PACKET_ID.GS_EXPLORATION_REQ, gS_EXPLORATION_REQ);
            this.sendPacket = true;
        }
        if (null != this.childGameObject && !this.imageSet && this.request)
        {
            Texture2D texture = NrTSingleton <UIImageBundleManager> .Instance.GetTexture(this.textureKey);

            if (null != texture)
            {
                Material material = new Material(Shader.Find("Transparent/Vertex Colored" + NrTSingleton <UIDataManager> .Instance.AddFilePath));
                if (null != material)
                {
                    material.mainTexture = texture;
                    if (null != this.childGameObject.renderer)
                    {
                        this.childGameObject.renderer.sharedMaterial = material;
                        this.childGameObject.SetActive(true);
                    }
                    this.imageSet = true;
                }
            }
        }
        if (0f < this.resultTextTime && Time.realtimeSinceStartup - this.resultTextTime >= 1.5f)
        {
            TsAudioManager.Container.RequestAudioClip("UI_SFX", "EXPLOERE", "ACQUIRE", new PostProcPerItem(NrAudioClipDownloaded.OnEventAudioClipDownloadedImmedatePlay));
            this.m_ResultText.Visible = true;
            this.m_ResultText.Text    = this.resultText;
            this.resultTextTime       = 0f;
        }
        if (null != this.aniGameObject && null != this.aniGameObject.animation && !this.aniGameObject.animation.isPlaying)
        {
            this.m_Continue.controlIsEnabled = true;
            this.sendPacket = false;
        }
    }
    public void SetBasicData(sbyte nDayOfWeek, bool bCheck)
    {
        if (NrTSingleton <NkCharManager> .Instance.m_kMyCharInfo == null)
        {
            this.Close();
            return;
        }
        DAILYDUNGEON_INFO dailyDungeonInfo = NrTSingleton <DailyDungeonManager> .Instance.GetDailyDungeonInfo((int)nDayOfWeek);

        EVENT_DAILY_DUNGEON_INFO dailyDungeonInfo2;

        if (dailyDungeonInfo != null)
        {
            this.m_nDayOfWeek = (sbyte)dailyDungeonInfo.m_i32DayOfWeek;
            if (!bCheck)
            {
                this.m_nDifficult = dailyDungeonInfo.m_i8Diff;
            }
            dailyDungeonInfo2 = EVENT_DAILY_DUNGEON_DATA.GetInstance().GetDailyDungeonInfo(this.m_nDifficult, this.m_nDayOfWeek);
            if (dailyDungeonInfo2 == null)
            {
                this.Close();
                return;
            }
            if (dailyDungeonInfo.m_i32IsClear <= 1)
            {
                if (dailyDungeonInfo.m_i32IsClear != 1)
                {
                    this.m_btStart.Visible  = true;
                    this.m_btReward.Visible = false;
                    if (this.m_goGageEffect != null)
                    {
                        this.m_goGageEffect.SetActive(false);
                    }
                }
                else
                {
                    this.m_btStart.Visible  = false;
                    this.m_btReward.Visible = true;
                    if (this.m_goGageEffect != null)
                    {
                        this.m_goGageEffect.SetActive(true);
                    }
                }
                if ((int)dailyDungeonInfo.m_i8IsReward == 1)
                {
                    this.m_btStart.Visible            = false;
                    this.m_btReward.Visible           = false;
                    this.m_btHeroInfo.Visible         = false;
                    this.m_lbHeroInfo.Visible         = false;
                    this.m_dtRightBottomFrame.Visible = false;
                    if (this.m_goGageEffect != null)
                    {
                        this.m_goGageEffect.SetActive(true);
                    }
                    MyCharInfoDlg myCharInfoDlg = NrTSingleton <FormsManager> .Instance.GetForm(G_ID.MYCHARINFO_DLG) as MyCharInfoDlg;

                    if (myCharInfoDlg != null)
                    {
                        myCharInfoDlg.UpdateNoticeInfo();
                    }
                }
            }
        }
        else
        {
            this.m_nDayOfWeek = nDayOfWeek;
            if ((int)this.m_nDifficult <= 0 || !bCheck)
            {
                this.m_nDifficult = 1;
            }
            dailyDungeonInfo2 = EVENT_DAILY_DUNGEON_DATA.GetInstance().GetDailyDungeonInfo(this.m_nDifficult, this.m_nDayOfWeek);
            if (dailyDungeonInfo2 == null)
            {
                this.Close();
                return;
            }
            this.m_btStart.Visible  = true;
            this.m_btReward.Visible = false;
            if (this.m_goGageEffect != null)
            {
                this.m_goGageEffect.SetActive(false);
            }
        }
        if (dailyDungeonInfo2 == null)
        {
            this.Close();
            return;
        }
        string textFromMap = NrTSingleton <NrTextMgr> .Instance.GetTextFromMap(dailyDungeonInfo2.i32TextKey.ToString());

        this.m_lbTitle.SetText(textFromMap);
        ITEM iTEM = new ITEM();

        iTEM.m_nItemUnique = dailyDungeonInfo2.i32RewardItemUnique;
        iTEM.m_nItemNum    = dailyDungeonInfo2.i32RewardItemNum;
        this.m_itRewardItem.SetItemTexture(iTEM);
        string empty = string.Empty;

        NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
        {
            NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1697"),
            "itemname",
            NrTSingleton <ItemManager> .Instance.GetItemNameByItemUnique(dailyDungeonInfo2.i32RewardItemUnique),
            "count",
            dailyDungeonInfo2.i32RewardItemNum.ToString()
        });

        this.m_lbRewardName.SetText(empty);
        this.m_dtDifficulty.SetTexture("Win_I_WorrGradeS" + this.m_nDifficult.ToString());
        this.m_lbMonsterInfo.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface(dailyDungeonInfo2.i32ExplainText.ToString()));
        this.m_dtMonsterImage.SetTextureFromBundle("ui/soldier/512/" + dailyDungeonInfo2.szMonIMG);
    }