From 896f4a450ae232dacb7685af6d2342cff847865a Mon Sep 17 00:00:00 2001 From: Slaith <34562469+Slaith12@users.noreply.github.com> Date: Sun, 6 Mar 2022 18:37:27 -0800 Subject: [PATCH] clean up --- Assets/Scripts/EventCaller.cs | 2 +- Assets/Scripts/GameManager.cs | 22 +++------------------- Assets/Scripts/Games/Minigame.cs | 15 ++++++--------- 3 files changed, 10 insertions(+), 29 deletions(-) diff --git a/Assets/Scripts/EventCaller.cs b/Assets/Scripts/EventCaller.cs index 7dc8234d..51984068 100644 --- a/Assets/Scripts/EventCaller.cs +++ b/Assets/Scripts/EventCaller.cs @@ -82,7 +82,7 @@ namespace RhythmHeavenMania } catch (Exception ex) { - Debug.LogWarning("Event not found! May be spelled wrong or it is not implemented." + ex); + Debug.LogWarning("Event not found! May be spelled wrong or it is not implemented.\n" + ex); } } diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index cccf4e2f..36236f35 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -26,7 +26,7 @@ namespace RhythmHeavenMania public Games.Global.Flash fade; [Header("Games")] - public Minigame currentGame; + public string currentGame; Coroutine currentGameSwitchIE; [Header("Properties")] @@ -372,10 +372,10 @@ namespace RhythmHeavenMania GetGame(game).GetComponent().OnGameSwitch(); }*/ - SetCurrentGame(game); Minigame miniGame = currentGameO.GetComponent(); if (miniGame != null) miniGame.OnGameSwitch(); + SetCurrentGame(game); ResetCamera(); } @@ -417,23 +417,7 @@ namespace RhythmHeavenMania return EventCaller.instance.minigames.Find(c => c.name == name); } - public Minigames.Minigame GetGameInfo(Minigame game) - { - if (game == null) - return null; - return GetGameInfo(game.name); - } - - public string GetCurrentGameName() - { - if(currentGame == null) - { - return "noGame"; - } - return currentGame.name; - } - - public void SetCurrentGame(Minigame game) + public void SetCurrentGame(string game) { currentGame = game; if (GetGameInfo(currentGame) != null) CircleCursor.InnerCircle.GetComponent().color = Colors.Hex2RGB(GetGameInfo(currentGame).color); diff --git a/Assets/Scripts/Games/Minigame.cs b/Assets/Scripts/Games/Minigame.cs index caf13617..def63233 100644 --- a/Assets/Scripts/Games/Minigame.cs +++ b/Assets/Scripts/Games/Minigame.cs @@ -44,24 +44,21 @@ namespace RhythmHeavenMania.Games public int firstEnable = 0; - public string name = ""; - public virtual void OnGameSwitch() { - //Below is a template that can be used for handling previous entities. There are multiple sections that have different functions, you don't need to use all of them - - float beat = Conductor.instance.songPositionInBeats; - List prevEntities = GameManager.instance.Beatmap.entities.FindAll(c => c.beat <= beat && c.datamodel.Split(0) == name); - + //Below is a template that can be used for handling previous entities. //section below is if you only want to look at entities that overlap the game switch + /* + float beat = Conductor.instance.songPositionInBeats; + List prevEntities = GameManager.instance.Beatmap.entities.FindAll(c => c.beat <= beat && c.datamodel.Split(0) == [insert game name]); foreach(Beatmap.Entity entity in prevEntities) { if(entity.beat + entity.length >= beat) { - + EventCaller.instance.CallEvent(entity, true); } } - + */ } public virtual void OnTimeChange()