protected override void Unload() { AllowedIDs.Clear(); UnturnedPlayerEvents.OnPlayerUpdateGesture += OnUpdatedGesture; Instance = null; base.Unload(); }
protected override void Load() { base.Load(); Instance = this; Logger.LogWarning("\nLoading SignTeleporter, made by Mr.Kwabs..."); if (!File.Exists("Plugins/SignTeleporter/AllowedIDs.json")) { Logger.LogError("\nAllowedIDs.json does not exist, creating it now..."); FirstLoad(); Logger.LogWarning("Successfully created AllowedIDs.json."); } SendList(); Logger.LogWarning($"\nFound AllowedIDs.json, read {AllowedIDs.Count} IDs."); Logger.LogWarning("\nID List: \n"); foreach (string ID in AllowedIDs) { Logger.LogWarning($"{ID}"); } Logger.LogWarning($"\nMaximum Distance from Sign to Teleport: {Instance.Configuration.Instance.MaxDistance}"); UnturnedPlayerEvents.OnPlayerUpdateGesture += OnUpdatedGesture; Logger.LogWarning("\nSuccessfully loaded SignTeleporter, made by Mr.Kwabs!"); }