feat: polish VR gameplay and sync tools
This commit is contained in:
@@ -21,21 +21,30 @@ namespace VRBeats
|
||||
}
|
||||
|
||||
scoreManager = FindFirstObjectByType<ScoreManager>();
|
||||
ApplyPopupTextStyle();
|
||||
|
||||
}
|
||||
|
||||
public void ShowScore()
|
||||
{
|
||||
PlatinioTween.instance.ValueTween( 0.0f , scoreManager.CurrentScore , scoreFadeTime).SetOnUpdateFloat(delegate (float v)
|
||||
if (scoreText == null || scoreManager == null)
|
||||
return;
|
||||
|
||||
PlatinioTween.instance.ValueTween( 0.0f , scoreManager.CurrentScore , Mathf.Min(scoreFadeTime, 0.8f)).SetOnUpdateFloat(delegate (float v)
|
||||
{
|
||||
SetScore( (int)v );
|
||||
}).SetOnComplete(delegate
|
||||
{
|
||||
scoreText.text = scoreManager.BuildResultSummary(length);
|
||||
});
|
||||
}
|
||||
|
||||
public void ResetValues()
|
||||
{
|
||||
gameObject.CancelAllTweens();
|
||||
scoreText.text = initialValue;
|
||||
ApplyPopupTextStyle();
|
||||
if (scoreText != null)
|
||||
scoreText.text = initialValue;
|
||||
}
|
||||
|
||||
|
||||
@@ -56,5 +65,20 @@ namespace VRBeats
|
||||
|
||||
}
|
||||
|
||||
private void ApplyPopupTextStyle()
|
||||
{
|
||||
if (scoreText == null)
|
||||
return;
|
||||
|
||||
scoreText.enableAutoSizing = false;
|
||||
scoreText.fontSize = 4.4f;
|
||||
scoreText.alignment = TextAlignmentOptions.Center;
|
||||
scoreText.overflowMode = TextOverflowModes.Overflow;
|
||||
scoreText.textWrappingMode = TextWrappingModes.NoWrap;
|
||||
scoreText.lineSpacing = -18.0f;
|
||||
scoreText.color = Color.white;
|
||||
scoreText.richText = true;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user