Partially implement lobby ui, fix ui pointers on network rig

This commit is contained in:
2024-09-09 16:31:08 +02:00
parent d7eb1e65d2
commit 8529ebb4a9
20 changed files with 4229 additions and 917 deletions

View File

@@ -1,5 +1,7 @@
using HurricaneVR.Framework.Components;
using HurricaneVR.Framework.ControllerInput;
using HurricaneVR.Framework.Core.Player;
using HurricaneVR.Framework.Core.UI;
using Meta.XR.MultiplayerBlocks.NGO;
using Sirenix.OdinInspector;
using System.Collections;
@@ -40,7 +42,7 @@ public class PlayerComponent : NetworkBehaviour
public Vector3 Position => controller.transform.position;
public Vector3 Rotation => controller.transform.eulerAngles;
public Vector3 Rotation => controller.Camera.forward;
private bool isSoloRig => !networkObject.IsPlayerObject;
private bool isMultiplayerLocalRig => networkObject.IsLocalPlayer;
@@ -67,6 +69,14 @@ public class PlayerComponent : NetworkBehaviour
{
StartCoroutine(AddDontDestroyToDependencies());
if (isSoloRig || isMultiplayerLocalRig)
{
foreach (var pointer in GetComponentsInChildren<HVRUIPointer>())
{
HVRInputModule.Instance.AddPointer(pointer);
}
}
if (!isSoloRig) return;
audioListener.enabled = true;