// Update is called once per frame
    void Update()
    {
        UpdateHomeHp();

        deltaTime += Time.deltaTime;
        if (GameTimeData.Instance.GetStartTag() && deltaTime > 1.0f)
        {
            TimeSpan span  = GameTimeData.Instance.GetGameTime();
            int      sHour = span.Hours;
            int      sMin  = span.Minutes;
            int      sSec  = span.Seconds;
            TimeLabel.text = GameMethod.GetCurrSystemTime(sHour, sMin, sSec);
            deltaTime      = 0.0f;
        }
    }
Beispiel #2
0
        public override void Update(float deltaTime)
        {
            UpdateHomeHp();
            CheckHomeBaseEffectEnd();
            if (isPress)
            {
                ShowDes();
            }
            deltaTime += Time.deltaTime;
            if (runSlowDown && sliderFury != null && sliderFury.fillAmount != 0)
            {
                float cut = 1f / slowDownLimit;
                if (Time.time - startTime >= 1f)
                {
                    if (sliderFury.fillAmount - cut >= 0f)
                    {
                        sliderFury.fillAmount -= cut;
                    }
                    else
                    {
                        sliderFury.fillAmount = 0f;
                    }
                    startTime = Time.time;
                }
            }
            else
            {
                runSlowDown = false;
            }
            if (GameTimeData.Instance.GetStartTag())
            {
                TimeSpan span  = GameTimeData.Instance.GetGameTime();
                int      sHour = span.Hours;
                int      sMin  = span.Minutes;
                int      sSec  = span.Seconds;
                TimeLabel.text = GameMethod.GetCurrSystemTime(sHour, sMin, sSec);
                deltaTime      = 0.0f;
            }
            if (isDownTime)
            {
                LastTime = DateTime.Now;
                TimeSpan mSpan    = LastTime - StartTime;
                int      currTime = 0;
                if (mSpan.Hours != 0)
                {
                    currTime += mSpan.Hours * 3600;
                }
                if (mSpan.Minutes != 0)
                {
                    currTime += mSpan.Minutes * 60;
                }
                currTime += mSpan.Seconds;

                if (currTime <= skillEndTime)
                {
                    mSpritePassiveSkill.fillAmount = 1 - (float)currTime / (float)skillEndTime;
                }
                else
                {
                    isDownTime = false;
                }
            }
        }