Exemplo n.º 1
0
        public override void _EnterTree()
        {
            if (Coroutine == null)
            {
                Coroutine = new CoroutineHandler();
            }

            #if TOOLS
            if (_editorCoroutine != null)
            {
                _editorCoroutine.StopAll();
                _editorCoroutine = null;
            }
            _editorCoroutine = new CoroutineHandler();
            #endif
        }
Exemplo n.º 2
0
        public override void _ExitTree()
        {
            try
            {
                Coroutine?.StopAll();
                Coroutine = null;
            }
            catch (Exception e)
            {
                Log.Error("Couldn't dispose of the Coroutine instance", e, true);
            }

            #if TOOLS
            try
            {
                _editorCoroutine.StopAll();
                _editorCoroutine = null;
            }
            catch (Exception e)
            {
                Log.Wf.Error("Couldn't stop and dispose the EditorCoroutine instance", e, true);
            }
            #endif
        }