feat: polish VR gameplay and sync tools
This commit is contained in:
@@ -56,10 +56,12 @@ namespace VRBeats
|
||||
//notify to whoever is listening that the player did a correct/incorrect slice
|
||||
if ( IsCutIntentValid(info as BeatDamageInfo) )
|
||||
{
|
||||
ScoreManager.ReportSliceTiming(GetTimingErrorSeconds());
|
||||
onCorrectSlice.Invoke();
|
||||
}
|
||||
else
|
||||
{
|
||||
ScoreManager.ReportMiss();
|
||||
onIncorrectSlice.Invoke();
|
||||
}
|
||||
|
||||
@@ -98,6 +100,7 @@ namespace VRBeats
|
||||
|
||||
public void Kill()
|
||||
{
|
||||
ScoreManager.ReportMiss();
|
||||
onPlayerMiss.Invoke();
|
||||
canBeKilled = false;
|
||||
transform.ScaleTween(Vector3.zero, 2.0f).SetEase(Ease.EaseOutExpo).SetOnComplete( delegate
|
||||
@@ -107,6 +110,13 @@ namespace VRBeats
|
||||
} );
|
||||
}
|
||||
|
||||
private float GetTimingErrorSeconds()
|
||||
{
|
||||
float speed = Mathf.Max(Mathf.Abs(thisSpawneable.Speed), 0.001f);
|
||||
float distanceFromPlayer = Mathf.Abs(transform.position.z - player.position.z);
|
||||
return distanceFromPlayer / speed;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user