示例#1
0
    void ShowWarning(string msg)
    {
        Text t = _warning.GetRef("Text").GetComponent <Text>();

        t.text = msg;
        DelayAction da = _warning.GetComponent <DelayAction>();

        da.StartDelay();
    }
示例#2
0
    void ShowMpSupply(UINode node, int sVal)
    {
        GameObject supply = node.GetRef("MpSupply").gameObject;

        if (sVal < 0)
        {
            supply.SetActive(false);
            return;
        }
        supply.GetComponent <Text>().text = "+" + sVal;
        DelayAction da = supply.GetComponent <DelayAction>();

        if (da == null)
        {
            da = supply.AddComponent <DelayAction>();
        }
        da.DelaySecond = 1;
        da.DAction     = () => { supply.gameObject.SetActive(false); };
        da.StartDelay();
    }
示例#3
0
    void ShowHurt(UINode node, int damage)
    {
        GameObject hurt = node.GetRef("Hurt").gameObject;

        if (damage < 0)
        {
            hurt.SetActive(false);
            return;
        }
        hurt.GetComponent <Text>().text = "-" + damage;
        DelayAction da = hurt.GetComponent <DelayAction>();

        if (da == null)
        {
            da = hurt.AddComponent <DelayAction>();
        }
        da.DelaySecond = 1;
        da.DAction     = () => { hurt.gameObject.SetActive(false); };
        da.StartDelay();
    }