Ejemplo n.º 1
0
        private void Awake()
        {
            LuaManager.GetInstance().Init();
            LuaManager.GetInstance().luaState.DoFile(name);
            LuaFunction func = LuaManager.GetInstance().luaState.GetFunction("Awake");

            func.BeginPCall();
            func.PushGeneric <GameObject>(gameObject);
            func.PCall();
            func.EndPCall();

            func.Dispose();
            func = null;
        }
Ejemplo n.º 2
0
        void Awake()
        {
            string luaPath = Path.Combine(UFrameConst.Lua_MonoBehaviourDir, gameObject.name);

            luaPath = luaPath.Replace("\\", "/");
            LuaManager.GetInstance().luaState.DoFile(luaPath);

            awakeFunc     = gameObject.name + ".Awake";
            startFunc     = gameObject.name + ".Start";
            ondestroyFunc = gameObject.name + ".OnDestroy";
            LuaFunction func = LuaManager.GetInstance().luaState.GetFunction(awakeFunc);

            func.Call <GameObject>(gameObject);
            func.Dispose();
            func = null;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// </summary>
        /// <param name="tableName"></param>
        /// <returns></returns>
        public static LuaTable GetConfigLuaTable(string tableName)
        {
            var config = LuaManager.GetInstance().luaState.GetTable(tableName);

            return(config);
        }