static int _CreateFramework_SingletonBase(IntPtr L)
    {
#if UNITY_EDITOR
        ToluaProfiler.AddCallRecord("Framework.SingletonBase.ctor");
#endif
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                Framework.SingletonBase obj = new Framework.SingletonBase();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: Framework.SingletonBase.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Exemplo n.º 2
0
 public static void DestroyAll()
 {
     for (int i = s_lstSingle.Count - 1; i >= 0; --i)
     {
         SingletonBase s = s_lstSingle[i];
         s.Destroy();
     }
     if (s_lstSingle.Count != 0)
     {
         Debug.LogError("s_lst.Count != 0");
     }
     s_lstSingle.Clear();
 }
    static int SingletonInterfaceOnUninitialize(IntPtr L)
    {
#if UNITY_EDITOR
        ToluaProfiler.AddCallRecord("Framework.SingletonBase.SingletonInterfaceOnUninitialize");
#endif
        try
        {
            ToLua.CheckArgsCount(L, 1);
            Framework.SingletonBase obj = (Framework.SingletonBase)ToLua.CheckObject <Framework.SingletonBase>(L, 1);
            obj.SingletonInterfaceOnUninitialize();
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Exemplo n.º 4
0
    static int set__onUninitializeStartHandler(IntPtr L)
    {
#if UNITY_EDITOR
        ToluaProfiler.AddCallRecord("Framework.SingletonBase._onUninitializeStartHandler");
#endif
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Framework.SingletonBase obj = (Framework.SingletonBase)o;
            Framework.onUninitializeStartHandler arg0 = (Framework.onUninitializeStartHandler)ToLua.CheckDelegate <Framework.onUninitializeStartHandler>(L, 2);
            obj._onUninitializeStartHandler = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index _onUninitializeStartHandler on a nil value"));
        }
    }
Exemplo n.º 5
0
    static int get__onUninitializeStartHandler(IntPtr L)
    {
#if UNITY_EDITOR
        ToluaProfiler.AddCallRecord("Framework.SingletonBase._onUninitializeStartHandler");
#endif
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            Framework.SingletonBase obj = (Framework.SingletonBase)o;
            Framework.onUninitializeStartHandler ret = obj._onUninitializeStartHandler;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index _onUninitializeStartHandler on a nil value"));
        }
    }
    static int set_OnUninitializeHandler(IntPtr L)
    {
#if UNITY_EDITOR
        ToluaProfiler.AddCallRecord("Framework.SingletonBase.set_OnUninitializeHandler");
#endif
        try
        {
            Framework.SingletonBase obj  = (Framework.SingletonBase)ToLua.CheckObject(L, 1, typeof(Framework.SingletonBase));
            EventObject             arg0 = null;

            if (LuaDLL.lua_isuserdata(L, 2) != 0)
            {
                arg0 = (EventObject)ToLua.ToObject(L, 2);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "The event 'Framework.SingletonBase.OnUninitializeHandler' can only appear on the left hand side of += or -= when used outside of the type 'Framework.SingletonBase'"));
            }

            if (arg0.op == EventOp.Add)
            {
                Framework.OnSingletonUninitializeEventHandler ev = (Framework.OnSingletonUninitializeEventHandler)arg0.func;
                obj.OnUninitializeHandler += ev;
            }
            else if (arg0.op == EventOp.Sub)
            {
                Framework.OnSingletonUninitializeEventHandler ev = (Framework.OnSingletonUninitializeEventHandler)arg0.func;
                obj.OnUninitializeHandler -= ev;
            }

            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }