From 606ad902e7897164049066e857cc114bf06d2856 Mon Sep 17 00:00:00 2001 From: Braedon Date: Sun, 23 Jan 2022 02:01:59 -0500 Subject: [PATCH] Fixed some bugs, including one where the game refuses to load a new game. Also migrating a few games to the new Input system. (Read desc) However the new input system has a bug where if you press with two events eligible for a press, both of them interact. I don't know whether to fix this or not. --- Assets/Scenes/Editor.unity | 4 +- Assets/Scripts/EventCaller.cs | 2 +- Assets/Scripts/GameManager.cs | 20 +- .../Games/ForkLifter/ForkLifterPlayer.cs | 29 +- Assets/Scripts/Games/ForkLifter/Pea.cs | 154 +++++++++- Assets/Scripts/Games/KarateMan/Bomb.cs | 2 + Assets/Scripts/Games/KarateMan/Pot.cs | 2 + Assets/Scripts/Games/Minigame.cs | 2 +- Assets/Scripts/Games/PlayerActionObject.cs | 7 +- Assets/Scripts/Games/Spaceball/Spaceball.cs | 5 +- .../Scripts/Games/Spaceball/SpaceballBall.cs | 50 +++- .../Games/Spaceball/SpaceballPlayer.cs | 53 +--- .../Commands/{Selections.cs => Block.cs} | 2 + .../{Selections.cs.meta => Block.cs.meta} | 0 .../EventSelector/GridGameSelector.cs | 2 +- Assets/spaceball.json | 263 +----------------- 16 files changed, 254 insertions(+), 343 deletions(-) rename Assets/Scripts/LevelEditor/Commands/{Selections.cs => Block.cs} (96%) rename Assets/Scripts/LevelEditor/Commands/{Selections.cs.meta => Block.cs.meta} (100%) diff --git a/Assets/Scenes/Editor.unity b/Assets/Scenes/Editor.unity index caca9008..17fc2d5f 100644 --- a/Assets/Scenes/Editor.unity +++ b/Assets/Scenes/Editor.unity @@ -7940,8 +7940,8 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: f86858990a87c764892672104bdaef1f, type: 3} m_Name: m_EditorClassIdentifier: - level: {fileID: 4900000, guid: ac276edd56ab99249a2a413e6ac2783d, type: 3} - music: {fileID: 8300000, guid: d6aa7955da64b284589e923dc18c67fb, type: 3} + level: {fileID: 4900000, guid: cbe1a43c8ddc790498fde2e01e66d23e, type: 3} + music: {fileID: 8300000, guid: 51af38323954a8d44874780ba4577fb4, type: 3} debugUI: 0 playOnStart: 0 editor: 1 diff --git a/Assets/Scripts/EventCaller.cs b/Assets/Scripts/EventCaller.cs index 14899b3d..fcbeef55 100644 --- a/Assets/Scripts/EventCaller.cs +++ b/Assets/Scripts/EventCaller.cs @@ -50,7 +50,7 @@ namespace RhythmHeavenMania for (int i = 0; i < minigamesInBeatmap.Count; i++) { - minigames[minigames.FindIndex(c => c.name == minigamesInBeatmap[i].name)].holder = Resources.Load($"Games/{minigamesInBeatmap[i].name}"); + // minigames[minigames.FindIndex(c => c.name == minigamesInBeatmap[i].name)].holder = Resources.Load($"Games/{minigamesInBeatmap[i].name}"); } } diff --git a/Assets/Scripts/GameManager.cs b/Assets/Scripts/GameManager.cs index 504293fc..88d53897 100644 --- a/Assets/Scripts/GameManager.cs +++ b/Assets/Scripts/GameManager.cs @@ -84,6 +84,7 @@ namespace RhythmHeavenMania } } + // LateUpdate works a bit better but causes a bit of bugs, so remind me to fix those eventually private void Update() { if (Beatmap.entities.Count < 1) @@ -255,7 +256,7 @@ namespace RhythmHeavenMania if (instantiate) { - currentGameO = Instantiate(GetGame(game).holder); + currentGameO = Instantiate(GetGame(game)); currentGameO.transform.parent = eventCaller.GamesHolder.transform; currentGameO.name = game; } @@ -264,8 +265,8 @@ namespace RhythmHeavenMania if (onGameSwitch) { - if (GetGame(currentGame).holder.GetComponent() != null) - GetGame(game).holder.GetComponent().OnGameSwitch(); + if (GetGame(currentGame).GetComponent() != null) + GetGame(game).GetComponent().OnGameSwitch(); } SetCurrentGame(game); @@ -276,16 +277,21 @@ namespace RhythmHeavenMania if (preloadedGames.Contains(preloadedGames.Find(c => c.name == game))) return; - var g = Instantiate(GetGame(game).holder); + var g = Instantiate(GetGame(game)); g.transform.parent = eventCaller.GamesHolder.transform; g.SetActive(false); g.name = game; preloadedGames.Add(g); } - public Minigames.Minigame GetGame(string name) + public GameObject GetGame(string name) { - return eventCaller.minigames.Find(c => c.name == name); + return Resources.Load($"Games/{name}"); + } + + public Minigames.Minigame GetGameInfo(string name) + { + return EventCaller.instance.minigames.Find(c => c.name == name); } // never gonna use this @@ -297,7 +303,7 @@ namespace RhythmHeavenMania public void SetCurrentGame(string game) { currentGame = game; - CircleCursor.InnerCircle.GetComponent().color = Colors.Hex2RGB(GetGame(currentGame).color); + CircleCursor.InnerCircle.GetComponent().color = Colors.Hex2RGB(GetGameInfo(currentGame).color); } private bool SongPosLessThanClipLength(float t) diff --git a/Assets/Scripts/Games/ForkLifter/ForkLifterPlayer.cs b/Assets/Scripts/Games/ForkLifter/ForkLifterPlayer.cs index 1a9ca77e..102c9f54 100644 --- a/Assets/Scripts/Games/ForkLifter/ForkLifterPlayer.cs +++ b/Assets/Scripts/Games/ForkLifter/ForkLifterPlayer.cs @@ -28,15 +28,15 @@ namespace RhythmHeavenMania.Games.ForkLifter private int currentHitInList = 0; - private int currentEarlyPeasOnFork; - private int currentPerfectPeasOnFork; - private int currentLatePeasOnFork; + public int currentEarlyPeasOnFork; + public int currentPerfectPeasOnFork; + public int currentLatePeasOnFork; private bool isEating = false; // Burger shit - private bool topbun, middleburger, bottombun; + public bool topbun, middleburger, bottombun; // ----------- @@ -54,7 +54,7 @@ namespace RhythmHeavenMania.Games.ForkLifter { if (PlayerInput.Pressed()) { - Stab(); + Stab(null); } if (ForkLifter.instance.EligibleHits.Count == 0) @@ -116,10 +116,10 @@ namespace RhythmHeavenMania.Games.ForkLifter topbun = false; middleburger = false; bottombun = false; } - public void Stab() + public void Stab(Pea p) { if (isEating) return; - var EligibleHits = ForkLifter.instance.EligibleHits; + /*var EligibleHits = ForkLifter.instance.EligibleHits; bool canHit = (ForkLifter.instance.EligibleHits.Count > 0) && (currentHitInList < ForkLifter.instance.EligibleHits.Count); int events = ForkLifter.instance.MultipleEventsAtOnce(); @@ -251,15 +251,17 @@ namespace RhythmHeavenMania.Games.ForkLifter RemovePea(); } } - } + }*/ - if (!canHit) + if (p == null) + { Jukebox.PlayOneShotGame("forkLifter/stabnohit"); + } anim.Play("Player_Stab", 0, 0); } - private void FastEffectHit(int type) + public void FastEffectHit(int type) { GameObject hitFX2o = new GameObject(); hitFX2o.transform.localPosition = new Vector3(0.11f, -2.15f); @@ -274,7 +276,7 @@ namespace RhythmHeavenMania.Games.ForkLifter hfx2s.DOColor(new Color(1, 1, 1, 0), 0.07f).OnComplete(delegate { Destroy(hitFX2o); }); } - private void HitFXMiss(Vector2 pos, Vector2 size) + public void HitFXMiss(Vector2 pos, Vector2 size) { GameObject hitFXo = new GameObject(); hitFXo.transform.localPosition = new Vector3(pos.x, pos.y); @@ -284,10 +286,5 @@ namespace RhythmHeavenMania.Games.ForkLifter hfxs.sortingOrder = 100; hfxs.DOColor(new Color(1, 1, 1, 0), 0.05f).OnComplete(delegate { Destroy(hitFXo); }); } - - private void RemovePea() - { - ForkLifter.instance.EligibleHits[currentHitInList].gameObject.GetComponent().RemoveObject(currentHitInList, true); - } } } \ No newline at end of file diff --git a/Assets/Scripts/Games/ForkLifter/Pea.cs b/Assets/Scripts/Games/ForkLifter/Pea.cs index 97be0301..9f4dc923 100644 --- a/Assets/Scripts/Games/ForkLifter/Pea.cs +++ b/Assets/Scripts/Games/ForkLifter/Pea.cs @@ -4,6 +4,8 @@ using UnityEngine; using RhythmHeavenMania.Util; +using DG.Tweening; + namespace RhythmHeavenMania.Games.ForkLifter { public class Pea : PlayerActionObject @@ -25,14 +27,146 @@ namespace RhythmHeavenMania.Games.ForkLifter transform.GetChild(0).GetChild(i).GetComponent().sprite = transform.GetChild(0).GetComponent().sprite; } - PlayerActionInit(this.gameObject, startBeat, ForkLifter.instance.EligibleHits); + // PlayerActionInit(this.gameObject, startBeat, ForkLifter.instance.EligibleHits); isEligible = true; } + public override void OnAce() + { + this.Hit(); + } + + public void Hit() + { + ForkLifterPlayer.instance.Stab(this); + + GameObject pea = new GameObject(); + + pea.transform.parent = ForkLifterPlayer.instance.perfect.transform; + pea.transform.localScale = Vector2.one; + + pea.transform.localPosition = Vector3.zero; + + for (int i = 0; i < ForkLifterPlayer.instance.perfect.transform.childCount; i++) + { + ForkLifterPlayer.instance.perfect.transform.GetChild(i).transform.localPosition = new Vector3(0, (-1.67f - (0.15724f * i)) + 0.15724f * ForkLifterPlayer.instance.currentPerfectPeasOnFork); + } + + SpriteRenderer psprite = pea.AddComponent(); + psprite.sprite = ForkLifter.instance.peaHitSprites[type]; + psprite.sortingOrder = 20; + switch (type) + { + case 0: + psprite.sortingOrder = 101; + break; + case 1: + psprite.sortingOrder = 104; + break; + case 2: + psprite.sortingOrder = 103; + break; + case 3: + psprite.sortingOrder = 102; + break; + } + + GameObject hitFXo = new GameObject(); + hitFXo.transform.localPosition = new Vector3(1.9969f, -3.7026f); + hitFXo.transform.localScale = new Vector3(3.142196f, 3.142196f); + SpriteRenderer hfxs = hitFXo.AddComponent(); + hfxs.sprite = ForkLifterPlayer.instance.hitFX; + hfxs.sortingOrder = 100; + hfxs.DOColor(new Color(1, 1, 1, 0), 0.05f).OnComplete(delegate { Destroy(hitFXo); }); + + ForkLifterPlayer.instance.FastEffectHit(type); + + Jukebox.PlayOneShotGame("forkLifter/stab"); + + ForkLifterPlayer.instance.currentPerfectPeasOnFork++; + + if (type == 1) + { + ForkLifterPlayer.instance.topbun = true; + } + else if (type == 2) + { + ForkLifterPlayer.instance.middleburger = true; + } + else if (type == 3) + { + ForkLifterPlayer.instance.bottombun = true; + } + + Destroy(this.gameObject); + } + + public void Early() + { + GameObject pea = new GameObject(); + + pea.transform.parent = ForkLifterPlayer.instance.early.transform; + pea.transform.localScale = Vector2.one; + + pea.transform.localPosition = Vector3.zero; + pea.transform.localRotation = Quaternion.Euler(0, 0, 90); + + for (int i = 0; i < ForkLifterPlayer.instance.early.transform.childCount; i++) + { + ForkLifterPlayer.instance.early.transform.GetChild(i).transform.localPosition = new Vector3(0, (-1.67f - (0.15724f * i)) + 0.15724f * ForkLifterPlayer.instance.currentEarlyPeasOnFork); + } + + SpriteRenderer psprite = pea.AddComponent(); + psprite.sprite = ForkLifter.instance.peaHitSprites[type]; + psprite.sortingOrder = 20; + ForkLifterPlayer.instance.HitFXMiss(new Vector2(1.0424f, -4.032f), new Vector2(1.129612f, 1.129612f)); + ForkLifterPlayer.instance.HitFXMiss(new Vector2(0.771f, -3.016f), new Vector2(1.71701f, 1.71701f)); + ForkLifterPlayer.instance.HitFXMiss(new Vector2(2.598f, -2.956f), new Vector2(1.576043f, 1.576043f)); + ForkLifterPlayer.instance.HitFXMiss(new Vector2(2.551f, -3.609f), new Vector2(1.200788f, 1.200788f)); + + ForkLifterPlayer.instance.FastEffectHit(type); + + Jukebox.PlayOneShot("miss"); + + ForkLifterPlayer.instance.currentEarlyPeasOnFork++; + + Destroy(this.gameObject); + } + + public void Late() + { + GameObject pea = new GameObject(); + pea.transform.parent = ForkLifterPlayer.instance.late.transform; + pea.transform.localScale = Vector2.one; + + pea.transform.localPosition = Vector3.zero; + pea.transform.localRotation = Quaternion.Euler(0, 0, 90); + + for (int i = 0; i < ForkLifterPlayer.instance.late.transform.childCount; i++) + { + ForkLifterPlayer.instance.late.transform.GetChild(i).transform.localPosition = new Vector3(0, (-1.67f - (0.15724f * i)) + 0.15724f * ForkLifterPlayer.instance.currentLatePeasOnFork); + } + + SpriteRenderer psprite = pea.AddComponent(); + psprite.sprite = ForkLifter.instance.peaHitSprites[type]; + psprite.sortingOrder = 20; + ForkLifterPlayer.instance.HitFXMiss(new Vector2(1.0424f, -4.032f), new Vector2(1.129612f, 1.129612f)); + ForkLifterPlayer.instance.HitFXMiss(new Vector2(0.771f, -3.016f), new Vector2(1.71701f, 1.71701f)); + ForkLifterPlayer.instance.HitFXMiss(new Vector2(2.598f, -2.956f), new Vector2(1.576043f, 1.576043f)); + ForkLifterPlayer.instance.HitFXMiss(new Vector2(2.551f, -3.609f), new Vector2(1.200788f, 1.200788f)); + + ForkLifterPlayer.instance.FastEffectHit(type); + + Jukebox.PlayOneShot("miss"); + + ForkLifterPlayer.instance.currentLatePeasOnFork++; + Destroy(this.gameObject); + } + private void Update() { - float normalizedBeatAnim = Conductor.instance.GetLoopPositionFromBeat(startBeat, 2.5f); + float normalizedBeatAnim = Conductor.instance.GetLoopPositionFromBeat(startBeat, 2.45f); anim.Play("Flicked_Object", -1, normalizedBeatAnim); anim.speed = 0; @@ -40,6 +174,22 @@ namespace RhythmHeavenMania.Games.ForkLifter StateCheck(normalizedBeat); + if (PlayerInput.Pressed()) + { + if (state.perfect) + { + Hit(); + } + else if (state.early) + { + Early(); + } + else if (state.late) + { + Late(); + } + } + if (normalizedBeat > 1.35f) { Jukebox.PlayOneShot("audience/disappointed"); diff --git a/Assets/Scripts/Games/KarateMan/Bomb.cs b/Assets/Scripts/Games/KarateMan/Bomb.cs index 95ab1a62..5dcc4b89 100644 --- a/Assets/Scripts/Games/KarateMan/Bomb.cs +++ b/Assets/Scripts/Games/KarateMan/Bomb.cs @@ -35,6 +35,8 @@ namespace RhythmHeavenMania.Games.KarateMan startBeat = Conductor.instance.songPositionInBeats; eligible = true; + + PlayerActionInit(this.gameObject, startBeat); } public override void OnAce() diff --git a/Assets/Scripts/Games/KarateMan/Pot.cs b/Assets/Scripts/Games/KarateMan/Pot.cs index 1fb1a4f2..f94137cb 100644 --- a/Assets/Scripts/Games/KarateMan/Pot.cs +++ b/Assets/Scripts/Games/KarateMan/Pot.cs @@ -78,6 +78,8 @@ namespace RhythmHeavenMania.Games.KarateMan // PlayerActionInit(this.gameObject, createBeat, KarateMan.instance.EligibleHits); }*/ + PlayerActionInit(this.gameObject, createBeat); + Sprite.GetComponent().enabled = false; } diff --git a/Assets/Scripts/Games/Minigame.cs b/Assets/Scripts/Games/Minigame.cs index e6030c50..01d985c9 100644 --- a/Assets/Scripts/Games/Minigame.cs +++ b/Assets/Scripts/Games/Minigame.cs @@ -6,7 +6,7 @@ namespace RhythmHeavenMania.Games { public class Minigame : MonoBehaviour { - public static float earlyTime = 0.77f, perfectTime = 0.89f, lateTime = 1.09f, endTime = 1.15f; + public static float earlyTime = 0.84f, perfectTime = 0.91f, lateTime = 1.09f, endTime = 1.15f; public List EligibleHits = new List(); [System.Serializable] diff --git a/Assets/Scripts/Games/PlayerActionObject.cs b/Assets/Scripts/Games/PlayerActionObject.cs index 7a4998fa..42a1b97b 100644 --- a/Assets/Scripts/Games/PlayerActionObject.cs +++ b/Assets/Scripts/Games/PlayerActionObject.cs @@ -15,11 +15,14 @@ namespace RhythmHeavenMania.Games private int aceTimes; - public void PlayerActionInit(GameObject g, float createBeat, List eligibleHitsList) + private bool autoPlayEnabledOnStart; + + public void PlayerActionInit(GameObject g, float createBeat) { state.gameObject = g; state.createBeat = createBeat; - this.eligibleHitsList = eligibleHitsList; + + autoPlayEnabledOnStart = GameManager.instance.autoplay; } private void CheckForAce(float normalizedBeat) diff --git a/Assets/Scripts/Games/Spaceball/Spaceball.cs b/Assets/Scripts/Games/Spaceball/Spaceball.cs index 5d6de43d..606e3a3c 100644 --- a/Assets/Scripts/Games/Spaceball/Spaceball.cs +++ b/Assets/Scripts/Games/Spaceball/Spaceball.cs @@ -52,11 +52,12 @@ namespace RhythmHeavenMania.Games.Spaceball private void Start() { allCameraEvents = EventCaller.GetAllInGameManagerList("spaceball", new string[] { "cameraZoom" }); + GameManager.instance.GameCamera.transform.localPosition = new Vector3(0, 0, -10); } private void Update() { - try + /*try { var allPlayerActions = EventCaller.GetAllPlayerEntities("spaceball"); int currentPlayerEvent = GameManager.instance.currentPlayerEvent - EventCaller.GetAllPlayerEntitiesExceptBeforeBeat("spaceball", Conductor.instance.songPositionInBeats).Count; @@ -100,7 +101,7 @@ namespace RhythmHeavenMania.Games.Spaceball catch (System.Exception ex) { // this technically isn't game breaking so oh well - } + }*/ } private void UpdateCameraZoom() diff --git a/Assets/Scripts/Games/Spaceball/SpaceballBall.cs b/Assets/Scripts/Games/Spaceball/SpaceballBall.cs index 94bdde7f..02e9a4de 100644 --- a/Assets/Scripts/Games/Spaceball/SpaceballBall.cs +++ b/Assets/Scripts/Games/Spaceball/SpaceballBall.cs @@ -36,11 +36,47 @@ namespace RhythmHeavenMania.Games.Spaceball Sprite.gameObject.transform.eulerAngles = new Vector3(0, 0, rot); - PlayerActionInit(this.gameObject, startBeat, Spaceball.instance.EligibleHits); + // PlayerActionInit(this.gameObject, startBeat, Spaceball.instance.EligibleHits); isEligible = true; } + public override void OnAce() + { + this.Hit(); + } + + private void Hit() + { + hit = true; + hitBeat = Conductor.instance.songPositionInBeats; + hitPos = Holder.transform.localPosition; + hitRot = Holder.transform.eulerAngles.z; + + Jukebox.PlayOneShotGame("spaceball/hit"); + + randomEndPosX = Random.Range(40f, 55f); + + anim.enabled = false; + SpaceballPlayer.instance.Swing(this); + } + + private void Miss() + { + Holder.transform.GetChild(0).gameObject.AddComponent().rotateSpeed = -55; + + enabled = false; + anim.enabled = false; + + Rigidbody2D rb = gameObject.AddComponent(); + rb.bodyType = RigidbodyType2D.Dynamic; + rb.AddForce(transform.up * 1100); + rb.AddForce(transform.right * 400); + rb.gravityScale = 9; + + Jukebox.PlayOneShot("miss"); + } + private void Update() { if (hit) @@ -72,6 +108,18 @@ namespace RhythmHeavenMania.Games.Spaceball StateCheck(normalizedBeat); + if (PlayerInput.Pressed()) + { + if (state.perfect) + { + Hit(); + } + else if (state.notPerfect()) + { + Miss(); + } + } + // too lazy to make a proper fix for this float endTime = 1.2f; if (high) endTime = 1.1f; diff --git a/Assets/Scripts/Games/Spaceball/SpaceballPlayer.cs b/Assets/Scripts/Games/Spaceball/SpaceballPlayer.cs index fa3b2947..6ca25fcd 100644 --- a/Assets/Scripts/Games/Spaceball/SpaceballPlayer.cs +++ b/Assets/Scripts/Games/Spaceball/SpaceballPlayer.cs @@ -43,7 +43,7 @@ namespace RhythmHeavenMania.Games.Spaceball if (PlayerInput.Pressed()) { - Swing(); + Swing(null); } } @@ -53,55 +53,16 @@ namespace RhythmHeavenMania.Games.Spaceball anim.Play("Idle", 0, 0); } - public void Swing() + public void Swing(SpaceballBall b) { - var EligibleHits = Spaceball.instance.EligibleHits; - bool canHit = (Spaceball.instance.EligibleHits.Count > 0) && (currentHitInList < Spaceball.instance.EligibleHits.Count); - - int events = Spaceball.instance.MultipleEventsAtOnce(); - - for (int eventI = 0; eventI < events; eventI++) + if (b == null) { - if (canHit) - { - SpaceballBall ball = EligibleHits[currentHitInList].gameObject.GetComponent(); - - if (EligibleHits[currentHitInList].perfect) - { - ball.hit = true; - ball.hitBeat = Conductor.instance.songPositionInBeats; - ball.hitPos = ball.Holder.transform.localPosition; - ball.hitRot = ball.Holder.transform.eulerAngles.z; - - Jukebox.PlayOneShotGame("spaceball/hit"); - - ball.randomEndPosX = Random.Range(40f, 55f); - - ball.anim.enabled = false; - } - else if (EligibleHits[currentHitInList].late || EligibleHits[currentHitInList].early) - { - ball.Holder.transform.GetChild(0).gameObject.AddComponent().rotateSpeed = -55; - - ball.enabled = false; - ball.anim.enabled = false; - - Rigidbody2D rb = ball.gameObject.AddComponent(); - rb.bodyType = RigidbodyType2D.Dynamic; - rb.AddForce(transform.up * 1100); - rb.AddForce(transform.right * 400); - rb.gravityScale = 9; - - Jukebox.PlayOneShot("miss"); - } - - ball.RemoveObject(currentHitInList); - } - } - - if (!canHit) Jukebox.PlayOneShotGame("spaceball/swing"); + } + else + { + } anim.Play("Swing", 0, 0); } diff --git a/Assets/Scripts/LevelEditor/Commands/Selections.cs b/Assets/Scripts/LevelEditor/Commands/Block.cs similarity index 96% rename from Assets/Scripts/LevelEditor/Commands/Selections.cs rename to Assets/Scripts/LevelEditor/Commands/Block.cs index 731f4b4c..32c1497c 100644 --- a/Assets/Scripts/LevelEditor/Commands/Selections.cs +++ b/Assets/Scripts/LevelEditor/Commands/Block.cs @@ -76,6 +76,7 @@ namespace RhythmHeavenMania.Editor.Commands { EnsureEventObj(i); pos[i].eventObj.transform.localPosition = pos[i].previousPos; + pos[i].eventObj.entity.beat = pos[i].eventObj.transform.localPosition.x; } } @@ -85,6 +86,7 @@ namespace RhythmHeavenMania.Editor.Commands { EnsureEventObj(i); pos[i].eventObj.transform.localPosition = pos[i].lastPos_; + pos[i].eventObj.entity.beat = pos[i].eventObj.transform.localPosition.x; } } diff --git a/Assets/Scripts/LevelEditor/Commands/Selections.cs.meta b/Assets/Scripts/LevelEditor/Commands/Block.cs.meta similarity index 100% rename from Assets/Scripts/LevelEditor/Commands/Selections.cs.meta rename to Assets/Scripts/LevelEditor/Commands/Block.cs.meta diff --git a/Assets/Scripts/LevelEditor/EventSelector/GridGameSelector.cs b/Assets/Scripts/LevelEditor/EventSelector/GridGameSelector.cs index 8d814dc8..36a1d6ba 100644 --- a/Assets/Scripts/LevelEditor/EventSelector/GridGameSelector.cs +++ b/Assets/Scripts/LevelEditor/EventSelector/GridGameSelector.cs @@ -160,7 +160,7 @@ namespace RhythmHeavenMania.Editor { dragTimes++; - TimelineEventObj eventObj = new TimelineEventObj(); + TimelineEventObj eventObj; if (currentEventIndex == 0) { diff --git a/Assets/spaceball.json b/Assets/spaceball.json index 72f9abe6..515b19e4 100644 --- a/Assets/spaceball.json +++ b/Assets/spaceball.json @@ -1,262 +1 @@ -{ - "bpm": 105, - "entities": [ - { - "beat": 0, - "length": 0, - "valA": 4, - "datamodel": "spaceball/cameraZoom" - }, - { - "beat": 0, - "length": 4, - "valA": 10, - "datamodel":"spaceball/cameraZoom" - }, - { - "beat": 4, - "type": 1, - "datamodel": "spaceball/shoot" - }, - { - "beat": 6, - "datamodel": "spaceball/shoot" - }, - { - "beat": 8, - "length": 4, - "valA": 20, - "datamodel": "spaceball/cameraZoom" - }, - { - "beat": 8, - "datamodel": "spaceball/shoot" - }, - { - "beat": 10, - "datamodel": "spaceball/shoot" - }, - { - "beat": 12, - "length": 0.25, - "valA": 10, - "datamodel": "spaceball/cameraZoom" - }, - { - "beat": 14, - "datamodel": "spaceball/shoot" - }, - { - "beat": 16, - "datamodel": "spaceball/shoot" - }, - { - "beat": 18, - "datamodel": "spaceball/shoot" - }, - { - "beat": 20, - "datamodel": "spaceball/shoot" - }, - { - "beat": 22, - "datamodel": "spaceball/shoot" - }, - { - "beat": 22, - "length": 4, - "valA": 20, - "datamodel": "spaceball/cameraZoom" - }, - { - "beat": 24, - "datamodel": "spaceball/shoot" - }, - { - "beat": 26, - "datamodel": "spaceball/shoot" - }, - { - "beat": 28, - "datamodel": "spaceball/shootHigh" - }, - { - "beat": 32, - "length": 4, - "valA": 10, - "datamodel": "spaceball/cameraZoom" - }, - { - "beat": 32, - "datamodel": "spaceball/shoot" - }, - { - "beat": 34, - "datamodel": "spaceball/shoot" - }, - { - "beat": 36, - "datamodel": "spaceball/shoot" - }, - { - "beat": 38, - "datamodel": "spaceball/shoot" - }, - { - "beat": 40, - "datamodel": "spaceball/shoot" - }, - { - "beat": 42, - "datamodel": "spaceball/shoot" - }, - { - "beat": 44, - "datamodel": "spaceball/shootHigh" - }, - { - "beat": 44, - "length": 1, - "valA": 20, - "datamodel": "spaceball/cameraZoom" - }, - { - "beat": 48, - "datamodel": "spaceball/shoot" - }, - { - "beat": 50, - "datamodel": "spaceball/shoot" - }, - { - "beat": 52, - "datamodel": "spaceball/shootHigh" - }, - { - "beat": 56, - "datamodel": "spaceball/shoot" - }, - { - "beat": 58, - "datamodel": "spaceball/shoot" - }, - { - "beat": 60, - "datamodel": "spaceball/shootHigh" - }, - { - "beat": 64, - "datamodel": "spaceball/shoot" - }, - { - "beat": 66, - "datamodel": "spaceball/shoot" - }, - { - "beat": 68, - "datamodel": "spaceball/shoot" - }, - { - "beat": 70, - "datamodel": "spaceball/shoot" - }, - { - "beat": 72, - "datamodel": "spaceball/shoot" - }, - { - "beat": 72, - "datamodel": "spaceball/alien" - }, - { - "beat": 74, - "datamodel": "spaceball/alien" - }, - { - "beat": 74, - "datamodel": "spaceball/shoot" - }, - { - "beat": 76, - "datamodel": "spaceball/shootHigh" - }, - { - "beat": 80, - "datamodel": "spaceball/shoot" - }, - { - "beat": 82, - "datamodel": "spaceball/shoot" - }, - { - "beat": 84, - "datamodel": "spaceball/shoot" - }, - { - "beat": 85, - "datamodel": "spaceball/alien" - }, - { - "beat": 86, - "datamodel": "spaceball/shoot" - }, - { - "beat": 86, - "type": 1, - "datamodel": "spaceball/costume" - }, - { - "beat": 87, - "datamodel": "spaceball/alien" - }, - { - "beat": 88, - "datamodel": "spaceball/shoot" - }, - { - "beat": 89, - "datamodel": "spaceball/alien" - }, - { - "beat": 90, - "datamodel": "spaceball/shoot" - }, - { - "beat": 92, - "datamodel": "spaceball/shootHigh" - }, - { - "beat": 96, - "type": 2, - "datamodel": "spaceball/costume" - }, - { - "beat": 96, - "datamodel": "spaceball/shoot" - }, - { - "beat": 98, - "datamodel": "spaceball/shoot" - }, - { - "beat": 100, - "datamodel": "spaceball/shoot" - }, - { - "beat": 102, - "datamodel": "spaceball/shoot" - }, - { - "beat": 104, - "datamodel": "spaceball/shoot" - }, - { - "beat": 106, - "datamodel": "spaceball/shoot" - }, - { - "beat": 108, - "datamodel": "spaceball/shootHigh" - }, - ] -} \ No newline at end of file +{"bpm":105.0,"entities":[{"beat":4.0,"track":0,"type":1,"datamodel":"spaceball/shoot"},{"beat":6.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":8.0,"track":0,"length":4.0,"valA":20.0,"datamodel":"spaceball/cameraZoom"},{"beat":8.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":10.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":12.0,"track":0,"length":0.25,"valA":10.0,"datamodel":"spaceball/cameraZoom"},{"beat":14.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":16.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":18.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":20.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":22.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":22.0,"track":0,"length":4.0,"valA":20.0,"datamodel":"spaceball/cameraZoom"},{"beat":24.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":26.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":28.0,"track":0,"datamodel":"spaceball/shootHigh"},{"beat":32.0,"track":0,"length":4.0,"valA":10.0,"datamodel":"spaceball/cameraZoom"},{"beat":32.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":34.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":36.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":38.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":40.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":42.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":44.0,"track":0,"datamodel":"spaceball/shootHigh"},{"beat":44.0,"track":0,"length":1.0,"valA":20.0,"datamodel":"spaceball/cameraZoom"},{"beat":48.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":50.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":52.0,"track":0,"datamodel":"spaceball/shootHigh"},{"beat":56.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":58.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":60.0,"track":0,"datamodel":"spaceball/shootHigh"},{"beat":64.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":66.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":68.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":70.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":72.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":72.0,"track":0,"datamodel":"spaceball/alien"},{"beat":74.0,"track":0,"datamodel":"spaceball/alien"},{"beat":74.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":76.0,"track":0,"datamodel":"spaceball/shootHigh"},{"beat":80.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":82.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":84.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":85.0,"track":0,"datamodel":"spaceball/alien"},{"beat":86.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":86.0,"track":0,"type":1,"datamodel":"spaceball/costume"},{"beat":87.0,"track":0,"datamodel":"spaceball/alien"},{"beat":88.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":89.0,"track":0,"datamodel":"spaceball/alien"},{"beat":90.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":92.0,"track":0,"datamodel":"spaceball/shootHigh"},{"beat":96.0,"track":0,"type":2,"datamodel":"spaceball/costume"},{"beat":96.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":98.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":100.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":102.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":104.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":106.0,"track":0,"datamodel":"spaceball/shoot"},{"beat":108.0,"track":0,"datamodel":"spaceball/shootHigh"}]} \ No newline at end of file