From a5638a3302a85372fc54ea5e3af49d3a078f84e8 Mon Sep 17 00:00:00 2001 From: Braedon Date: Sat, 29 Jan 2022 18:30:29 -0500 Subject: [PATCH] Karate man game switch cue fix --- Assets/Resources/Music/practice.json | 2 +- Assets/Scripts/GameManager.cs | 8 ++++++-- Assets/Scripts/Games/KarateMan/KarateJoe.cs | 2 +- Assets/Scripts/LevelEditor/Editor.cs | 2 +- 4 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Assets/Resources/Music/practice.json b/Assets/Resources/Music/practice.json index 02fd0ba1..7f5f985e 100644 --- a/Assets/Resources/Music/practice.json +++ b/Assets/Resources/Music/practice.json @@ -1 +1 @@ -{"bpm":125.0,"entities":[{"beat":0.0,"track":0,"length":33.0,"datamodel":"karateman/bop"},{"beat":0.0,"track":3,"length":1.0,"datamodel":"gameManager/switchGame/karateman"},{"beat":1.0,"track":1,"length":2.0,"datamodel":"karateman/pot"},{"beat":3.0,"track":1,"length":2.0,"datamodel":"karateman/pot"},{"beat":3.5,"track":2,"length":1.0,"datamodel":"karateman/hit3"},{"beat":5.0,"track":1,"length":2.0,"datamodel":"karateman/pot"},{"beat":6.0,"track":2,"length":2.0,"datamodel":"karateman/pot"},{"beat":7.0,"track":3,"length":2.0,"datamodel":"karateman/rock"},{"beat":9.0,"track":1,"length":2.0,"datamodel":"karateman/pot"},{"beat":11.0,"track":1,"length":2.0,"datamodel":"karateman/bulb"},{"beat":13.0,"track":1,"length":4.5,"datamodel":"karateman/kick"},{"beat":17.0,"track":2,"length":2.0,"datamodel":"karateman/pot"},{"beat":19.0,"track":1,"length":2.0,"datamodel":"karateman/pot"},{"beat":19.5,"track":2,"length":1.0,"datamodel":"karateman/hit4"},{"beat":21.0,"track":0,"length":2.0,"datamodel":"karateman/pot"},{"beat":22.0,"track":1,"length":2.0,"datamodel":"karateman/pot"},{"beat":23.0,"track":2,"length":2.0,"datamodel":"karateman/pot"},{"beat":24.0,"track":3,"length":2.0,"datamodel":"karateman/ball"},{"beat":25.0,"track":1,"length":2.0,"datamodel":"karateman/pot"},{"beat":27.0,"track":1,"length":2.0,"datamodel":"karateman/bulb"},{"beat":29.0,"track":1,"length":4.0,"datamodel":"karateman/combo"},{"beat":33.0,"track":1,"length":1.0,"datamodel":"clappyTrio/bop"},{"beat":33.0,"track":0,"length":1.0,"datamodel":"gameManager/switchGame/clappyTrio"},{"beat":34.0,"track":1,"length":1.0,"datamodel":"clappyTrio/bop"},{"beat":35.0,"track":1,"length":1.0,"datamodel":"clappyTrio/prepare_alt"},{"beat":36.5,"track":1,"length":0.75,"datamodel":"clappyTrio/clap"},{"beat":38.5,"track":0,"length":1.0,"datamodel":"clappyTrio/prepare"},{"beat":39.0,"track":1,"length":0.25,"datamodel":"clappyTrio/clap"},{"beat":40.0,"track":1,"length":1.0,"datamodel":"clappyTrio/bop"},{"beat":41.0,"track":0,"length":1.0,"datamodel":"gameManager/switchGame/spaceball"},{"beat":42.0,"track":1,"length":2.0,"datamodel":"spaceball/shoot"},{"beat":45.0,"track":1,"length":3.0,"datamodel":"spaceball/shootHigh"},{"beat":48.0,"track":1,"length":2.0,"datamodel":"spaceball/shoot"},{"beat":50.0,"track":1,"length":2.0,"datamodel":"spaceball/shoot"},{"beat":53.0,"track":1,"length":3.0,"datamodel":"spaceball/shootHigh"},{"beat":57.0,"track":1,"length":2.0,"datamodel":"spaceball/shoot"},{"beat":59.0,"track":1,"length":2.0,"datamodel":"spaceball/shoot"},{"beat":61.0,"track":1,"length":3.0,"datamodel":"spaceball/shootHigh"},{"beat":64.0,"track":0,"length":1.0,"datamodel":"gameManager/switchGame/forkLifter"},{"beat":65.0,"track":1,"length":3.0,"datamodel":"forkLifter/pea"},{"beat":68.0,"track":0,"length":3.0,"datamodel":"forkLifter/pea"},{"beat":70.0,"track":1,"length":3.0,"datamodel":"forkLifter/pea"},{"beat":72.5,"track":2,"length":1.0,"datamodel":"forkLifter/gulp"},{"beat":73.0,"track":1,"length":2.0,"datamodel":"spaceSoccer/ball dispense"},{"beat":73.0,"track":0,"length":1.0,"datamodel":"gameManager/switchGame/spaceSoccer"},{"beat":75.0,"track":1,"length":10.0,"datamodel":"spaceSoccer/keep-up"},{"beat":85.0,"track":1,"length":3.0,"datamodel":"spaceSoccer/high kick-toe!"},{"beat":88.0,"track":1,"length":5.0,"datamodel":"spaceSoccer/keep-up"},{"beat":93.0,"track":1,"length":3.0,"datamodel":"spaceSoccer/high kick-toe!"},{"beat":96.0,"track":1,"length":4.0,"datamodel":"spaceSoccer/keep-up"}],"tempoChanges":[]} \ No newline at end of file +{"bpm":125.0,"entities":[{"beat":0.0,"track":1,"length":1.0,"datamodel":"gameManager/switchGame/forkLifter"},{"beat":1.0,"track":2,"length":3.0,"datamodel":"forkLifter/pea"},{"beat":11.0,"track":1,"length":2.0,"datamodel":"karateman/bulb"},{"beat":13.0,"track":1,"length":4.5,"datamodel":"karateman/kick"},{"beat":17.0,"track":2,"length":2.0,"datamodel":"karateman/pot"},{"beat":19.0,"track":1,"length":2.0,"datamodel":"karateman/pot"},{"beat":19.5,"track":2,"length":1.0,"datamodel":"karateman/hit4"},{"beat":21.0,"track":0,"length":2.0,"datamodel":"karateman/pot"},{"beat":22.0,"track":1,"length":2.0,"datamodel":"karateman/pot"},{"beat":23.0,"track":2,"length":2.0,"datamodel":"karateman/pot"},{"beat":24.0,"track":3,"length":2.0,"datamodel":"karateman/ball"},{"beat":25.0,"track":1,"length":2.0,"datamodel":"karateman/pot"},{"beat":27.0,"track":1,"length":2.0,"datamodel":"karateman/bulb"},{"beat":29.0,"track":1,"length":4.0,"datamodel":"karateman/combo"},{"beat":33.0,"track":0,"length":1.0,"datamodel":"gameManager/switchGame/clappyTrio"},{"beat":33.0,"track":1,"length":1.0,"datamodel":"clappyTrio/bop"},{"beat":34.0,"track":1,"length":1.0,"datamodel":"clappyTrio/bop"},{"beat":35.0,"track":1,"length":1.0,"datamodel":"clappyTrio/prepare_alt"},{"beat":36.5,"track":1,"length":0.75,"datamodel":"clappyTrio/clap"},{"beat":38.5,"track":0,"length":1.0,"datamodel":"clappyTrio/prepare"},{"beat":39.0,"track":1,"length":0.25,"datamodel":"clappyTrio/clap"},{"beat":40.0,"track":1,"length":1.0,"datamodel":"clappyTrio/bop"},{"beat":41.0,"track":0,"length":1.0,"datamodel":"gameManager/switchGame/spaceball"},{"beat":42.0,"track":1,"length":2.0,"datamodel":"spaceball/shoot"},{"beat":45.0,"track":1,"length":3.0,"datamodel":"spaceball/shootHigh"},{"beat":48.0,"track":1,"length":2.0,"datamodel":"spaceball/shoot"},{"beat":50.0,"track":1,"length":2.0,"datamodel":"spaceball/shoot"},{"beat":53.0,"track":1,"length":3.0,"datamodel":"spaceball/shootHigh"},{"beat":57.0,"track":1,"length":2.0,"datamodel":"spaceball/shoot"},{"beat":59.0,"track":1,"length":2.0,"datamodel":"spaceball/shoot"},{"beat":61.0,"track":1,"length":3.0,"datamodel":"spaceball/shootHigh"},{"beat":64.0,"track":0,"length":1.0,"datamodel":"gameManager/switchGame/forkLifter"},{"beat":65.0,"track":1,"length":3.0,"datamodel":"forkLifter/pea"},{"beat":68.0,"track":0,"length":3.0,"datamodel":"forkLifter/pea"},{"beat":70.0,"track":1,"length":3.0,"datamodel":"forkLifter/pea"},{"beat":72.5,"track":2,"length":1.0,"datamodel":"forkLifter/gulp"},{"beat":73.0,"track":1,"length":2.0,"datamodel":"spaceSoccer/ball dispense"},{"beat":73.0,"track":0,"length":1.0,"datamodel":"gameManager/switchGame/spaceSoccer"},{"beat":75.0,"track":1,"length":10.0,"datamodel":"spaceSoccer/keep-up"},{"beat":85.0,"track":1,"length":3.0,"datamodel":"spaceSoccer/high kick-toe!"},{"beat":88.0,"track":1,"length":5.0,"datamodel":"spaceSoccer/keep-up"},{"beat":93.0,"track":1,"length":3.0,"datamodel":"spaceSoccer/high kick-toe!"},{"beat":96.0,"track":1,"length":4.0,"datamodel":"spaceSoccer/keep-up"}],"tempoChanges":[]} \ No newline at end of file diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 055032ba..5a1a7b03 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -79,8 +79,8 @@ namespace RhythmHeavenMania if (Beatmap.entities.Count >= 1) { - SetCurrentGame(Beatmap.entities[0].datamodel.Split('/')[0]); - SetGame(Beatmap.entities[0].datamodel.Split('/')[0]); + SetCurrentGame(Beatmap.entities[0].datamodel.Split(0)); + SetGame(Beatmap.entities[0].datamodel.Split(0)); } } @@ -303,6 +303,10 @@ namespace RhythmHeavenMania public GameObject GetGame(string name) { + if (name == "gameManager") + { + name = Beatmap.entities.FindAll(c => c.datamodel.Split(0) != "gameManager").ToList()[0].datamodel.Split(0); + } return Resources.Load($"Games/{name}"); } diff --git a/Assets/Scripts/Games/KarateMan/KarateJoe.cs b/Assets/Scripts/Games/KarateMan/KarateJoe.cs index d315acc9..2ba5dc79 100644 --- a/Assets/Scripts/Games/KarateMan/KarateJoe.cs +++ b/Assets/Scripts/Games/KarateMan/KarateJoe.cs @@ -35,7 +35,7 @@ namespace RhythmHeavenMania.Games.KarateMan public static KarateJoe instance { get; set; } - private void Start() + private void Awake() { instance = this; anim = GetComponent(); diff --git a/Assets/Scripts/LevelEditor/Editor.cs b/Assets/Scripts/LevelEditor/Editor.cs index f4589b98..4338049d 100644 --- a/Assets/Scripts/LevelEditor/Editor.cs +++ b/Assets/Scripts/LevelEditor/Editor.cs @@ -70,7 +70,7 @@ namespace RhythmHeavenMania.Editor Tooltip.AddTooltip(UndoBTN.gameObject, "Undo [Ctrl+Z]"); Tooltip.AddTooltip(RedoBTN.gameObject, "Redo [Ctrl+Y or Ctrl+Shift+Z]"); Tooltip.AddTooltip(MusicSelectBTN.gameObject, "Music Select"); - Tooltip.AddTooltip(EditorSettingsBTN.gameObject, "Editor Settings [Ctrl+O]"); + Tooltip.AddTooltip(EditorSettingsBTN.gameObject, "Editor Settings [Ctrl+Shift+O]"); } public void Update()