feat: polish VR gameplay and sync tools
This commit is contained in:
@@ -80,6 +80,9 @@ namespace VRBeats
|
||||
if (!isRight && !isLeft) continue;
|
||||
if (!name.Contains("Controller") && !name.Contains("Hand")) continue;
|
||||
if (go.GetComponent<LineRenderer>() == null) continue;
|
||||
|
||||
DisableToolkitPointerComponents(go);
|
||||
|
||||
if (go.GetComponent<VRPointerController>() != null) continue;
|
||||
|
||||
var pointer = go.AddComponent<VRPointerController>();
|
||||
@@ -94,8 +97,18 @@ namespace VRBeats
|
||||
if (disabledByDefault)
|
||||
pointer.enabled = false;
|
||||
|
||||
Debug.Log($"[VRPointerSetup] {(isRight ? "Right" : "Left")} pointer 추가: {go.name} (enabled={!disabledByDefault})");
|
||||
}
|
||||
}
|
||||
|
||||
private static void DisableToolkitPointerComponents(GameObject go)
|
||||
{
|
||||
var rayInteractor = go.GetComponent<UnityEngine.XR.Interaction.Toolkit.Interactors.XRRayInteractor>();
|
||||
if (rayInteractor != null)
|
||||
rayInteractor.enabled = false;
|
||||
|
||||
var lineVisual = go.GetComponent<UnityEngine.XR.Interaction.Toolkit.Interactors.Visuals.XRInteractorLineVisual>();
|
||||
if (lineVisual != null)
|
||||
lineVisual.enabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user