Exemplo n.º 1
0
        void Update()
        {
            // var host = Character.host;
            //if (host == null) return;
            //var sk = host.cSkillData.findInUIShow(slot);
            //if (sk == null) return;
            if (Input.GetKeyDown(slot))
            {
                if (time <= 0)
                {
                    Notice.Click_Use_Skill.broadcast(slot.ToString());
                    time = maxCd;
                }
            }

            if (time > 0)
            {
                time -= 0.03f;
                bool is_show = time > 0f;
                setShow(is_show);
                if (is_show)
                {
                    mask.setPercent(time / maxCd);
                    if (time < 1)
                    {
                        float num = time * 10;
                        count.text = "0." + ((int)num).ToString();
                    }
                    else
                    {
                        count.text = ((int)time).ToString();
                    }
                }
            }
        }