Beispiel #1
0
    static int _CreateFramework_LuaUtility(IntPtr L)
    {
#if UNITY_EDITOR
        ToluaProfiler.AddCallRecord("Framework.LuaUtility.ctor");
#endif
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                Framework.LuaUtility obj = new Framework.LuaUtility();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: Framework.LuaUtility.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Beispiel #2
0
 public static void Send2Lua(int id, byte[] bytes)
 {
     try
     {
         LuaByteBuffer byteBuffer = new LuaByteBuffer(bytes);
         LuaUtility.CallLuaModuleMethod("Protol.ProtoProcess", "Process", id, byteBuffer);
     }
     catch (Exception e)
     {
         LogHelper.PrintError(string.Format("[LuaNetUtility]Send2Lua error,id:{0},info:{1}.", id, e.ToString()));
     }
 }
Beispiel #3
0
        protected void OnDestroy()
        {
            LuaUtility.ClearMemory();

            /*
             *          Debug.Log("~" + name + " was destroy!");
             *
             *          ClearClick();
             #if ASYNC_MODE
             *          string abName = name.ToLower().Replace("panel", "");
             *          ResManager.UnloadAssetBundle(abName + AppConst.ExtName);
             #endif
             *
             */
        }
    static int OnInitialize(IntPtr L)
    {
#if UNITY_EDITOR
        ToluaProfiler.AddCallRecord("Framework.LuaUtility.OnInitialize");
#endif
        try
        {
            ToLua.CheckArgsCount(L, 1);
            Framework.LuaUtility obj = (Framework.LuaUtility)ToLua.CheckObject <Framework.LuaUtility>(L, 1);
            obj.OnInitialize();
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
    static int _CreateFramework_LuaUtility(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 0)
            {
                Framework.LuaUtility obj = new Framework.LuaUtility();
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: Framework.LuaUtility.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Beispiel #6
0
 protected void OnDisable()
 {
     LuaUtility.CallLuaTableMethod(luaName, "OnDisable");
 }
Beispiel #7
0
 protected void Start()
 {
     LuaUtility.CallLuaTableMethod(luaName, "Start");
 }
Beispiel #8
0
 protected void Awake()
 {
     luaName = name + "Ctrl";
     LuaUtility.CallLuaTableMethod(luaName, "Awake", gameObject);
 }