feat: polish VR gameplay and sync tools
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using UnityEngine;
|
||||
|
||||
public static class GlobalSyncSettings
|
||||
{
|
||||
private const string AudioOffsetMsKey = "VRBeats.GlobalAudioOffsetMs";
|
||||
|
||||
public static float AudioOffsetMs
|
||||
{
|
||||
get => PlayerPrefs.GetFloat(AudioOffsetMsKey, 0.0f);
|
||||
set
|
||||
{
|
||||
PlayerPrefs.SetFloat(AudioOffsetMsKey, Mathf.Clamp(value, -300.0f, 300.0f));
|
||||
PlayerPrefs.Save();
|
||||
}
|
||||
}
|
||||
|
||||
public static float AudioOffsetSeconds => AudioOffsetMs / 1000.0f;
|
||||
|
||||
public static void Reset()
|
||||
{
|
||||
PlayerPrefs.DeleteKey(AudioOffsetMsKey);
|
||||
PlayerPrefs.Save();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user