Ejemplo n.º 1
0
    public override void OnInspectorGUI()
    {
        base.OnInspectorGUI();
        try
        {
            UISliderController target = (UISliderController)this.target;

            target.images[0].color = target.color.MultiplyAlpha(0.5f);
            target.images[1].color = target.color;
            target.images[2].color = Color.white.MultiplyAlpha(target.color.a);

            if (target.autoRecoveryPerSecond >= 0)
            {
                target.text.text = "+" + target.autoRecoveryPerSecond + "/s";
            }
            else
            {
                target.text.text = "–" + (-target.autoRecoveryPerSecond) + "/s";
            }

            target.sliders[0].value = target.value / target.MaxValue;
            target.sliders[1].value = target.value / target.MaxValue;
        }
        catch { }
    }
Ejemplo n.º 2
0
 void Start()
 {
     slider          = GetComponent <UISliderController>();
     slider.MaxValue = attachTo.HP_index;
     slider.autoRecoveryPerSecond = 0;
 }