예제 #1
0
        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);
        }
예제 #2
0
        public void Init()
        {
            loader   = new LuaLoader();
            luaState = new LuaState();
            OpenLibs();
            luaState.LuaSetTop(0);
            Bind();

            //SceneManager.sceneLoaded += OnSceneLoaded;

            luaState.Start();

            StartLooper();
            StartMain();
        }
예제 #3
0
        /// <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;
        }