Destroy Square

This commit is contained in:
fu-majime 2024-03-24 15:14:51 +09:00
parent 51feaa9ddd
commit b28ee8e548
2 changed files with 8 additions and 7 deletions

View file

@ -74,7 +74,7 @@ namespace HeavenStudio.Games.Scripts_BuiltToScaleRvl
if (!BuiltToScaleRvl.IsPositionInRange(nextPos)) if (!BuiltToScaleRvl.IsPositionInRange(nextPos))
{ {
actions.Add(new BeatAction.Action(beat + length, () => RemoveAndDestroy())); actions.Add(new BeatAction.Action(beat + length, () => End()));
} }
else if (nextPos == 2) else if (nextPos == 2)
{ {
@ -140,7 +140,7 @@ namespace HeavenStudio.Games.Scripts_BuiltToScaleRvl
game.PlayBlockBounceMiss(this.nextPos); game.PlayBlockBounceMiss(this.nextPos);
BeatAction.New(this, new List<BeatAction.Action>() {new BeatAction.Action(currentBeat + 2*lengthBeat, delegate { BeatAction.New(this, new List<BeatAction.Action>() {new BeatAction.Action(currentBeat + 2*lengthBeat, delegate {
game.PlayBlockIdle(this.nextPos, currentBeat + 2*lengthBeat); game.PlayBlockIdle(this.nextPos, currentBeat + 2*lengthBeat);
RemoveAndDestroy(); End();
})}); })});
currentCurve = game.curve[^1]; // miss currentCurve = game.curve[^1]; // miss
currentBeat = Conductor.instance.songPositionInBeats; currentBeat = Conductor.instance.songPositionInBeats;
@ -161,7 +161,7 @@ namespace HeavenStudio.Games.Scripts_BuiltToScaleRvl
rodAnim.SetFloat("speed", -1f); rodAnim.SetFloat("speed", -1f);
isMiss = true; isMiss = true;
game.PlayBlockShootNearlyMiss(this.nextPos); game.PlayBlockShootNearlyMiss(this.nextPos);
BeatAction.New(this, new List<BeatAction.Action>() {new BeatAction.Action(currentBeat + lengthBeat, () => RemoveAndDestroy())}); BeatAction.New(this, new List<BeatAction.Action>() {new BeatAction.Action(currentBeat + lengthBeat, () => End())});
return; return;
} }
@ -170,7 +170,7 @@ namespace HeavenStudio.Games.Scripts_BuiltToScaleRvl
Destroy(square.gameObject); Destroy(square.gameObject);
} }
game.SpawnAssembled(); game.SpawnAssembled();
RemoveAndDestroy(); End();
} }
private void ShootOnMiss(PlayerActionEvent caller) private void ShootOnMiss(PlayerActionEvent caller)
{ {
@ -179,7 +179,7 @@ namespace HeavenStudio.Games.Scripts_BuiltToScaleRvl
isMissShoot = true; isMissShoot = true;
GetComponent<SpriteRenderer>().sortingOrder = 1; GetComponent<SpriteRenderer>().sortingOrder = 1;
game.PlayBlockShootMiss(nextPos); game.PlayBlockShootMiss(nextPos);
BeatAction.New(this, new List<BeatAction.Action>() {new BeatAction.Action(currentBeat + 2*lengthBeat, () => RemoveAndDestroy())}); BeatAction.New(this, new List<BeatAction.Action>() {new BeatAction.Action(currentBeat + 2*lengthBeat, () => End())});
} }
else else
{ {
@ -188,7 +188,7 @@ namespace HeavenStudio.Games.Scripts_BuiltToScaleRvl
rodAnim.SetFloat("speed", -1f); rodAnim.SetFloat("speed", -1f);
isMiss = true; isMiss = true;
game.PlayBlockBounceMiss(this.nextPos); game.PlayBlockBounceMiss(this.nextPos);
BeatAction.New(this, new List<BeatAction.Action>() {new BeatAction.Action(currentBeat + lengthBeat, () => RemoveAndDestroy())}); BeatAction.New(this, new List<BeatAction.Action>() {new BeatAction.Action(currentBeat + lengthBeat, () => End())});
} }
} }
private bool CanShootHit() private bool CanShootHit()
@ -198,7 +198,7 @@ namespace HeavenStudio.Games.Scripts_BuiltToScaleRvl
private void Empty(PlayerActionEvent caller) {} private void Empty(PlayerActionEvent caller) {}
void RemoveAndDestroy() void End()
{ {
Destroy(gameObject); Destroy(gameObject);
} }

View file

@ -31,6 +31,7 @@ namespace HeavenStudio.Games.Scripts_BuiltToScaleRvl
private void Recursion(double beat, double length) private void Recursion(double beat, double length)
{ {
if (beat > targetBeat + 10 * lengthBeat) End();
BeatAction.New(this, new List<BeatAction.Action>() BeatAction.New(this, new List<BeatAction.Action>()
{ {
new BeatAction.Action(beat + length, delegate new BeatAction.Action(beat + length, delegate