コード例 #1
0
    public override void Update()
    {
        if (Mathf.Abs(Time.time - this.m_fUpdateTime) < 1f)
        {
            return;
        }
        if (NrLoadPageScreen.IsShow())
        {
            base.AllHideLayer();
            this.m_fStartTime = Time.time;
            return;
        }
        float  num   = this.m_fEndTime - Time.time;
        int    num2  = (int)(num / 3600f);
        int    num3  = (int)((num - (float)num2 * 3600f) / 60f);
        int    num4  = (int)((num - (float)num2 * 3600f - (float)num3 * 60f) % 60f);
        string empty = string.Empty;

        NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[]
        {
            NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1527"),
            "hour",
            num2.ToString(),
            "min",
            num3.ToString(),
            "sec",
            num4.ToString()
        });

        if (this.m_eShowMode == IndunTime_DLG.eSHOW_MODE.eSHOW_MODE_NORMAL)
        {
            if (Mathf.Abs(Time.time - this.m_fStartTime) < this.m_fChangeTime)
            {
                base.ShowLayer(1);
                this.m_lbTime.SetText(empty);
            }
            else
            {
                base.ShowLayer(2);
                base.SetLocation(GUICamera.width / 2f - base.GetSize().x / 2f, this.m_fTopY);
                this.m_eShowMode = IndunTime_DLG.eSHOW_MODE.eSHOW_MODE_SMALL;
                this.m_bxStayTime.SetText(empty);
            }
        }
        else if (this.m_eShowMode == IndunTime_DLG.eSHOW_MODE.eSHOW_MODE_SMALL)
        {
            base.ShowLayer(2);
            this.m_bxStayTime.SetText(empty);
        }
        this.m_fUpdateTime = Time.time;
    }
コード例 #2
0
 public override void SetComponent()
 {
     this.m_lbTitle    = (base.GetControl("Label_Title") as Label);
     this.m_lbTime     = (base.GetControl("Label_Time") as Label);
     this.m_bxStayTime = (base.GetControl("Box_Dun_StayTime") as Box);
     if (this.m_lbTitle != null)
     {
         this.m_lbTitle.SetText(NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("1529"));
     }
     this.m_eShowMode = IndunTime_DLG.eSHOW_MODE.eSHOW_MODE_NORMAL;
     if (TsPlatform.IsMobile)
     {
         base.SetLocation(GUICamera.width / 2f - base.GetSize().x / 2f, 0f);
     }
     else
     {
         base.SetLocation(GUICamera.width / 2f - base.GetSize().x / 2f, GUICamera.height * 0.25f - base.GetSize().y / 2f);
     }
 }