Destroy() public méthode

public Destroy ( ) : void
Résultat void
 public void Close()
 {
     loop.Destroy();
     loop = null;
     lua.Dispose();
     lua = null;
 }
Exemple #2
0
 void OnApplicationQuit()
 {
     looper.Destroy();
     lua.Dispose();
     lua = null;
     Application.logMessageReceived -= ShowTips;
 }
Exemple #3
0
    public virtual void Destroy()
    {
        if (luaState == null)
        {
            return;
        }
        SceneManager.sceneLoaded -= OnSceneLoaded;
        luaState.Call("OnApplicationQuit", false);
        DetachProfiler();
        LuaState state = luaState;

        luaState = null;

        if (onSocketfunc != null)
        {
            onSocketfunc.Dispose();
            onSocketfunc = null;
        }

        if (loop != null)
        {
            loop.Destroy();
            loop = null;
        }

        state.Dispose();
        luaInstance = null;
    }
Exemple #4
0
    public virtual void Destroy()
    {
        if (m_LuaState != null)
        {
#if UNITY_5_4_OR_NEWER
            SceneManager.sceneLoaded -= OnSceneLoaded;
#endif
            m_LuaState.Call("OnApplicationQuit", false);
            DetachProfiler();
            LuaState state = m_LuaState;
            m_LuaState = null;

            if (m_LevelLoaded != null)
            {
                m_LevelLoaded.Dispose();
                m_LevelLoaded = null;
            }

            if (m_Looper != null)
            {
                m_Looper.Destroy();
                m_Looper = null;
            }

            state.Dispose();
            instance = null;
        }
    }
Exemple #5
0
        public void Close()
        {
            foreach (var val in dataTableDic)
            {
                val.Value.Dispose();
            }

            SafeRelease(ref updateFunc);
            SafeRelease(ref lateUpdateFunc);
            SafeRelease(ref fixedUpdateFunc);
            SafeRelease(ref levelLoaded);

            if (loop != null)
            {
                loop.Destroy();
                loop = null;
            }

            if (lua != null)
            {
                lua.Dispose();
                lua    = null;
                loader = null;
            }
        }
Exemple #6
0
    protected void Destroy()
    {
        if (luaState != null)
        {
#if UNITY_5_4_OR_NEWER
            SceneManager.sceneLoaded -= OnSceneLoaded;
#endif
            LuaState state = luaState;
            luaState = null;

            if (levelLoaded != null)
            {
                levelLoaded.Dispose();
                levelLoaded = null;
            }

            if (onSocketfunc != null)
            {
                onSocketfunc.Dispose();
                onSocketfunc = null;
            }

            if (loop != null)
            {
                loop.Destroy();
                loop = null;
            }

            state.Dispose();
            Instance = null;
        }
    }
Exemple #7
0
        public void Reload()
        {
            Debug.LogError("00_Reload");
            if (m_LuaState != null)
            {
                m_LuaState.Dispose();
                m_LuaState = null;
            }

            if (m_LuaLooper != null)
            {
                m_LuaLooper.Destroy();
            }

            m_LuaState = new LuaState();
            //m_LuaState.InitPackagePath();
            this.OpenLibs();
            m_LuaState.LuaSetTop(0);

            LuaBinder.Bind(m_LuaState);
            LuaCoroutine.Register(m_LuaState, this);

            m_LuaLoader.Restart();

            // m_LuaState.AddSearchPath(Application.dataPath + "/Lua");

#if UNITY_EDITOR
            if (!LuaConst.USE_AB)
            {
                m_LuaState.AddSearchPath(LuaConst.toluaDir);
                m_LuaState.AddSearchPath(LuaConst.luaDir);
            }
#endif
        }
    public virtual void Destroy()
    {
        if (luaState != null)
        {
#if UNITY_5_4_OR_NEWER
            SceneManager.sceneLoaded -= OnSceneLoaded;
#endif
            luaState.Call("OnApplicationQuit", false);
            DetachProfiler();
            LuaState state = luaState;
            luaState = null;

            if (levelLoaded != null)
            {
                levelLoaded.Dispose();
                levelLoaded = null;
            }

            if (loop != null)
            {
                loop.Destroy();
                loop = null;
            }

            state.Dispose();
            Instance = null;
        }
    }
Exemple #9
0
    protected void Destroy()
    {
        if (luaState != null)
        {
            if (levelLoaded != null)
            {
                levelLoaded.Dispose();
                levelLoaded = null;
            }

            if (loop != null)
            {
                loop.Destroy();
                loop = null;
            }

            if (luaState != null)
            {
                luaState.Dispose();
                luaState = null;
            }

            Instance = null;
        }
    }
Exemple #10
0
    public virtual void Destroy()
    {
        if (luaState != null)
        {
#if UNITY_5_4
            SceneManager.sceneLoaded -= OnSceneLoaded;
#endif
            LuaState state = luaState;
            luaState = null;

            if (levelLoaded != null)
            {
                levelLoaded.Dispose();
                levelLoaded = null;
            }

            if (loop != null)
            {
                loop.Destroy();
                loop = null;
            }

            state.Dispose();
            Instance = null;
        }
    }
