feat: polish VR gameplay and sync tools

This commit is contained in:
jongjae0305
2026-05-28 19:01:20 +09:00
parent ee34d79a66
commit 03105a4f85
50 changed files with 4986 additions and 328 deletions
+12 -1
View File
@@ -15,10 +15,14 @@ namespace VRBeats
private VR_Grabbable grabbable = null;
private ColorSide colorSide = ColorSide.Left;
private MeshRenderer[] renderArray = null;
private SaberTrailEffect trailEffect = null;
private void Awake()
{
renderArray = transform.GetComponentsInChildren<MeshRenderer>();
trailEffect = GetComponent<SaberTrailEffect>();
if (trailEffect == null)
trailEffect = gameObject.AddComponent<SaberTrailEffect>();
grabbable = GetComponent<VR_Grabbable>();
grabbable.OnGrabStateChange.AddListener(OnGrabStateChange);
@@ -44,6 +48,9 @@ namespace VRBeats
{
SetMaterialBindings(materialBindingArray[n], c);
}
if (trailEffect != null)
trailEffect.SetColor(c);
}
private void SetMaterialBindings(MaterialBindings matBindings, Color c)
@@ -55,11 +62,15 @@ namespace VRBeats
public void MakeVisible()
{
SetRenderArrayEnableValue(true);
if (trailEffect != null)
trailEffect.SetVisible(true);
}
public void MakeInvisible()
{
SetRenderArrayEnableValue(false);
if (trailEffect != null)
trailEffect.SetVisible(false);
}
private void SetRenderArrayEnableValue(bool value)
@@ -72,4 +83,4 @@ namespace VRBeats
}
}
}