Exemple #1
0
        void Update()
        {
            if (unit == null || unit.hp <= 0 || !unit.GetObj().activeInHierarchy)
            {
                unit = null;
                thisObj.SetActive(false);
                return;
            }

            UpdateScreenPos();

            slider.value   = unit.GetHPRatio();
            sliderSH.value = unit.GetSHRatio();

            if (!UIControl.AlwaysShowHPOverlay())
            {
                canvasG.alpha = (slider.value >= 1 && (sliderSH.value <= 0 || sliderSH.value >= 1)) ? 0 : 1;
            }
        }