Exemple #11
0
        public void Destroy()
        {
            m_looper.Destroy();
            m_looper = null;

            m_lua.Dispose();
            m_lua = null;
        }
Exemple #12
0
        public void Close()
        {
            _loop.Destroy();
            _loop = null;

            _lua.Dispose();
            _lua    = null;
            _loader = null;
        }
Exemple #13
0
    private void OnDestroy()
    {
        mLuaLooper.Destroy();
        mLuaState.Dispose();

        mLuaLooper = null;
        mLuaState  = null;
        mInstance  = null;
    }
    public void Close()
    {
        loop.Destroy();
        loop = null;

        lua.Dispose();
        lua    = null;
        loader = null;
        KBEngine.KBELuaUtil.ClearCallLuaFunction();
    }
Exemple #15
0
    void OnApplicationQuit()
    {
        looper.Destroy();
        lua.Dispose();
        lua = null;
#if UNITY_5 || UNITY_2017 || UNITY_2018
        Application.logMessageReceived -= ShowTips;
#else
        Application.RegisterLogCallback(null);
#endif
    }
Exemple #16
0
        /// <summary>
        /// 销毁
        /// </summary>
        public void Destroy()
        {
            m_looper.Destroy();
            Destroy(m_looper);
            m_looper = null;

            state.Dispose();
            state = null;

            Destroy(this);
        }
Exemple #17
0
    public void Close()
    {
        if (loop != null)
        {
            loop.Destroy();
            loop = null;
        }

        lua.Dispose();
        lua    = null;
        loader = null;
    }
 static int Destroy(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         LuaLooper obj = (LuaLooper)ToLua.CheckObject <LuaLooper>(L, 1);
         obj.Destroy();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemple #19
0
    protected override void Destroy()
    {
        if (LuaState != null)
        {
            if (looper != null)
            {
                looper.Destroy();
                looper = null;
            }

            LuaState.Dispose();
            LuaState = null;
        }
    }
Exemple #20
0
    void OnDestroy()
    {
        if (m_lua != null)
        {
            m_lua.Dispose();
            m_lua = null;

            if (m_luaLooper)
            {
                m_luaLooper.Destroy();
                m_luaLooper = null;
            }
        }
    }
Exemple #21
0
 public void OnDestroy()
 {
     if (luaState != null)
     {
         LuaState state = luaState;
         luaState = null;
         if (loop != null)
         {
             loop.Destroy();
             loop = null;
         }
         state.Dispose();
     }
 }
Exemple #22
0
        public void Close()
        {//这里添加判断,主要是有可能没有调用InitStart,就关闭了
            if (loop != null)
            {
                loop.Destroy();
                loop = null;
            }

            if (lua != null)
            {
                lua.Dispose();
                lua    = null;
                loader = null;
            }
        }
Exemple #23
0
        public override void Close()
        {
            if (loop != null)
            {
                loop.Destroy();
                loop = null;
            }

            if (lua != null)
            {
                lua.Dispose();
                lua = null;
            }
            loader = null;
        }
Exemple #24
0
 public override void OnDestroy()
 {
     base.OnDestroy();
     if (luaState != null)
     {
         LuaState state = luaState;
         luaState = null;
         if (loop != null)
         {
             loop.Destroy();
             loop = null;
         }
         state.Dispose();
     }
 }
    /// <summary>
    /// Lua环境注销
    /// </summary>
    private void UnInitLua()
    {
        if (m_LuaLoop != null)
        {
            m_LuaLoop.Destroy();
            m_LuaLoop = null;
        }

        if (m_LuaState != null)
        {
            m_LuaState.Dispose();
            m_LuaState = null;
        }

        m_LuaLoader = null;
    }
Exemple #26
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;
        }
Exemple #27
0
    public void Close() 
    {
        if (null != loop)
        {
            loop.enabled = false;
            loop.Destroy();
            loop = null;
        }

        if (null != lua) 
        {
            lua.Dispose();
            lua = null;
        }
        
        loader = null;
    }
Exemple #28
0
/*        void OnSceneLoaded(Scene scene, LoadSceneMode mode) {
 *
 *          if (luaState != null)
 *          {
 *              luaState.RefreshDelegateMap();
 *          }
 *      }*/


        public virtual void Destroy()
        {
            if (luaState != null)
            {
                //SceneManager.sceneLoaded -= OnSceneLoaded;
                luaState.Call("OnDestroy", false);
                DetachProfiler();
                LuaState state = luaState;
                luaState = null;
                if (loop != null)
                {
                    loop.Destroy();
                    loop = null;
                }

                state.Dispose();
                Instance = null;
            }
        }
Exemple #29
0
    protected void Destroy()
    {
        if (luaState != null)
        {
            DestroyFunc(levelLoaded);
            DestroyFunc(gameUpdate);

            if (loop != null)
            {
                loop.Destroy();
                loop = null;
            }

            if (luaState != null)
            {
                luaState.Dispose();
                luaState = null;
            }


            Instance = null;
        }
    }
Exemple #30
0
 // 游戏退出
 private void OnDestroy()
 {
     looper.Destroy();
     luaState.Dispose();
     luaState = null;
 }