From 291fabe19793a355bfabca9245b687846a4e09ec Mon Sep 17 00:00:00 2001 From: minenice55 Date: Sun, 21 Jan 2024 16:54:10 -0500 Subject: [PATCH] do it in the editor too --- Assets/Scripts/GameManager.cs | 2 +- Assets/Scripts/LevelEditor/Editor.cs | 8 ++++---- ....UnitySourceGenerator.Editor.ProjectSettingsData.asset | 1 + 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 0bd28368..8bdd8eef 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -1110,7 +1110,7 @@ namespace HeavenStudio SetCurrentGame(game, useMinigameColor); } - private void DestroyGame() + public void DestroyGame() { SetGame("noGame"); } diff --git a/Assets/Scripts/LevelEditor/Editor.cs b/Assets/Scripts/LevelEditor/Editor.cs index c8493f38..30fca09f 100644 --- a/Assets/Scripts/LevelEditor/Editor.cs +++ b/Assets/Scripts/LevelEditor/Editor.cs @@ -106,7 +106,7 @@ namespace HeavenStudio.Editor foreach (var minigame in EventCaller.instance.minigames.Values) AddIcon(minigame); - + UpdateEditorStatus(true); #if HEAVENSTUDIO_PROD BuildDateDisplay.text = GlobalGameManager.friendlyReleaseName; @@ -473,7 +473,7 @@ namespace HeavenStudio.Editor GameManager.instance.CursorCam.enabled = (PlayerInput.CurrentControlStyle == InputSystem.InputController.ControlStyles.Touch) && isCursorEnabled; GameManager.instance.CursorCam.targetTexture = null; - + GameManager.instance.CursorCam.rect = new Rect(0, 0, 1, 1); fullscreen = true; } @@ -507,12 +507,12 @@ namespace HeavenStudio.Editor public static bool MouseInRectTransform(RectTransform rectTransform) { - return (rectTransform.gameObject.activeSelf && RectTransformUtility.RectangleContainsScreenPoint(rectTransform, Input.mousePosition, Editor.instance.EditorCamera)); + return rectTransform.gameObject.activeSelf && RectTransformUtility.RectangleContainsScreenPoint(rectTransform, Input.mousePosition, Editor.instance.EditorCamera); } public void ReturnToTitle() { - GlobalGameManager.LoadScene("Title"); + GlobalGameManager.LoadScene("Title", callback: GameManager.instance.DestroyGame); } public void SetAuthoritiveMenu(bool state) diff --git a/ProjectSettings/SatorImaging.UnitySourceGenerator.Editor.ProjectSettingsData.asset b/ProjectSettings/SatorImaging.UnitySourceGenerator.Editor.ProjectSettingsData.asset index 1e82d278..69ec4433 100644 --- a/ProjectSettings/SatorImaging.UnitySourceGenerator.Editor.ProjectSettingsData.asset +++ b/ProjectSettings/SatorImaging.UnitySourceGenerator.Editor.ProjectSettingsData.asset @@ -39,5 +39,6 @@ MonoBehaviour: - Assets/Scripts/Games/TossBoys/TossBoys.cs - Assets/Scripts/Games/DoubleDate/DoubleDate.cs - Assets/Scripts/Games/AirRally/AirRally.cs + - Assets/Scripts/LevelEditor/Editor.cs PathsToSkipImportEvent: [] PathsToIgnoreOverwriteSettingOnAttribute: []