Rally: Ball tweaks

This commit is contained in:
Jenny Crowe 2022-03-05 10:41:54 -07:00
parent 589db0f4e2
commit 2480feef5e
3 changed files with 11 additions and 3 deletions

View file

@ -280,7 +280,7 @@ GameObject:
m_Icon: {fileID: 0} m_Icon: {fileID: 0}
m_NavMeshLayer: 0 m_NavMeshLayer: 0
m_StaticEditorFlags: 0 m_StaticEditorFlags: 0
m_IsActive: 1 m_IsActive: 0
--- !u!4 &4959957736091286558 --- !u!4 &4959957736091286558
Transform: Transform:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0

View file

@ -93,6 +93,8 @@ namespace RhythmHeavenMania.Games.RhythmRally
whistleBeat = game.targetBeat + 0.5f; whistleBeat = game.targetBeat + 0.5f;
} }
game.ball.SetActive(false);
MultiSound.Play(new MultiSound.Sound[] { new MultiSound.Sound("rhythmRally/Whistle", whistleBeat) }); MultiSound.Play(new MultiSound.Sound[] { new MultiSound.Sound("rhythmRally/Whistle", whistleBeat) });
} }

View file

@ -155,7 +155,7 @@ namespace RhythmHeavenMania.Games.RhythmRally
curveHeight = 3f; curveHeight = 3f;
curveToUse.transform.localScale = new Vector3(1f, curveHeight, 1f); curveToUse.transform.localScale = new Vector3(1f, curveHeight, 1f);
ball.transform.position = curveToUse.GetPoint(Mathf.Clamp(curvePosition, 0, 1)); ball.transform.position = curveToUse.GetPoint(Mathf.Max(0, curvePosition));
} }
else else
{ {
@ -261,6 +261,9 @@ namespace RhythmHeavenMania.Games.RhythmRally
public void Serve(float beat, RallySpeed speed) public void Serve(float beat, RallySpeed speed)
{ {
if (!ball.activeSelf)
ball.SetActive(true);
served = true; served = true;
missed = false; missed = false;
started = true; started = true;
@ -308,6 +311,9 @@ namespace RhythmHeavenMania.Games.RhythmRally
opponentAnim.Play("Ready1"); opponentAnim.Play("Ready1");
} }
if (!ball.activeSelf)
ball.SetActive(true);
StartCoroutine(TossTrailCo()); StartCoroutine(TossTrailCo());
} }
@ -337,7 +343,7 @@ namespace RhythmHeavenMania.Games.RhythmRally
{ {
playerAnim.Play("Pose", 0, 0); playerAnim.Play("Pose", 0, 0);
opponentAnim.Play("Pose", 0, 0); opponentAnim.Play("Pose", 0, 0);
ball.gameObject.SetActive(false); // temporary solution, should realistically just fall down ball.SetActive(false); // temporary solution, should realistically just fall down
inPose = true; inPose = true;
} }