void OnDestroy()
    {
        if (quitting)
        {
            return;
        }

        ZScript.SetFlag(flag, value);
    }
 void Update()
 {
     if (ZScript.GetFlag(flag))
     {
         if (!target.enabled)
         {
             target.enabled = true;
         }
     }
     else
     {
         if (target.enabled)
         {
             target.enabled = false;
         }
     }
 }
示例#3
0
        public new void Draw(Component caller)
        {
            changed = false;
            float prevValue = value;

            if (horizontal)
            {
                value = GUI.HorizontalSlider(area, value, minValue, maxValue);
            }
            else
            {
                value = GUI.VerticalSlider(area, value, minValue, maxValue);
            }

            if (value != prevValue)
            {
                changed = true; ZScript.SetValue(name, value);
            }
        }
示例#4
0
    public override string GetString()
    {
        string s = prefix;

        if (time)
        {
            s += ZScript.Get(field).TimeFormat(timePrecision);
        }
        else
        {
            if (floor)
            {
                s += ZScript.Get(field).Floor();
            }
            else
            {
                s += ZScript.Get(field);
            }
        }
        return(s);
    }
    void Update()
    {
        if (target == null)
        {
            return;
        }


        if (ZScript.GetFlag(flag))
        {
            if (!target.activeSelf)
            {
                target.SetActive(true);
            }
        }
        else
        {
            if (target.activeSelf)
            {
                target.SetActive(false);
            }
        }
    }
示例#6
0
 void Start()
 {
     ZScript.SetFlag(flag, value);
     Destroy(this);
 }
 void Update()
 {
     bar.value = ZScript.GetValue("player_health");
 }