From b28ee8e548a85926f7c7ccd0419c362c1fda05d5 Mon Sep 17 00:00:00 2001 From: fu-majime Date: Sun, 24 Mar 2024 15:14:51 +0900 Subject: [PATCH] Destroy Square --- Assets/Scripts/Games/BuiltToScaleRvl/Rod.cs | 14 +++++++------- Assets/Scripts/Games/BuiltToScaleRvl/Square.cs | 1 + 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/Assets/Scripts/Games/BuiltToScaleRvl/Rod.cs b/Assets/Scripts/Games/BuiltToScaleRvl/Rod.cs index c4ffe71d4..48a40f0da 100644 --- a/Assets/Scripts/Games/BuiltToScaleRvl/Rod.cs +++ b/Assets/Scripts/Games/BuiltToScaleRvl/Rod.cs @@ -74,7 +74,7 @@ namespace HeavenStudio.Games.Scripts_BuiltToScaleRvl if (!BuiltToScaleRvl.IsPositionInRange(nextPos)) { - actions.Add(new BeatAction.Action(beat + length, () => RemoveAndDestroy())); + actions.Add(new BeatAction.Action(beat + length, () => End())); } else if (nextPos == 2) { @@ -140,7 +140,7 @@ namespace HeavenStudio.Games.Scripts_BuiltToScaleRvl game.PlayBlockBounceMiss(this.nextPos); BeatAction.New(this, new List() {new BeatAction.Action(currentBeat + 2*lengthBeat, delegate { game.PlayBlockIdle(this.nextPos, currentBeat + 2*lengthBeat); - RemoveAndDestroy(); + End(); })}); currentCurve = game.curve[^1]; // miss currentBeat = Conductor.instance.songPositionInBeats; @@ -161,7 +161,7 @@ namespace HeavenStudio.Games.Scripts_BuiltToScaleRvl rodAnim.SetFloat("speed", -1f); isMiss = true; game.PlayBlockShootNearlyMiss(this.nextPos); - BeatAction.New(this, new List() {new BeatAction.Action(currentBeat + lengthBeat, () => RemoveAndDestroy())}); + BeatAction.New(this, new List() {new BeatAction.Action(currentBeat + lengthBeat, () => End())}); return; } @@ -170,7 +170,7 @@ namespace HeavenStudio.Games.Scripts_BuiltToScaleRvl Destroy(square.gameObject); } game.SpawnAssembled(); - RemoveAndDestroy(); + End(); } private void ShootOnMiss(PlayerActionEvent caller) { @@ -179,7 +179,7 @@ namespace HeavenStudio.Games.Scripts_BuiltToScaleRvl isMissShoot = true; GetComponent().sortingOrder = 1; game.PlayBlockShootMiss(nextPos); - BeatAction.New(this, new List() {new BeatAction.Action(currentBeat + 2*lengthBeat, () => RemoveAndDestroy())}); + BeatAction.New(this, new List() {new BeatAction.Action(currentBeat + 2*lengthBeat, () => End())}); } else { @@ -188,7 +188,7 @@ namespace HeavenStudio.Games.Scripts_BuiltToScaleRvl rodAnim.SetFloat("speed", -1f); isMiss = true; game.PlayBlockBounceMiss(this.nextPos); - BeatAction.New(this, new List() {new BeatAction.Action(currentBeat + lengthBeat, () => RemoveAndDestroy())}); + BeatAction.New(this, new List() {new BeatAction.Action(currentBeat + lengthBeat, () => End())}); } } private bool CanShootHit() @@ -198,7 +198,7 @@ namespace HeavenStudio.Games.Scripts_BuiltToScaleRvl private void Empty(PlayerActionEvent caller) {} - void RemoveAndDestroy() + void End() { Destroy(gameObject); } diff --git a/Assets/Scripts/Games/BuiltToScaleRvl/Square.cs b/Assets/Scripts/Games/BuiltToScaleRvl/Square.cs index eeb58aa93..3dc167369 100644 --- a/Assets/Scripts/Games/BuiltToScaleRvl/Square.cs +++ b/Assets/Scripts/Games/BuiltToScaleRvl/Square.cs @@ -31,6 +31,7 @@ namespace HeavenStudio.Games.Scripts_BuiltToScaleRvl private void Recursion(double beat, double length) { + if (beat > targetBeat + 10 * lengthBeat) End(); BeatAction.New(this, new List() { new BeatAction.Action(beat + length, delegate