fixed some issues

This commit is contained in:
Rapandrasmus 2024-01-01 15:40:31 +01:00
parent db49ce5b66
commit 6e16868f5b
3 changed files with 22 additions and 20 deletions

View file

@ -16541,7 +16541,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 5900117050100066750} m_GameObject: {fileID: 5900117050100066750}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 4.45, y: -3.432, z: 0} m_LocalPosition: {x: -4.450001, y: -3.432, z: 0}
m_LocalScale: {x: 0.584, y: 0.584, z: 1} m_LocalScale: {x: 0.584, y: 0.584, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
@ -16939,7 +16939,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7275193936285157507} m_GameObject: {fileID: 7275193936285157507}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -8.885, y: 11.64, z: 0} m_LocalPosition: {x: -8.885, y: 11.62, z: 0}
m_LocalScale: {x: 0.584, y: 0.584, z: 1} m_LocalScale: {x: 0.584, y: 0.584, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []
@ -17545,7 +17545,7 @@ Transform:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8677446887969771736} m_GameObject: {fileID: 8677446887969771736}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: -4.45, y: -3.432, z: 0} m_LocalPosition: {x: -13.35, y: -3.432, z: 0}
m_LocalScale: {x: 0.584, y: 0.584, z: 1} m_LocalScale: {x: 0.584, y: 0.584, z: 1}
m_ConstrainProportionsScale: 0 m_ConstrainProportionsScale: 0
m_Children: [] m_Children: []

View file

