public static LuaComponent AddLuaComponent(GameObject go, string path) { LuaComponent luaComp = go.AddComponent <LuaComponent>(); luaComp.Initilize(path); // 手动调用脚本运行,以取得LuaTable返回值 return(luaComp); }
public void CallLuaFunction(string funcName) { if (LuaCp == null) { LuaCp = GetComponent <LuaComponent>(); } if (LuaCp == null) { Log.E("Not find LuaComponet"); return; } LuaCp.CallLuaFunction(funcName); }
public void BindLuaComponent() { if (LuaCp == null) { LuaCp = GetComponent <LuaComponent>(); } if (LuaCp == null) { Log.E("Not find LuaComponet"); return; } if (LuaCp.Initilize(LuaPath)) { CallLuaFunction(LuaMain.FuncName.Awake); } }