diff --git a/Assets/MagicLeap/PhotonFusionExample/Prefabs/Rigs/Magic Leap Rig.prefab b/Assets/MagicLeap/PhotonFusionExample/Prefabs/Rigs/Magic Leap Rig.prefab index bce6169..6ac4cdb 100644 --- a/Assets/MagicLeap/PhotonFusionExample/Prefabs/Rigs/Magic Leap Rig.prefab +++ b/Assets/MagicLeap/PhotonFusionExample/Prefabs/Rigs/Magic Leap Rig.prefab @@ -308,7 +308,6 @@ MonoBehaviour: m_Bits: 4294967295 m_AttachTransform: {fileID: 0} m_KeepSelectedTargetValid: 1 - m_DisableVisualsWhenBlockedInGroup: 1 m_StartingSelectedInteractable: {fileID: 0} m_StartingTargetFilter: {fileID: 0} m_HoverEntered: @@ -396,8 +395,6 @@ MonoBehaviour: m_HitClosestOnly: 0 m_HoverToSelect: 0 m_HoverTimeToSelect: 0.5 - m_AutoDeselect: 0 - m_TimeToAutoDeselect: 3 m_EnableUIInteraction: 1 m_AllowAnchorControl: 1 m_UseForceGrab: 1 @@ -653,7 +650,6 @@ MonoBehaviour: m_BlockedReticle: {fileID: 0} m_StopLineAtFirstRaycastHit: 1 m_StopLineAtSelection: 0 - m_SnapEndpointIfAvailable: 1 --- !u!114 &4041793601250586351 MonoBehaviour: m_ObjectHideFlags: 0 @@ -998,7 +994,6 @@ MonoBehaviour: m_Bits: 4294967295 m_AttachTransform: {fileID: 0} m_KeepSelectedTargetValid: 1 - m_DisableVisualsWhenBlockedInGroup: 1 m_StartingSelectedInteractable: {fileID: 0} m_StartingTargetFilter: {fileID: 0} m_HoverEntered: @@ -1086,8 +1081,6 @@ MonoBehaviour: m_HitClosestOnly: 0 m_HoverToSelect: 0 m_HoverTimeToSelect: 0.5 - m_AutoDeselect: 0 - m_TimeToAutoDeselect: 3 m_EnableUIInteraction: 1 m_AllowAnchorControl: 1 m_UseForceGrab: 1 @@ -1343,7 +1336,6 @@ MonoBehaviour: m_BlockedReticle: {fileID: 0} m_StopLineAtFirstRaycastHit: 1 m_StopLineAtSelection: 0 - m_SnapEndpointIfAvailable: 1 --- !u!1 &5827826083951272184 GameObject: m_ObjectHideFlags: 0 @@ -1579,7 +1571,6 @@ MonoBehaviour: m_Bits: 4294967295 m_AttachTransform: {fileID: 0} m_KeepSelectedTargetValid: 1 - m_DisableVisualsWhenBlockedInGroup: 1 m_StartingSelectedInteractable: {fileID: 0} m_StartingTargetFilter: {fileID: 0} m_HoverEntered: @@ -1667,8 +1658,6 @@ MonoBehaviour: m_HitClosestOnly: 0 m_HoverToSelect: 0 m_HoverTimeToSelect: 0.5 - m_AutoDeselect: 0 - m_TimeToAutoDeselect: 3 m_EnableUIInteraction: 1 m_AllowAnchorControl: 1 m_UseForceGrab: 1 @@ -1924,7 +1913,6 @@ MonoBehaviour: m_BlockedReticle: {fileID: 0} m_StopLineAtFirstRaycastHit: 1 m_StopLineAtSelection: 0 - m_SnapEndpointIfAvailable: 1 --- !u!1 &5827826084172097328 GameObject: m_ObjectHideFlags: 0 @@ -1959,7 +1947,7 @@ Transform: m_Children: - {fileID: 5827826083775952710} m_Father: {fileID: 0} - m_RootOrder: -1 + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!114 &5827826084172097330 MonoBehaviour: @@ -2211,10 +2199,10 @@ MonoBehaviour: m_DirectionalAnchorRotationAction: m_UseReference: 0 m_Action: - m_Name: + m_Name: Directional Anchor Rotation m_Type: 0 m_ExpectedControlType: - m_Id: + m_Id: 59a5dff3-0dd9-4614-a075-3e6f2a986a26 m_Processors: m_Interactions: m_SingletonActionBindings: [] @@ -2253,7 +2241,6 @@ MonoBehaviour: m_Bits: 4294967295 m_AttachTransform: {fileID: 0} m_KeepSelectedTargetValid: 1 - m_DisableVisualsWhenBlockedInGroup: 1 m_StartingSelectedInteractable: {fileID: 0} m_StartingTargetFilter: {fileID: 0} m_HoverEntered: @@ -2341,8 +2328,6 @@ MonoBehaviour: m_HitClosestOnly: 0 m_HoverToSelect: 0 m_HoverTimeToSelect: 0.5 - m_AutoDeselect: 0 - m_TimeToAutoDeselect: 3 m_EnableUIInteraction: 1 m_AllowAnchorControl: 1 m_UseForceGrab: 1 @@ -2598,7 +2583,6 @@ MonoBehaviour: m_BlockedReticle: {fileID: 0} m_StopLineAtFirstRaycastHit: 1 m_StopLineAtSelection: 0 - m_SnapEndpointIfAvailable: 1 --- !u!1 &7420615899294838510 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/MagicLeap/PhotonFusionExample/Scenes/MarkerColocation.unity b/Assets/MagicLeap/PhotonFusionExample/Scenes/MarkerColocation.unity index bdf03c0..fc9b1eb 100644 --- a/Assets/MagicLeap/PhotonFusionExample/Scenes/MarkerColocation.unity +++ b/Assets/MagicLeap/PhotonFusionExample/Scenes/MarkerColocation.unity @@ -414,7 +414,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3} m_Name: m_EditorClassIdentifier: - m_Version: 2 + m_Version: 3 m_UsePipelineSettings: 1 m_AdditionalLightsShadowResolutionTier: 2 m_LightLayerMask: 1 @@ -424,7 +424,7 @@ MonoBehaviour: m_ShadowRenderingLayers: 1 m_LightCookieSize: {x: 1, y: 1} m_LightCookieOffset: {x: 0, y: 0} - m_SoftShadowQuality: 1 + m_SoftShadowQuality: 2 --- !u!1 &603375775 GameObject: m_ObjectHideFlags: 0 @@ -466,6 +466,11 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 1662075093} m_Modifications: + - target: {fileID: 2090076763714845189, guid: 63d41041cface864cbc3c324765868e6, + type: 3} + propertyPath: m_text + value: Not Connected To Photon + objectReference: {fileID: 0} - target: {fileID: 2090076764477245125, guid: 63d41041cface864cbc3c324765868e6, type: 3} propertyPath: m_RootOrder @@ -541,6 +546,11 @@ PrefabInstance: propertyPath: m_Name value: Moveable Cube objectReference: {fileID: 0} + - target: {fileID: 2090076765059844014, guid: 63d41041cface864cbc3c324765868e6, + type: 3} + propertyPath: m_text + value: + objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] @@ -1062,6 +1072,11 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 306372738} m_Modifications: + - target: {fileID: 2090076763714845189, guid: 63d41041cface864cbc3c324765868e6, + type: 3} + propertyPath: m_text + value: Not Connected To Photon + objectReference: {fileID: 0} - target: {fileID: 2090076764477245125, guid: 63d41041cface864cbc3c324765868e6, type: 3} propertyPath: m_RootOrder @@ -1137,6 +1152,11 @@ PrefabInstance: propertyPath: m_Name value: Moveable Cube objectReference: {fileID: 0} + - target: {fileID: 2090076765059844014, guid: 63d41041cface864cbc3c324765868e6, + type: 3} + propertyPath: m_text + value: + objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] @@ -1225,6 +1245,11 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 603375776} m_Modifications: + - target: {fileID: 2090076763714845189, guid: 63d41041cface864cbc3c324765868e6, + type: 3} + propertyPath: m_text + value: Not Connected To Photon + objectReference: {fileID: 0} - target: {fileID: 2090076764477245125, guid: 63d41041cface864cbc3c324765868e6, type: 3} propertyPath: m_RootOrder @@ -1300,6 +1325,11 @@ PrefabInstance: propertyPath: m_Name value: Moveable Cube objectReference: {fileID: 0} + - target: {fileID: 2090076765059844014, guid: 63d41041cface864cbc3c324765868e6, + type: 3} + propertyPath: m_text + value: + objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] @@ -1313,6 +1343,76 @@ PrefabInstance: serializedVersion: 3 m_TransformParent: {fileID: 0} m_Modifications: + - target: {fileID: 556147534609547638, guid: 4b7b31e30b61762449b60c46c68c18cc, + type: 3} + propertyPath: m_PositionInput.m_Action.m_Id + value: ce78dce0-18b0-4c00-9447-e580e8bc1d12 + objectReference: {fileID: 0} + - target: {fileID: 556147534609547638, guid: 4b7b31e30b61762449b60c46c68c18cc, + type: 3} + propertyPath: m_RotationInput.m_Action.m_Id + value: 23c4c17c-cee1-4c36-88fd-a57ca8085454 + objectReference: {fileID: 0} + - target: {fileID: 556147534609547638, guid: 4b7b31e30b61762449b60c46c68c18cc, + type: 3} + propertyPath: m_PositionInput.m_Action.m_Name + value: Position Input + objectReference: {fileID: 0} + - target: {fileID: 556147534609547638, guid: 4b7b31e30b61762449b60c46c68c18cc, + type: 3} + propertyPath: m_RotationInput.m_Action.m_Name + value: Rotation Input + objectReference: {fileID: 0} + - target: {fileID: 556147534609547638, guid: 4b7b31e30b61762449b60c46c68c18cc, + type: 3} + propertyPath: m_TrackingStateInput.m_Action.m_Id + value: e647db30-1b18-4f50-9f11-46b7f9309793 + objectReference: {fileID: 0} + - target: {fileID: 556147534609547638, guid: 4b7b31e30b61762449b60c46c68c18cc, + type: 3} + propertyPath: m_TrackingStateInput.m_Action.m_Name + value: Tracking State Input + objectReference: {fileID: 0} + - target: {fileID: 556147534609547638, guid: 4b7b31e30b61762449b60c46c68c18cc, + type: 3} + propertyPath: m_PositionInput.m_Action.m_SingletonActionBindings.Array.size + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 556147534609547638, guid: 4b7b31e30b61762449b60c46c68c18cc, + type: 3} + propertyPath: m_RotationInput.m_Action.m_SingletonActionBindings.Array.size + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 556147534609547638, guid: 4b7b31e30b61762449b60c46c68c18cc, + type: 3} + propertyPath: m_PositionInput.m_Action.m_SingletonActionBindings.Array.data[0].m_Id + value: fd560ebc-a009-4051-82f9-93fd9cc2feca + objectReference: {fileID: 0} + - target: {fileID: 556147534609547638, guid: 4b7b31e30b61762449b60c46c68c18cc, + type: 3} + propertyPath: m_RotationInput.m_Action.m_SingletonActionBindings.Array.data[0].m_Id + value: 8b1aa2e1-ecc0-4f31-85b6-bd63b463cd08 + objectReference: {fileID: 0} + - target: {fileID: 556147534609547638, guid: 4b7b31e30b61762449b60c46c68c18cc, + type: 3} + propertyPath: m_PositionInput.m_Action.m_SingletonActionBindings.Array.data[0].m_Path + value: /centerEyePosition + objectReference: {fileID: 0} + - target: {fileID: 556147534609547638, guid: 4b7b31e30b61762449b60c46c68c18cc, + type: 3} + propertyPath: m_RotationInput.m_Action.m_SingletonActionBindings.Array.data[0].m_Path + value: /centerEyeRotation + objectReference: {fileID: 0} + - target: {fileID: 556147534609547638, guid: 4b7b31e30b61762449b60c46c68c18cc, + type: 3} + propertyPath: m_PositionInput.m_Action.m_SingletonActionBindings.Array.data[0].m_Action + value: Position Input + objectReference: {fileID: 0} + - target: {fileID: 556147534609547638, guid: 4b7b31e30b61762449b60c46c68c18cc, + type: 3} + propertyPath: m_RotationInput.m_Action.m_SingletonActionBindings.Array.data[0].m_Action + value: Rotation Input + objectReference: {fileID: 0} - target: {fileID: 2408004626713862601, guid: 4b7b31e30b61762449b60c46c68c18cc, type: 3} propertyPath: m_Name @@ -1488,6 +1588,11 @@ PrefabInstance: propertyPath: _desktopRig value: objectReference: {fileID: 6576317625673081306} + - target: {fileID: 2620892672312268187, guid: 4fb8466322a31c147ae36f4f903eaa55, + type: 3} + propertyPath: _magicLeapRig + value: + objectReference: {fileID: 4785960936823609616} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] @@ -1684,11 +1789,36 @@ PrefabInstance: propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 6420312414655734290, guid: ddab83da00e3fa94285c2bdfd7781aa8, + type: 3} + propertyPath: m_IsActive + value: 1 + objectReference: {fileID: 0} - target: {fileID: 6420312414655734294, guid: ddab83da00e3fa94285c2bdfd7781aa8, type: 3} propertyPath: m_Camera value: objectReference: {fileID: 69381326} + - target: {fileID: 6420312414655734294, guid: ddab83da00e3fa94285c2bdfd7781aa8, + type: 3} + propertyPath: m_Enabled + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6420312414772962358, guid: ddab83da00e3fa94285c2bdfd7781aa8, + type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6420312414772962358, guid: ddab83da00e3fa94285c2bdfd7781aa8, + type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6420312414772962358, guid: ddab83da00e3fa94285c2bdfd7781aa8, + type: 3} + propertyPath: m_SizeDelta.y + value: 0 + objectReference: {fileID: 0} m_RemovedComponents: [] m_RemovedGameObjects: [] m_AddedGameObjects: [] diff --git a/Assets/MagicLeap/PhotonFusionExample/Scripts/Editor/GenericAprilTagTrackingInstaller.cs b/Assets/MagicLeap/PhotonFusionExample/Scripts/Editor/GenericAprilTagTrackingInstaller.cs index 227a30b..70f1ffa 100644 --- a/Assets/MagicLeap/PhotonFusionExample/Scripts/Editor/GenericAprilTagTrackingInstaller.cs +++ b/Assets/MagicLeap/PhotonFusionExample/Scripts/Editor/GenericAprilTagTrackingInstaller.cs @@ -84,6 +84,8 @@ public static void InstallGenericAprilTagTracking() { System.IO.Compression.ZipFile.ExtractToDirectory(fullPathToZip, fullPathToDestination); AssetDatabase.Refresh(); + Client.Resolve(); + } } diff --git a/Assets/MagicLeap/PhotonFusionExample/Scripts/MarkerTracking/MarkerTrackingControls.cs b/Assets/MagicLeap/PhotonFusionExample/Scripts/MarkerTracking/MarkerTrackingControls.cs index 37ccea6..9d17eca 100644 --- a/Assets/MagicLeap/PhotonFusionExample/Scripts/MarkerTracking/MarkerTrackingControls.cs +++ b/Assets/MagicLeap/PhotonFusionExample/Scripts/MarkerTracking/MarkerTrackingControls.cs @@ -42,9 +42,9 @@ private void OnValidate() void Start() { - _markerTracker = BaseMarkerTrackerBehaviour.Instance; - OnFollowClicked(); + OnFollowClicked(); + StartCoroutine(FindMarker()); _instructionsPanel.gameObject.SetActive(true); _calibrationPanel.gameObject.SetActive(false); @@ -54,6 +54,19 @@ void Start() SubscribeToInput(); } + IEnumerator FindMarker() + { + _markerTracker = BaseMarkerTrackerBehaviour.Instance; + while (_markerTracker== null) + { + _markerTracker = BaseMarkerTrackerBehaviour.Instance; + Debug.LogWarning("Searching for marker tracker..."); + yield return null; + } + + Debug.LogWarning("marker tracker found."); + } + private void SubscribeToInput() { if (_desktopCalibrationAction.action != null) diff --git a/Assets/MagicLeap/PhotonFusionExample/Scripts/PhotonFusion/ConnectionManager.cs b/Assets/MagicLeap/PhotonFusionExample/Scripts/PhotonFusion/ConnectionManager.cs index c72aab7..5ea5c65 100644 --- a/Assets/MagicLeap/PhotonFusionExample/Scripts/PhotonFusion/ConnectionManager.cs +++ b/Assets/MagicLeap/PhotonFusionExample/Scripts/PhotonFusion/ConnectionManager.cs @@ -30,7 +30,9 @@ public class ConnectionManager : MonoBehaviour, INetworkRunnerCallbacks public string roomName = "SampleFusion-MagicLeap2"; public bool connectOnStart; - + public Action ConnectionFailed; + public Action DisconnectedFromServer; + public Action ConnectedToServer; [Header("Fusion settings")] [Tooltip("Fusion runner. Automatically created if not set")] public NetworkRunner runner; @@ -114,10 +116,21 @@ public void OnPlayerJoined(NetworkRunner playerRunner, PlayerRef player) public void OnPlayerLeft(NetworkRunner runner, PlayerRef player) { } - public void OnConnectedToServer(NetworkRunner runner) { } + public void OnConnectedToServer(NetworkRunner runner) + { + ConnectedToServer?.Invoke(); + } public void OnShutdown(NetworkRunner runner, ShutdownReason shutdownReason) { } - public void OnDisconnectedFromServer(NetworkRunner runner) { } - public void OnConnectFailed(NetworkRunner runner, NetAddress remoteAddress, NetConnectFailedReason reason) { } + + public void OnDisconnectedFromServer(NetworkRunner runner) + { + DisconnectedFromServer?.Invoke(); + } + + public void OnConnectFailed(NetworkRunner runner, NetAddress remoteAddress, NetConnectFailedReason reason) + { + ConnectionFailed?.Invoke($"Connection Failed: {reason}"); + } public void OnInput(NetworkRunner runner, NetworkInput input) { } public void OnInputMissing(NetworkRunner runner, PlayerRef player, NetworkInput input) { } public void OnConnectRequest(NetworkRunner runner, NetworkRunnerCallbackArgs.ConnectRequest request, byte[] token) { } diff --git a/Assets/MagicLeap/PhotonFusionExample/URP/ML2-UniversalRenderPipeline.asset b/Assets/MagicLeap/PhotonFusionExample/URP/ML2-UniversalRenderPipeline.asset index e891ca0..a43b269 100644 --- a/Assets/MagicLeap/PhotonFusionExample/URP/ML2-UniversalRenderPipeline.asset +++ b/Assets/MagicLeap/PhotonFusionExample/URP/ML2-UniversalRenderPipeline.asset @@ -34,6 +34,7 @@ MonoBehaviour: m_FsrSharpness: 0.92 m_EnableLODCrossFade: 1 m_LODCrossFadeDitheringType: 1 + m_ShEvalMode: 0 m_MainLightRenderingMode: 1 m_MainLightShadowsSupported: 1 m_MainLightShadowmapResolution: 2048 @@ -58,6 +59,7 @@ MonoBehaviour: m_SoftShadowsSupported: 0 m_ConservativeEnclosingSphere: 0 m_NumIterationsEnclosingSphere: 64 + m_SoftShadowQuality: 2 m_AdditionalLightsCookieResolution: 2048 m_AdditionalLightsCookieFormat: 3 m_UseSRPBatcher: 1 @@ -81,5 +83,29 @@ MonoBehaviour: m_Textures: blueNoise64LTex: {fileID: 2800000, guid: e3d24661c1e055f45a7560c033dbb837, type: 3} bayerMatrixTex: {fileID: 2800000, guid: f9ee4ed84c1d10c49aabb9b210b0fc44, type: 3} + m_PrefilteringModeMainLightShadows: 3 + m_PrefilteringModeAdditionalLight: 4 + m_PrefilteringModeAdditionalLightShadows: 2 + m_PrefilterXRKeywords: 0 + m_PrefilteringModeForwardPlus: 0 + m_PrefilteringModeDeferredRendering: 0 + m_PrefilteringModeScreenSpaceOcclusion: 0 + m_PrefilterDebugKeywords: 1 + m_PrefilterWriteRenderingLayers: 1 + m_PrefilterHDROutput: 1 + m_PrefilterSSAODepthNormals: 1 + m_PrefilterSSAOSourceDepthLow: 1 + m_PrefilterSSAOSourceDepthMedium: 1 + m_PrefilterSSAOSourceDepthHigh: 1 + m_PrefilterSSAOInterleaved: 1 + m_PrefilterSSAOBlueNoise: 1 + m_PrefilterSSAOSampleCountLow: 1 + m_PrefilterSSAOSampleCountMedium: 1 + m_PrefilterSSAOSampleCountHigh: 1 + m_PrefilterDBufferMRT1: 1 + m_PrefilterDBufferMRT2: 1 + m_PrefilterDBufferMRT3: 1 + m_PrefilterScreenCoord: 1 + m_PrefilterNativeRenderPass: 1 m_ShaderVariantLogLevel: 0 m_ShadowCascades: 0 diff --git a/Assets/MagicLeap/PhotonFusionExample/Webcam/Scripts/ImageSource.cs b/Assets/MagicLeap/PhotonFusionExample/Webcam/Scripts/ImageSource.cs index cb03a2e..4d16fe8 100644 --- a/Assets/MagicLeap/PhotonFusionExample/Webcam/Scripts/ImageSource.cs +++ b/Assets/MagicLeap/PhotonFusionExample/Webcam/Scripts/ImageSource.cs @@ -112,14 +112,21 @@ void Start() // Webcam source type: // Create a WebCamTexture and start capturing. _webcam = new WebCamTexture(_webcamName, _webcamResolution.x, _webcamResolution.y, _webcamFrameRate); - + if (_webcam == null) + { + Debug.LogError("Failed to connect to camera."); + } } public void StartCamera() { - + if (_webcam == null) + { + Debug.LogError("Camera is not connected so it cannot be started."); + return; + } _webcam.Play(); _rotateMaterial.SetFloat("_RotationDegrees", -_webcam.videoRotationAngle); @@ -140,6 +147,11 @@ public void StartCamera() public void StopCamera() { + if (!_running) + { + Debug.LogError("Camera is not running so it cannot be stopped."); + return; + } _webcam.Stop(); _running = false;