@ -20,6 +20,7 @@ namespace HeavenStudio.Games.Scripts_TotemClimb
private Animator _anim; private Animator _anim;
private TotemClimb _game; private TotemClimb _game;
private double _startBeat; private double _startBeat;
private double _onPlayBeat;
private void Awake() private void Awake()
{ {
@ -27,8 +28,9 @@ namespace HeavenStudio.Games.Scripts_TotemClimb
_game = TotemClimb.instance; _game = TotemClimb.instance;
} }
public void InitPath(double beat) public void InitPath(double beat, double onPlayBeat)
{ {
_onPlayBeat = onPlayBeat;
_startBeat = beat; _startBeat = beat;
_path = new Path(); _path = new Path();
_path.positions = new PathPos[2]; _path.positions = new PathPos[2];
@ -302,11 +304,11 @@ namespace HeavenStudio.Games.Scripts_TotemClimb
if (isTriple) _game.FallFrogAtBeat(caller.startBeat + caller.timer, 1); if (isTriple) _game.FallFrogAtBeat(caller.startBeat + caller.timer, 1);
if (state >= 1f || state <= -1f) if (state >= 1f || state <= -1f)
{ {
SoundByte.PlayOneShot("nearMiss"); if (caller.startBeat + caller.timer >= _onPlayBeat) SoundByte.PlayOneShot("nearMiss");
return; return;
} }
_jumpParticle.PlayScaledAsync(0.5f); _jumpParticle.PlayScaledAsync(0.5f);
SoundByte.PlayOneShotGame(isTriple ? "totemClimb/totemlandb" : "totemClimb/totemland"); if (caller.startBeat + caller.timer >= _onPlayBeat) SoundByte.PlayOneShotGame(isTriple ? "totemClimb/totemlandb" : "totemClimb/totemland");
} }
private void JustTripleEnter(PlayerActionEvent caller, float state) private void JustTripleEnter(PlayerActionEvent caller, float state)
@ -315,11 +317,11 @@ namespace HeavenStudio.Games.Scripts_TotemClimb
_game.FallFrogAtBeat(caller.startBeat + caller.timer, -1); _game.FallFrogAtBeat(caller.startBeat + caller.timer, -1);
if (state >= 1f || state <= -1f) if (state >= 1f || state <= -1f)
{ {
SoundByte.PlayOneShot("nearMiss"); if (caller.startBeat + caller.timer >= _onPlayBeat) SoundByte.PlayOneShot("nearMiss");
return; return;
} }
_jumpParticle.PlayScaledAsync(0.5f); _jumpParticle.PlayScaledAsync(0.5f);
SoundByte.PlayOneShotGame("totemClimb/totemland"); if (caller.startBeat + caller.timer >= _onPlayBeat) SoundByte.PlayOneShotGame("totemClimb/totemland");
} }
private void JustTripleExit(PlayerActionEvent caller, float state) private void JustTripleExit(PlayerActionEvent caller, float state)
@ -328,22 +330,22 @@ namespace HeavenStudio.Games.Scripts_TotemClimb
_game.FallFrogAtBeat(caller.startBeat + caller.timer, 0); _game.FallFrogAtBeat(caller.startBeat + caller.timer, 0);
if (state >= 1f || state <= -1f) if (state >= 1f || state <= -1f)
{ {
SoundByte.PlayOneShot("nearMiss"); if (caller.startBeat + caller.timer >= _onPlayBeat) SoundByte.PlayOneShot("nearMiss");
return; return;
} }
_jumpParticle.PlayScaledAsync(0.5f); _jumpParticle.PlayScaledAsync(0.5f);
SoundByte.PlayOneShotGame("totemClimb/totemland"); if (caller.startBeat + caller.timer >= _onPlayBeat) SoundByte.PlayOneShotGame("totemClimb/totemland");
} }
private void JustHold(PlayerActionEvent caller, float state) private void JustHold(PlayerActionEvent caller, float state)
{ {
SoundByte.PlayOneShotGame("totemClimb/chargejump"); if (caller.startBeat + caller.timer >= _onPlayBeat) SoundByte.PlayOneShotGame("totemClimb/chargejump");
_game.HoldDragonAtBeat(caller.startBeat + caller.timer); _game.HoldDragonAtBeat(caller.startBeat + caller.timer);
StartCoroutine(HoldCo(caller.startBeat + caller.timer)); StartCoroutine(HoldCo(caller.startBeat + caller.timer));
_anim.DoScaledAnimationAsync("Hold", 0.5f); _anim.DoScaledAnimationAsync("Hold", 0.5f);
if (state >= 1f || state <= -1f) if (state >= 1f || state <= -1f)
{ {
SoundByte.PlayOneShot("nearMiss"); if (caller.startBeat + caller.timer >= _onPlayBeat) SoundByte.PlayOneShot("nearMiss");
return; return;
} }
} }
@ -354,11 +356,11 @@ namespace HeavenStudio.Games.Scripts_TotemClimb
_game.ReleaseDragonAtBeat(caller.startBeat + caller.timer); _game.ReleaseDragonAtBeat(caller.startBeat + caller.timer);
if (state >= 1f || state <= -1f) if (state >= 1f || state <= -1f)
{ {
SoundByte.PlayOneShot("nearMiss"); if (caller.startBeat + caller.timer >= _onPlayBeat) SoundByte.PlayOneShot("nearMiss");
return; return;
} }
_jumpParticle.PlayScaledAsync(0.5f); _jumpParticle.PlayScaledAsync(0.5f);
SoundByte.PlayOneShotGame("totemClimb/superjumpgood"); if (caller.startBeat + caller.timer >= _onPlayBeat) SoundByte.PlayOneShotGame("totemClimb/superjumpgood");
} }
private void Miss(PlayerActionEvent caller) private void Miss(PlayerActionEvent caller)
@ -366,28 +368,28 @@ namespace HeavenStudio.Games.Scripts_TotemClimb
StartJumping(caller.startBeat + caller.timer, true); StartJumping(caller.startBeat + caller.timer, true);
_game.BopTotemAtBeat(caller.startBeat + caller.timer); _game.BopTotemAtBeat(caller.startBeat + caller.timer);
if (_game.IsTripleBeat(caller.startBeat + caller.timer)) _game.FallFrogAtBeat(caller.startBeat + caller.timer, 1); if (_game.IsTripleBeat(caller.startBeat + caller.timer)) _game.FallFrogAtBeat(caller.startBeat + caller.timer, 1);
SoundByte.PlayOneShot("miss"); if (caller.startBeat + caller.timer >= _onPlayBeat) SoundByte.PlayOneShot("miss");
} }
private void MissTripleEnter(PlayerActionEvent caller) private void MissTripleEnter(PlayerActionEvent caller)
{ {
TripleJumping(caller.startBeat + caller.timer, true, true); TripleJumping(caller.startBeat + caller.timer, true, true);
_game.FallFrogAtBeat(caller.startBeat + caller.timer, -1); _game.FallFrogAtBeat(caller.startBeat + caller.timer, -1);
SoundByte.PlayOneShot("miss"); if (caller.startBeat + caller.timer >= _onPlayBeat) SoundByte.PlayOneShot("miss");
} }
private void MissTripleExit(PlayerActionEvent caller) private void MissTripleExit(PlayerActionEvent caller)
{ {
TripleJumping(caller.startBeat + caller.timer, false, true); TripleJumping(caller.startBeat + caller.timer, false, true);
_game.FallFrogAtBeat(caller.startBeat + caller.timer, 0); _game.FallFrogAtBeat(caller.startBeat + caller.timer, 0);
SoundByte.PlayOneShot("miss"); if (caller.startBeat + caller.timer >= _onPlayBeat) SoundByte.PlayOneShot("miss");
} }
private void MissRelease(PlayerActionEvent caller) private void MissRelease(PlayerActionEvent caller)
{ {
HighJump(caller.startBeat + caller.timer, true); HighJump(caller.startBeat + caller.timer, true);
_game.ReleaseDragonAtBeat(caller.startBeat + caller.timer); _game.ReleaseDragonAtBeat(caller.startBeat + caller.timer);
SoundByte.PlayOneShot("miss"); if (caller.startBeat + caller.timer >= _onPlayBeat) SoundByte.PlayOneShot("miss");
} }
private void Empty(PlayerActionEvent caller) { } private void Empty(PlayerActionEvent caller) { }

View file

@ -90,7 +90,7 @@ namespace HeavenStudio.Games
GetTripleEvents(); GetTripleEvents();
HandleBopsOnStart(beat); HandleBopsOnStart(beat);
_totemManager.InitBeats(_startBeat); _totemManager.InitBeats(_startBeat);
_jumper.InitPath(_startBeat); _jumper.InitPath(_startBeat, beat);
} }
public override void OnPlay(double beat) public override void OnPlay(double beat)
@ -104,7 +104,7 @@ namespace HeavenStudio.Games
GetTripleEvents(); GetTripleEvents();
HandleBopsOnStart(beat); HandleBopsOnStart(beat);
_totemManager.InitBeats(_startBeat); _totemManager.InitBeats(_startBeat);
_jumper.InitPath(_startBeat); _jumper.InitPath(_startBeat, beat);
} }
private void CalculateStartAndEndBeat(double beat) private void CalculateStartAndEndBeat(double beat)