FairyGUI.EventListener.Set C# (CSharp) Method

Set() public method

public Set ( EventCallback0 callback ) : void
callback EventCallback0
return void
        public void Set(EventCallback0 callback)
        {
            if (_bridge == null)
                _bridge = this.owner.GetEventBridge(_type);

            _bridge.Clear();
            if (callback != null)
                _bridge.Add(callback);
        }

Same methods

EventListener::Set ( EventCallback1 callback ) : void

Usage Example

示例#1
0
    static int Set(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 2)
            {
                FairyGUI.EventListener  obj  = (FairyGUI.EventListener)ToLua.CheckObject <FairyGUI.EventListener>(L, 1);
                FairyGUI.EventCallback1 arg0 = (FairyGUI.EventCallback1)ToLua.CheckDelegate <FairyGUI.EventCallback1>(L, 2);
                obj.Set(arg0);
                return(0);
            }
            else if (count == 3 && TypeChecker.CheckTypes <LuaInterface.LuaTable>(L, 3))
            {
                FairyGUI.EventListener obj  = (FairyGUI.EventListener)ToLua.CheckObject <FairyGUI.EventListener>(L, 1);
                LuaFunction            arg0 = ToLua.CheckLuaFunction(L, 2);
                LuaTable arg1 = ToLua.ToLuaTable(L, 3);
                obj.Set(arg0, arg1);
                return(0);
            }
            else if (count == 3 && TypeChecker.CheckTypes <FairyGUI.GComponent>(L, 3))
            {
                FairyGUI.EventListener obj  = (FairyGUI.EventListener)ToLua.CheckObject <FairyGUI.EventListener>(L, 1);
                LuaFunction            arg0 = ToLua.CheckLuaFunction(L, 2);
                FairyGUI.GComponent    arg1 = (FairyGUI.GComponent)ToLua.ToObject(L, 3);
                obj.Set(arg0, arg1);
                return(0);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to method: FairyGUI.EventListener.Set"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }