Ejemplo n.º 1
0
    public void function()
    {
        UIInput input = GetComponent <UIInput>();

        if (input != null)
        {
            value       = new Servant.messageSystemValue();
            value.hint  = input.name;
            value.value = input.value;
        }
        if (actionInMono != null)
        {
            actionInMono(this.gameObject, value);
        }
    }
Ejemplo n.º 2
0
    public static void registEvent(GameObject father, string name, Action <GameObject, Servant.messageSystemValue> function, Servant.messageSystemValue value, string name2 = "")
    {
        UIInput input = getByName <UIInput>(father, name);

        if (input != null)
        {
            MonoListenerRMS_ized d = input.gameObject.GetComponent <MonoListenerRMS_ized>();
            if (d == null)
            {
                d = input.gameObject.AddComponent <MonoListenerRMS_ized>();
            }
            d.actionInMono = function;
            d.value        = value;
            input.onSubmit.Clear();
            input.onSubmit.Add(new EventDelegate(d, "function"));
            UIButton btns = getByName <UIButton>(father, name2);
            if (btns != null)
            {
                btns.onClick.Clear();
                btns.onClick.Add(new EventDelegate(d, "function"));
            }
            return;
        }
        UIButton btn = getByName <UIButton>(father, name);

        if (btn != null)
        {
            MonoListenerRMS_ized d = btn.gameObject.GetComponent <MonoListenerRMS_ized>();
            if (d == null)
            {
                d = btn.gameObject.AddComponent <MonoListenerRMS_ized>();
            }
            d.actionInMono = function;
            d.value        = value;
            btn.onClick.Clear();
            btn.onClick.Add(new EventDelegate(d, "function"));
            return;
        }
    }