示例#1
0
        public void Reload(GraphPath <V, E> path)
        {
            if (path == currentPath)
            {
                return;
            }

            currentPath = path;
            Current     = 0;
            OnReloaded.Invoke();
        }
        /// <summary>
        ///     Reloads the manager.
        /// </summary>
        public void Reload()
        {
            if (_luaFiles.Count == 0)
            {
                Debug.LogWarning($"Unable to reload SLUI ({Name}). No lua files has been added.");
                return;
            }

            _workingFiles.Clear();

            //Worker.ClearWorker();
            Cleanup();

            State?.Dispose();
            State = new Lua();
            Worker.PrepareState(State);

            foreach (var f in _luaFiles)
            {
                if (CheckFileForBannedNamespaces(f.File))
                {
                    continue;
                }

                try
                {
                    State.DoFile(f.File);
                    _workingFiles.Add(f);
                }
                catch (Exception e)
                {
                    Debug.LogException(e);
                    break;
                }
            }

            Debug.Log($"SLUI ({Name}) reloaded {_workingFiles.Count} files. ({_luaFiles.Count - _workingFiles.Count} failed)");

            OnReloaded?.Invoke();
        }
示例#3
0
 public void EventReloaded()
 {
     OnReloaded?.Invoke();
 }