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; }
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; }
/// <summary> /// </summary> /// <param name="tableName"></param> /// <returns></returns> public static LuaTable GetConfigLuaTable(string tableName) { var config = LuaManager.GetInstance().luaState.GetTable(tableName); return(config); }