protected override void OnDelete() { if (Instance == this) { Instance = null; } Crosshair?.Delete(); Crosshair = null; HotbarImage = null; HotbarSelector?.Delete(); HotbarSelector = null; HotbarImage = null; Hotbar?.Delete(); Hotbar = null; Inventory?.Delete(); Inventory = null; GlobalInventoryBackground?.Delete(); GlobalInventoryBackground = null; ItemNameLabel.WObject.Delete(); ItemNameLabel = null; HotbarItemsAmount = null; HotbarItemsRenders = null; HoveredTooltipWObject.Delete(); HoveredTooltipWObject = null; HoveredTooltip = null; Player.LocalPlayer.OnHotbarUpdate -= UpdateHotbarItem; Player.LocalPlayer.OnHotbarSelectedChange -= UpdateHotbarSelected; Player.LocalPlayer.OnContainerToggle -= TogglePlayerInventory; Player.LocalPlayer.OnContainerClose -= PlayerCloseInventory; Player.LocalPlayer.OnContainerOpen -= PlayerOpenInventory; Player.LocalPlayer.OnItemUpdate -= UpdateItem; }
public static void DeleteScene() { LoadScene.Delete(); }