Esempio n. 1
0
        public override void OnLoad()
        {
            Instance = this;

            KitManager = new KitManager();

            Logger.LogInfo("Waiting assets to load kits");

            // Must load kits only when Assets is loaded.
            Task.Create()
            .Action(t => {
                if (!Assets.isLoading)
                {
                    KitManager.Load();
                    Logger.LogInfo($"Loaded {KitManager.Count} kits");
                    t.Cancel();
                }
            })
            .Delay(600)
            .Interval(200)
            .Submit();

            CommandManager.RegisterAll(kCommandsNamespace);
            EventManager.RegisterAll <KitEventHandler>();
        }
Esempio n. 2
0
        public override void OnUnload()
        {
            Level.onPostLevelLoaded -= onPostLevelLoaded;

            CommandManager.UnregisterAll(CommandsNamespace);
            EventManager.UnregisterAll <KitEventHandler>();
            KitManager.Save();
        }
Esempio n. 3
0
        public override void OnLoad()
        {
            Instance = this;

            KitManager = new KitManager();
            KitManager.Load();

            Logger.LogInfo($"Loaded {KitManager.Count} kits");

            CommandManager.RegisterAll("Essentials.NativeModules.Kit.Commands");
        }
Esempio n. 4
0
        public override void OnLoad()
        {
            Instance = this;

            KitManager = new KitManager();
            KitManager.Load();

            Logger.LogInfo($"Loaded {KitManager.Count} kits");

            CommandManager.RegisterAll(CommandsNamespace);
            EventManager.RegisterAll <KitEventHandler>();
        }
Esempio n. 5
0
        public override void OnLoad()
        {
            Instance = this;

            KitManager = new KitManager();

            Level.onPostLevelLoaded += Instance.onPostLevelLoaded;
            if (Level.isLoaded)
            {
                onPostLevelLoaded(420);
            }

            CommandManager.RegisterAll(CommandsNamespace);
            EventManager.RegisterAll <KitEventHandler>();
        }
Esempio n. 6
0
 public override void OnUnload()
 {
     CommandManager.UnregisterAll(CommandsNamespace);
     EventManager.UnregisterAll <KitEventHandler>();
     KitManager.Save();
 }
Esempio n. 7
0
        public void onPostLevelLoaded(int level)
        {
            KitManager.Load();

            Logger.LogInfo($"Loaded {KitManager.Count} kits");
        }
Esempio n. 8
0
 public override void OnUnload()
 {
     CommandManager.UnregisterAll("Essentials.NativeModules.Kit.Commands");
     KitManager.Save();
 }