private LuaLooper m_LuaLooper; //looper组件 /// <summary> /// 初始化赋值 /// </summary> private void Awake() { m_LuaLoader = new LuaLoader(); mLuaState = new LuaState(); OpenLibs(); mLuaState.LuaSetTop(0); LuaBinder.Bind(mLuaState); DelegateFactory.Init(); LuaCoroutine.Register(mLuaState, this); }
public void Init() { loader = new LuaLoader(); luaState = new LuaState(); OpenLibs(); luaState.LuaSetTop(0); Bind(); //SceneManager.sceneLoaded += OnSceneLoaded; luaState.Start(); StartLooper(); StartMain(); }
/// <summary> /// 关闭Lua调用 /// </summary> public void Close() { if (m_LuaLooper != null) { m_LuaLooper.Destroy(); m_LuaLooper = null; } if (mLuaState != null) { mLuaState.Dispose(); mLuaState = null; } m_LuaLoader = null; }