From 5c291643be5ee8d7f7302c39ee21a0f01e3d02b8 Mon Sep 17 00:00:00 2001 From: Adam Jonsson Date: Wed, 17 Nov 2021 09:42:33 +0100 Subject: [PATCH 1/5] feat: Add cross platform camera --- Assets/Managers/ARSession.meta | 8 + Assets/Managers/ARSession/AR Session.prefab | 62 +++ .../ARSession/AR Session.prefab.meta} | 2 +- .../CompatibilityChecker.meta | 0 .../Compatibility Checker.prefab} | 15 +- .../Compatibility Checker.prefab.meta} | 0 .../CompatibilityChecker.cs | 31 +- .../CompatibilityChecker.cs.meta | 0 Assets/Managers/SetupManager.meta | 8 + .../SetupManager/Setup Manager.prefab | 50 ++ .../SetupManager/Setup Manager.prefab.meta | 7 + Assets/Managers/SetupManager/SetupManager.cs | 72 +++ .../SetupManager/SetupManager.cs.meta | 11 + .../AR Session Origin.prefab | 246 ---------- ...ra.prefab => Cross Platform Camera.prefab} | 22 +- ...meta => Cross Platform Camera.prefab.meta} | 0 .../CrossPlatformCamera.cs | 44 ++ .../CrossPlatformCamera.cs.meta | 11 + Assets/Scenes/SampleScene.unity | 431 ++++++------------ .../Scripts/LevelPlacementController.cs | 6 +- Assets/XR/XRGeneralSettings.asset | 2 +- .../StaticLibraries/lib_burst_generated64.txt | 8 +- 22 files changed, 495 insertions(+), 541 deletions(-) create mode 100644 Assets/Managers/ARSession.meta create mode 100644 Assets/Managers/ARSession/AR Session.prefab rename Assets/{Prefabs/CrossPlatformCamera/AR Session Origin.prefab.meta => Managers/ARSession/AR Session.prefab.meta} (74%) rename Assets/{Prefabs => Managers}/CompatibilityChecker.meta (100%) rename Assets/{Prefabs/CompatibilityChecker/CompatibilityChecker.prefab => Managers/CompatibilityChecker/Compatibility Checker.prefab} (66%) rename Assets/{Prefabs/CompatibilityChecker/CompatibilityChecker.prefab.meta => Managers/CompatibilityChecker/Compatibility Checker.prefab.meta} (100%) rename Assets/{Prefabs => Managers}/CompatibilityChecker/CompatibilityChecker.cs (56%) rename Assets/{Prefabs => Managers}/CompatibilityChecker/CompatibilityChecker.cs.meta (100%) create mode 100644 Assets/Managers/SetupManager.meta create mode 100644 Assets/Managers/SetupManager/Setup Manager.prefab create mode 100644 Assets/Managers/SetupManager/Setup Manager.prefab.meta create mode 100644 Assets/Managers/SetupManager/SetupManager.cs create mode 100644 Assets/Managers/SetupManager/SetupManager.cs.meta delete mode 100644 Assets/Prefabs/CrossPlatformCamera/AR Session Origin.prefab rename Assets/Prefabs/CrossPlatformCamera/{CrossPlatformCamera.prefab => Cross Platform Camera.prefab} (94%) rename Assets/Prefabs/CrossPlatformCamera/{CrossPlatformCamera.prefab.meta => Cross Platform Camera.prefab.meta} (100%) create mode 100644 Assets/Prefabs/CrossPlatformCamera/CrossPlatformCamera.cs create mode 100644 Assets/Prefabs/CrossPlatformCamera/CrossPlatformCamera.cs.meta diff --git a/Assets/Managers/ARSession.meta b/Assets/Managers/ARSession.meta new file mode 100644 index 0000000..8bce9d6 --- /dev/null +++ b/Assets/Managers/ARSession.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 31eea0e50cea04234b945b154fe62e81 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Managers/ARSession/AR Session.prefab b/Assets/Managers/ARSession/AR Session.prefab new file mode 100644 index 0000000..15f6d70 --- /dev/null +++ b/Assets/Managers/ARSession/AR Session.prefab @@ -0,0 +1,62 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &6800535302357286287 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7223179368835717418} + - component: {fileID: 8108863857534307628} + - component: {fileID: 5474733860047409772} + m_Layer: 0 + m_Name: AR Session + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7223179368835717418 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6800535302357286287} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &8108863857534307628 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6800535302357286287} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3859a92a05d4f5d418cb6ca605290e74, type: 3} + m_Name: + m_EditorClassIdentifier: + m_AttemptUpdate: 1 + m_MatchFrameRate: 1 + m_TrackingMode: 2 +--- !u!114 &5474733860047409772 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6800535302357286287} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fa850fbd5b8aded44846f96e35f1a9f5, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Assets/Prefabs/CrossPlatformCamera/AR Session Origin.prefab.meta b/Assets/Managers/ARSession/AR Session.prefab.meta similarity index 74% rename from Assets/Prefabs/CrossPlatformCamera/AR Session Origin.prefab.meta rename to Assets/Managers/ARSession/AR Session.prefab.meta index 033d8af..cfeeffb 100644 --- a/Assets/Prefabs/CrossPlatformCamera/AR Session Origin.prefab.meta +++ b/Assets/Managers/ARSession/AR Session.prefab.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 2a706e2c6c11f4039af094bf3f5da16f +guid: 2592879ecfaf245668181d397040a689 PrefabImporter: externalObjects: {} userData: diff --git a/Assets/Prefabs/CompatibilityChecker.meta b/Assets/Managers/CompatibilityChecker.meta similarity index 100% rename from Assets/Prefabs/CompatibilityChecker.meta rename to Assets/Managers/CompatibilityChecker.meta diff --git a/Assets/Prefabs/CompatibilityChecker/CompatibilityChecker.prefab b/Assets/Managers/CompatibilityChecker/Compatibility Checker.prefab similarity index 66% rename from Assets/Prefabs/CompatibilityChecker/CompatibilityChecker.prefab rename to Assets/Managers/CompatibilityChecker/Compatibility Checker.prefab index 8ff7dcd..a9d967f 100644 --- a/Assets/Prefabs/CompatibilityChecker/CompatibilityChecker.prefab +++ b/Assets/Managers/CompatibilityChecker/Compatibility Checker.prefab @@ -9,8 +9,9 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 9061636952727761179} + - component: {fileID: 88678719283795960} m_Layer: 0 - m_Name: CompatibilityChecker + m_Name: Compatibility Checker m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -31,3 +32,15 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &88678719283795960 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6226634792145431312} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 47d0980116f884e48b1dcab1883af74d, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Assets/Prefabs/CompatibilityChecker/CompatibilityChecker.prefab.meta b/Assets/Managers/CompatibilityChecker/Compatibility Checker.prefab.meta similarity index 100% rename from Assets/Prefabs/CompatibilityChecker/CompatibilityChecker.prefab.meta rename to Assets/Managers/CompatibilityChecker/Compatibility Checker.prefab.meta diff --git a/Assets/Prefabs/CompatibilityChecker/CompatibilityChecker.cs b/Assets/Managers/CompatibilityChecker/CompatibilityChecker.cs similarity index 56% rename from Assets/Prefabs/CompatibilityChecker/CompatibilityChecker.cs rename to Assets/Managers/CompatibilityChecker/CompatibilityChecker.cs index f1fddd2..8bf6727 100644 --- a/Assets/Prefabs/CompatibilityChecker/CompatibilityChecker.cs +++ b/Assets/Managers/CompatibilityChecker/CompatibilityChecker.cs @@ -1,6 +1,5 @@ using System; using System.Collections; -using System.Collections.Generic; using UnityEngine; using UnityEngine.XR.ARFoundation; @@ -21,26 +20,46 @@ public enum DeviceSupport void Start() { _arSession = FindObjectOfType(); - if (_arSession) + if (_arSession == null) { throw new ArgumentException("An ARSession needs to exist for the CompatibilityChecker"); } + + StartCoroutine(CheckSupportForCurrentDevice()); } - public IEnumerator CheckForARSupport(Action OnCheckCompleted) { + public IEnumerator CheckSupportForCurrentDevice() { + // AR if ((ARSession.state == ARSessionState.None) || (ARSession.state == ARSessionState.CheckingAvailability)) { yield return ARSession.CheckAvailability(); } - OnCheckCompleted(ARSession.state); + + // VR + // TODO + + if (ARSession.state == ARSessionState.Unsupported) + { + _supportedDevice = DeviceSupport.DESKTOP; + } + else + { + _supportedDevice = DeviceSupport.AR; + } + + _listeners.Invoke(_supportedDevice); } public static void AddListener(Action OnResult) { - if (_supportedDevice == CompatibilityChecker.DeviceSupport.UNKNOWN) - _listeners += OnResult; + if (_supportedDevice != CompatibilityChecker.DeviceSupport.UNKNOWN) + { + OnResult.Invoke(_supportedDevice); + return; + } + _listeners += OnResult; } } diff --git a/Assets/Prefabs/CompatibilityChecker/CompatibilityChecker.cs.meta b/Assets/Managers/CompatibilityChecker/CompatibilityChecker.cs.meta similarity index 100% rename from Assets/Prefabs/CompatibilityChecker/CompatibilityChecker.cs.meta rename to Assets/Managers/CompatibilityChecker/CompatibilityChecker.cs.meta diff --git a/Assets/Managers/SetupManager.meta b/Assets/Managers/SetupManager.meta new file mode 100644 index 0000000..c80678a --- /dev/null +++ b/Assets/Managers/SetupManager.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: faedabf57efdb40299904d485fffb77c +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Managers/SetupManager/Setup Manager.prefab b/Assets/Managers/SetupManager/Setup Manager.prefab new file mode 100644 index 0000000..4b6da48 --- /dev/null +++ b/Assets/Managers/SetupManager/Setup Manager.prefab @@ -0,0 +1,50 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &2915927645790500135 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 7723732056556814669} + - component: {fileID: 4140004007164923010} + m_Layer: 0 + m_Name: Setup Manager + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &7723732056556814669 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2915927645790500135} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -5.742432, y: -4.5651445, z: 5.1839447} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &4140004007164923010 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2915927645790500135} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: b9f2fee4a51594f7bbe18058f07a6298, type: 3} + m_Name: + m_EditorClassIdentifier: + _arSessionPrefab: {fileID: 6800535302357286287, guid: 2592879ecfaf245668181d397040a689, + type: 3} + _compatibilityCheckerPrefab: {fileID: 6226634792145431312, guid: bf9f823b685634a56aadd78dde3ecbc9, + type: 3} diff --git a/Assets/Managers/SetupManager/Setup Manager.prefab.meta b/Assets/Managers/SetupManager/Setup Manager.prefab.meta new file mode 100644 index 0000000..aaec8bd --- /dev/null +++ b/Assets/Managers/SetupManager/Setup Manager.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 565e6c6e650ad4d63b0a432e3a63b0bf +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Managers/SetupManager/SetupManager.cs b/Assets/Managers/SetupManager/SetupManager.cs new file mode 100644 index 0000000..61d73bd --- /dev/null +++ b/Assets/Managers/SetupManager/SetupManager.cs @@ -0,0 +1,72 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.XR.ARFoundation; + +public class SetupManager : MonoBehaviour +{ + private static bool SetupCompleted = false; + + [SerializeField] private GameObject _arSessionPrefab; + + [SerializeField] private GameObject _compatibilityCheckerPrefab; + + private CrossPlatformCamera _crossPlatformCamera; + + void Awake() + { + if (SetupCompleted) return; + this.SpawnManagers(); + } + + + // Start is called before the first frame update + void Start() + { + if (SetupCompleted) return; + CompatibilityChecker.AddListener(ManagerDeviceSupport); + SetupCompleted = true; + } + + private void ManagerDeviceSupport(CompatibilityChecker.DeviceSupport deviceSupport) + { + switch (deviceSupport) + { + case CompatibilityChecker.DeviceSupport.AR: + EnableARMode(); + return; + default: + EnableDesktopMode(); + return; + } + } + + private void SpawnManagers() + { + SpawnPersistantManagerOnce(_arSessionPrefab); + SpawnPersistantManagerOnce(_compatibilityCheckerPrefab); + } + + private void SpawnPersistantManagerOnce(GameObject prefab) + { + var spawnedObject = Instantiate(prefab, Vector3.zero, Quaternion.identity); + DontDestroyOnLoad(spawnedObject); + } + + private void EnableARMode() + { + Debug.Log("Device mode: AR"); + this.EnableARSessionScripts(); + } + + private void EnableARSessionScripts() + { + FindObjectOfType().enabled = true; + FindObjectOfType().enabled = true; + } + + private void EnableDesktopMode() + { + Debug.Log("Device mode: Desktop"); + } +} diff --git a/Assets/Managers/SetupManager/SetupManager.cs.meta b/Assets/Managers/SetupManager/SetupManager.cs.meta new file mode 100644 index 0000000..b4ce742 --- /dev/null +++ b/Assets/Managers/SetupManager/SetupManager.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: b9f2fee4a51594f7bbe18058f07a6298 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Prefabs/CrossPlatformCamera/AR Session Origin.prefab b/Assets/Prefabs/CrossPlatformCamera/AR Session Origin.prefab deleted file mode 100644 index 7c92f30..0000000 --- a/Assets/Prefabs/CrossPlatformCamera/AR Session Origin.prefab +++ /dev/null @@ -1,246 +0,0 @@ -%YAML 1.1 -%TAG !u! tag:unity3d.com,2011: ---- !u!1 &3234657353302209195 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 3234657353302209185} - - component: {fileID: 3234657353302209196} - - component: {fileID: 3234657353302209184} - - component: {fileID: 3234657353302209199} - - component: {fileID: 3234657353302209198} - - component: {fileID: 3234657353302209197} - m_Layer: 0 - m_Name: AR Camera - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &3234657353302209185 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3234657353302209195} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 3234657354381611103} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!20 &3234657353302209196 -Camera: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3234657353302209195} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 2 - m_BackGroundColor: {r: 0, g: 0, b: 0, a: 1} - m_projectionMatrixMode: 1 - m_GateFitMode: 2 - m_FOVAxisMode: 0 - m_SensorSize: {x: 36, y: 24} - m_LensShift: {x: 0, y: 0} - m_FocalLength: 50 - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: 0.1 - far clip plane: 20 - field of view: 60 - orthographic: 0 - orthographic size: 5 - m_Depth: 0 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 1 - m_AllowMSAA: 1 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 ---- !u!114 &3234657353302209184 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3234657353302209195} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 6e3c44306fb1e439a9f18b2212b8ab70, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &3234657353302209199 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3234657353302209195} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4966719baa26e4b0e8231a24d9bd491a, type: 3} - m_Name: - m_EditorClassIdentifier: - m_FocusMode: -1 - m_LightEstimationMode: -1 - m_AutoFocus: 1 - m_LightEstimation: 0 - m_FacingDirection: 1 ---- !u!114 &3234657353302209198 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3234657353302209195} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 816b289ef451e094f9ae174fb4cf8db0, type: 3} - m_Name: - m_EditorClassIdentifier: - m_UseCustomMaterial: 0 - m_CustomMaterial: {fileID: 0} ---- !u!114 &3234657353302209197 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3234657353302209195} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} - m_Name: - m_EditorClassIdentifier: - m_RenderShadows: 1 - m_RequiresDepthTextureOption: 2 - m_RequiresOpaqueTextureOption: 2 - m_CameraType: 0 - m_Cameras: [] - m_RendererIndex: -1 - m_VolumeLayerMask: - serializedVersion: 2 - m_Bits: 1 - m_VolumeTrigger: {fileID: 0} - m_VolumeFrameworkUpdateModeOption: 2 - m_RenderPostProcessing: 1 - m_Antialiasing: 0 - m_AntialiasingQuality: 2 - m_StopNaN: 0 - m_Dithering: 0 - m_ClearDepth: 1 - m_AllowXRRendering: 1 - m_RequiresDepthTexture: 0 - m_RequiresColorTexture: 0 - m_Version: 2 ---- !u!1 &3234657354381611101 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 3234657354381611103} - - component: {fileID: 3234657354381611102} - - component: {fileID: 8077184933563545882} - - component: {fileID: 1095940680096786136} - - component: {fileID: 1737858912338957105} - m_Layer: 0 - m_Name: AR Session Origin - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!4 &3234657354381611103 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3234657354381611101} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 10, y: 10, z: 10} - m_ConstrainProportionsScale: 0 - m_Children: - - {fileID: 3234657353302209185} - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &3234657354381611102 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3234657354381611101} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 520bb47c46cf8624fafb307b7d1b862a, type: 3} - m_Name: - m_EditorClassIdentifier: - m_Camera: {fileID: 3234657353302209196} ---- !u!114 &8077184933563545882 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3234657354381611101} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fa17d122634046b4a8e23048891fafc5, type: 3} - m_Name: - m_EditorClassIdentifier: - m_RaycastPrefab: {fileID: 0} ---- !u!114 &1095940680096786136 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3234657354381611101} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: ee907d3c96b514b6381ca22ae834a8bf, type: 3} - m_Name: - m_EditorClassIdentifier: - _arCamera: {fileID: 3234657353302209196} ---- !u!114 &1737858912338957105 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3234657354381611101} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 2ab3eaeb3e19e4f4598f2d085719a72e, type: 3} - m_Name: - m_EditorClassIdentifier: - _levelPositionManager: {fileID: 0} - _levelPlaceholderPrefab: {fileID: 0} diff --git a/Assets/Prefabs/CrossPlatformCamera/CrossPlatformCamera.prefab b/Assets/Prefabs/CrossPlatformCamera/Cross Platform Camera.prefab similarity index 94% rename from Assets/Prefabs/CrossPlatformCamera/CrossPlatformCamera.prefab rename to Assets/Prefabs/CrossPlatformCamera/Cross Platform Camera.prefab index 6bb63fd..435ae48 100644 --- a/Assets/Prefabs/CrossPlatformCamera/CrossPlatformCamera.prefab +++ b/Assets/Prefabs/CrossPlatformCamera/Cross Platform Camera.prefab @@ -361,8 +361,8 @@ Transform: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 4246324390340228444} m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 10.2913685, y: 8.350591, z: -11.210131} - m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 10, y: 10, z: 10} m_ConstrainProportionsScale: 0 m_Children: - {fileID: 7240241329547489259} @@ -391,8 +391,9 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 8157666076489325226} + - component: {fileID: 39860471092561190} m_Layer: 0 - m_Name: CrossPlatformCamera + m_Name: Cross Platform Camera m_TagString: Untagged m_Icon: {fileID: -5397416234189338067, guid: 0000000000000000d000000000000000, type: 0} m_NavMeshLayer: 0 @@ -416,6 +417,21 @@ Transform: m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &39860471092561190 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8157666076489325227} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3fa51ee2213824b069cb14ffa7a64019, type: 3} + m_Name: + m_EditorClassIdentifier: + _arContainer: {fileID: 8778032812811765415} + _vrContainer: {fileID: 554659373511638886} + _desktopContainer: {fileID: 3729540537599245260} --- !u!1 &8778032812811765415 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Prefabs/CrossPlatformCamera/CrossPlatformCamera.prefab.meta b/Assets/Prefabs/CrossPlatformCamera/Cross Platform Camera.prefab.meta similarity index 100% rename from Assets/Prefabs/CrossPlatformCamera/CrossPlatformCamera.prefab.meta rename to Assets/Prefabs/CrossPlatformCamera/Cross Platform Camera.prefab.meta diff --git a/Assets/Prefabs/CrossPlatformCamera/CrossPlatformCamera.cs b/Assets/Prefabs/CrossPlatformCamera/CrossPlatformCamera.cs new file mode 100644 index 0000000..9e5dd80 --- /dev/null +++ b/Assets/Prefabs/CrossPlatformCamera/CrossPlatformCamera.cs @@ -0,0 +1,44 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class CrossPlatformCamera : MonoBehaviour +{ + [SerializeField] private GameObject _arContainer; + [SerializeField] private GameObject _vrContainer; + [SerializeField] private GameObject _desktopContainer; + + // Start is called before the first frame update + void Start() + { + CompatibilityChecker.AddListener(EnableCorrectCamera); + } + + private void EnableCorrectCamera(CompatibilityChecker.DeviceSupport deviceSupport) + { + switch (deviceSupport) + { + case CompatibilityChecker.DeviceSupport.AR: + EnableARCamera(); + return; + default: + EnableDesktopCamera(); + return; + } + } + + public void EnableARCamera() + { + this._vrContainer.SetActive(false); + this._desktopContainer.SetActive(false); + this._arContainer.SetActive(true); + } + + public void EnableDesktopCamera() + { + this._vrContainer.SetActive(false); + this._arContainer.SetActive(false); + this._desktopContainer.SetActive(true); + } + +} diff --git a/Assets/Prefabs/CrossPlatformCamera/CrossPlatformCamera.cs.meta b/Assets/Prefabs/CrossPlatformCamera/CrossPlatformCamera.cs.meta new file mode 100644 index 0000000..1a0f63c --- /dev/null +++ b/Assets/Prefabs/CrossPlatformCamera/CrossPlatformCamera.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 3fa51ee2213824b069cb14ffa7a64019 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index d5ba12b..e4ba719 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -123,170 +123,6 @@ NavMeshSettings: debug: m_Flags: 0 m_NavMeshData: {fileID: 0} ---- !u!1 &330585543 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 330585546} - - component: {fileID: 330585545} - - component: {fileID: 330585544} - - component: {fileID: 330585547} - - component: {fileID: 330585550} - - component: {fileID: 330585549} - - component: {fileID: 330585548} - m_Layer: 0 - m_Name: Main Camera - m_TagString: MainCamera - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!81 &330585544 -AudioListener: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 330585543} - m_Enabled: 1 ---- !u!20 &330585545 -Camera: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 330585543} - m_Enabled: 1 - serializedVersion: 2 - m_ClearFlags: 1 - m_BackGroundColor: {r: 0.19215687, g: 0.3019608, b: 0.4745098, a: 0} - m_projectionMatrixMode: 1 - m_GateFitMode: 2 - m_FOVAxisMode: 0 - m_SensorSize: {x: 36, y: 24} - m_LensShift: {x: 0, y: 0} - m_FocalLength: 50 - m_NormalizedViewPortRect: - serializedVersion: 2 - x: 0 - y: 0 - width: 1 - height: 1 - near clip plane: 0.3 - far clip plane: 1000 - field of view: 60 - orthographic: 0 - orthographic size: 5 - m_Depth: -1 - m_CullingMask: - serializedVersion: 2 - m_Bits: 4294967295 - m_RenderingPath: -1 - m_TargetTexture: {fileID: 0} - m_TargetDisplay: 0 - m_TargetEye: 3 - m_HDR: 1 - m_AllowMSAA: 1 - m_AllowDynamicResolution: 0 - m_ForceIntoRT: 0 - m_OcclusionCulling: 1 - m_StereoConvergence: 10 - m_StereoSeparation: 0.022 ---- !u!4 &330585546 -Transform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 330585543} - m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 1, z: -10} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &330585547 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 330585543} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: a79441f348de89743a2939f4d699eac1, type: 3} - m_Name: - m_EditorClassIdentifier: - m_RenderShadows: 1 - m_RequiresDepthTextureOption: 2 - m_RequiresOpaqueTextureOption: 2 - m_CameraType: 0 - m_Cameras: [] - m_RendererIndex: -1 - m_VolumeLayerMask: - serializedVersion: 2 - m_Bits: 1 - m_VolumeTrigger: {fileID: 0} - m_VolumeFrameworkUpdateModeOption: 2 - m_RenderPostProcessing: 1 - m_Antialiasing: 0 - m_AntialiasingQuality: 2 - m_StopNaN: 0 - m_Dithering: 0 - m_ClearDepth: 1 - m_AllowXRRendering: 1 - m_RequiresDepthTexture: 0 - m_RequiresColorTexture: 0 - m_Version: 2 ---- !u!114 &330585548 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 330585543} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 816b289ef451e094f9ae174fb4cf8db0, type: 3} - m_Name: - m_EditorClassIdentifier: - m_UseCustomMaterial: 0 - m_CustomMaterial: {fileID: 0} ---- !u!114 &330585549 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 330585543} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 4966719baa26e4b0e8231a24d9bd491a, type: 3} - m_Name: - m_EditorClassIdentifier: - m_FocusMode: -1 - m_LightEstimationMode: -1 - m_AutoFocus: 1 - m_LightEstimation: 0 - m_FacingDirection: 1 ---- !u!114 &330585550 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 330585543} - m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 6e3c44306fb1e439a9f18b2212b8ab70, type: 3} - m_Name: - m_EditorClassIdentifier: --- !u!1 &410087039 GameObject: m_ObjectHideFlags: 0 @@ -380,7 +216,7 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 1 + m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} --- !u!114 &410087042 MonoBehaviour: @@ -449,78 +285,147 @@ Transform: m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 2 + m_RootOrder: 3 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1001 &1792023565 +--- !u!1001 &916699186 PrefabInstance: m_ObjectHideFlags: 0 serializedVersion: 2 m_Modification: m_TransformParent: {fileID: 0} m_Modifications: - - target: {fileID: 6226634792145431312, guid: bf9f823b685634a56aadd78dde3ecbc9, + - target: {fileID: 2915927645790500135, guid: 565e6c6e650ad4d63b0a432e3a63b0bf, type: 3} propertyPath: m_Name - value: CompatibilityChecker + value: Setup Manager + objectReference: {fileID: 0} + - target: {fileID: 7723732056556814669, guid: 565e6c6e650ad4d63b0a432e3a63b0bf, + type: 3} + propertyPath: m_RootOrder + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7723732056556814669, guid: 565e6c6e650ad4d63b0a432e3a63b0bf, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7723732056556814669, guid: 565e6c6e650ad4d63b0a432e3a63b0bf, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7723732056556814669, guid: 565e6c6e650ad4d63b0a432e3a63b0bf, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7723732056556814669, guid: 565e6c6e650ad4d63b0a432e3a63b0bf, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7723732056556814669, guid: 565e6c6e650ad4d63b0a432e3a63b0bf, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7723732056556814669, guid: 565e6c6e650ad4d63b0a432e3a63b0bf, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7723732056556814669, guid: 565e6c6e650ad4d63b0a432e3a63b0bf, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7723732056556814669, guid: 565e6c6e650ad4d63b0a432e3a63b0bf, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7723732056556814669, guid: 565e6c6e650ad4d63b0a432e3a63b0bf, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 objectReference: {fileID: 0} - - target: {fileID: 9061636952727761179, guid: bf9f823b685634a56aadd78dde3ecbc9, + - target: {fileID: 7723732056556814669, guid: 565e6c6e650ad4d63b0a432e3a63b0bf, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 565e6c6e650ad4d63b0a432e3a63b0bf, type: 3} +--- !u!1001 &1085519982 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, type: 3} propertyPath: m_RootOrder - value: 5 + value: 1 objectReference: {fileID: 0} - - target: {fileID: 9061636952727761179, guid: bf9f823b685634a56aadd78dde3ecbc9, + - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, type: 3} propertyPath: m_LocalPosition.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 9061636952727761179, guid: bf9f823b685634a56aadd78dde3ecbc9, + - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, type: 3} propertyPath: m_LocalPosition.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 9061636952727761179, guid: bf9f823b685634a56aadd78dde3ecbc9, + - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, type: 3} propertyPath: m_LocalPosition.z value: 0 objectReference: {fileID: 0} - - target: {fileID: 9061636952727761179, guid: bf9f823b685634a56aadd78dde3ecbc9, + - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, type: 3} propertyPath: m_LocalRotation.w value: 1 objectReference: {fileID: 0} - - target: {fileID: 9061636952727761179, guid: bf9f823b685634a56aadd78dde3ecbc9, + - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, type: 3} propertyPath: m_LocalRotation.x - value: -0 + value: 0 objectReference: {fileID: 0} - - target: {fileID: 9061636952727761179, guid: bf9f823b685634a56aadd78dde3ecbc9, + - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, type: 3} propertyPath: m_LocalRotation.y - value: -0 + value: 0 objectReference: {fileID: 0} - - target: {fileID: 9061636952727761179, guid: bf9f823b685634a56aadd78dde3ecbc9, + - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, type: 3} propertyPath: m_LocalRotation.z - value: -0 + value: 0 objectReference: {fileID: 0} - - target: {fileID: 9061636952727761179, guid: bf9f823b685634a56aadd78dde3ecbc9, + - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, type: 3} propertyPath: m_LocalEulerAnglesHint.x value: 0 objectReference: {fileID: 0} - - target: {fileID: 9061636952727761179, guid: bf9f823b685634a56aadd78dde3ecbc9, + - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, type: 3} propertyPath: m_LocalEulerAnglesHint.y value: 0 objectReference: {fileID: 0} - - target: {fileID: 9061636952727761179, guid: bf9f823b685634a56aadd78dde3ecbc9, + - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, type: 3} propertyPath: m_LocalEulerAnglesHint.z value: 0 objectReference: {fileID: 0} + - target: {fileID: 8157666076489325227, guid: 1c1a3c4ff73a840788562288bb78e71b, + type: 3} + propertyPath: m_Name + value: Cross Platform Camera + objectReference: {fileID: 0} m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: bf9f823b685634a56aadd78dde3ecbc9, type: 3} ---- !u!1 &1921848960 + m_SourcePrefab: {fileID: 100100000, guid: 1c1a3c4ff73a840788562288bb78e71b, type: 3} +--- !u!1 &2055821017 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -528,57 +433,94 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 1921848963} - - component: {fileID: 1921848962} - - component: {fileID: 1921848961} + - component: {fileID: 2055821021} + - component: {fileID: 2055821020} + - component: {fileID: 2055821019} + - component: {fileID: 2055821018} m_Layer: 0 - m_Name: AR Session + m_Name: Cube m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!114 &1921848961 -MonoBehaviour: +--- !u!65 &2055821018 +BoxCollider: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1921848960} + m_GameObject: {fileID: 2055821017} + m_Material: {fileID: 0} + m_IsTrigger: 0 m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: fa850fbd5b8aded44846f96e35f1a9f5, type: 3} - m_Name: - m_EditorClassIdentifier: ---- !u!114 &1921848962 -MonoBehaviour: + serializedVersion: 2 + m_Size: {x: 1, y: 1, z: 1} + m_Center: {x: 0, y: 0, z: 0} +--- !u!23 &2055821019 +MeshRenderer: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1921848960} + m_GameObject: {fileID: 2055821017} m_Enabled: 1 - m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 3859a92a05d4f5d418cb6ca605290e74, type: 3} - m_Name: - m_EditorClassIdentifier: - m_AttemptUpdate: 1 - m_MatchFrameRate: 1 - m_TrackingMode: 2 ---- !u!4 &1921848963 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &2055821020 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 2055821017} + m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &2055821021 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 1921848960} + m_GameObject: {fileID: 2055821017} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} - m_RootOrder: 3 + m_RootOrder: 5 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1001 &5807597000174049787 PrefabInstance: @@ -649,72 +591,3 @@ PrefabInstance: objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: 063ba62cdbe5943b7a4a2fe0186c9672, type: 3} ---- !u!1001 &8157666077041643179 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, - type: 3} - propertyPath: m_RootOrder - value: 6 - objectReference: {fileID: 0} - - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, - type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, - type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, - type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, - type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8157666076489325227, guid: 1c1a3c4ff73a840788562288bb78e71b, - type: 3} - propertyPath: m_Name - value: CrossPlatformCamera - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 1c1a3c4ff73a840788562288bb78e71b, type: 3} diff --git a/Assets/Shared/Scripts/LevelPlacementController.cs b/Assets/Shared/Scripts/LevelPlacementController.cs index c7a3976..ab82bc9 100644 --- a/Assets/Shared/Scripts/LevelPlacementController.cs +++ b/Assets/Shared/Scripts/LevelPlacementController.cs @@ -42,7 +42,7 @@ void Start() _levelPlaceholder.SetActive(false); _compatibilityChecker = FindObjectOfType(); - StartCoroutine(_compatibilityChecker.CheckForARSupport(this.PlaceLevelDesktop)); + CompatibilityChecker.AddListener(this.PlaceLevelDesktop); } void Update() @@ -76,9 +76,9 @@ private void PlaceLevel() } - private void PlaceLevelDesktop(ARSessionState arSessionState) + private void PlaceLevelDesktop(CompatibilityChecker.DeviceSupport deviceSupport) { - if (arSessionState != ARSessionState.Unsupported) return; + if (deviceSupport != CompatibilityChecker.DeviceSupport.DESKTOP) return; Debug.Log("Place level desktop"); _hasPlacedLevel = true; this._levelPositionManager.UpdateLevelSpawnPosition(new Pose()); diff --git a/Assets/XR/XRGeneralSettings.asset b/Assets/XR/XRGeneralSettings.asset index 83240ff..c110850 100644 --- a/Assets/XR/XRGeneralSettings.asset +++ b/Assets/XR/XRGeneralSettings.asset @@ -94,7 +94,7 @@ MonoBehaviour: m_Name: Standalone Settings m_EditorClassIdentifier: m_LoaderManagerInstance: {fileID: -5656781391423499857} - m_InitManagerOnStart: 1 + m_InitManagerOnStart: 0 --- !u!114 &5498958275016953305 MonoBehaviour: m_ObjectHideFlags: 0 diff --git a/IOSBuild_BurstDebugInformation_DoNotShip/StaticLibraries/lib_burst_generated64.txt b/IOSBuild_BurstDebugInformation_DoNotShip/StaticLibraries/lib_burst_generated64.txt index ba7a201..578cdf8 100644 --- a/IOSBuild_BurstDebugInformation_DoNotShip/StaticLibraries/lib_burst_generated64.txt +++ b/IOSBuild_BurstDebugInformation_DoNotShip/StaticLibraries/lib_burst_generated64.txt @@ -103,6 +103,11 @@ Library: lib_burst_generated64 --compilation-defines=ENABLE_IL2CPP --compilation-defines=NET_STANDARD_2_0 --compilation-defines=NET_STANDARD +--compilation-defines=DEVELOPMENT_BUILD +--compilation-defines=ENABLE_PROFILER +--compilation-defines=DEBUG +--compilation-defines=TRACE +--compilation-defines=UNITY_ASSERTIONS --compilation-defines=ENABLE_CUSTOM_RENDER_TEXTURE --compilation-defines=ENABLE_DIRECTOR --compilation-defines=ENABLE_LOCALIZATION @@ -134,6 +139,7 @@ Library: lib_burst_generated64 --compilation-defines=TIMELINE_FRAMEACCURATE --compilation-defines=UNITY_ANALYTICS --generate-link-xml=Temp/burst.link.xml +--debug=Full --generate-static-linkage-methods --output=/Users/adam/Repositories/Lightenize/Temp/StagingArea/StaticLibraries/lib_burst_generated64 --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/UnityEngine.UI.dll @@ -152,9 +158,9 @@ Library: lib_burst_generated64 --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.Timeline.dll --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.RenderPipeline.Universal.ShaderLibrary.dll --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.XR.Management.dll +--root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.RenderPipelines.Core.ShaderLibrary.dll --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/UnityEngine.SpatialTracking.dll ---root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.Subsystem.Registration.dll --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.RenderPipelines.Universal.Shaders.dll --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll From 84ee96629c22b2b23fe3a15cb9b5abb656fcd71f Mon Sep 17 00:00:00 2001 From: Adam Jonsson Date: Wed, 17 Nov 2021 16:00:37 +0100 Subject: [PATCH 2/5] feat: Add level placement logic for AR --- .../LevelPlacementManager.meta} | 2 +- .../Level Placement Manager.prefab} | 20 +- .../Level Placement Manager.prefab.meta} | 2 +- .../LevelPlacementManager.cs | 89 ++ .../LevelPlacementManager.cs.meta} | 2 +- Assets/Managers/LevelPlacmentData.meta | 8 + .../Level Placement Data.prefab | 46 + .../Level Placement Data.prefab.meta | 7 + .../LevelPlacmentData/LevelPlacementData.cs | 18 + .../LevelPlacementData.cs.meta} | 2 +- .../SetupManager/Setup Manager.prefab | 2 + Assets/Managers/SetupManager/SetupManager.cs | 13 +- .../Cross Platform Camera.prefab | 30 + .../CrossPlatformCamera.cs | 17 +- .../LevelPositionManager.cs | 24 - Assets/Samples.meta | 8 + Assets/Samples/Input System.meta | 8 + Assets/Samples/Input System/1.1.1.meta | 8 + .../Input System/1.1.1/Touch Samples.meta | 8 + .../1.1.1/Touch Samples/.sample.json | 4 + .../1.1.1/Touch Samples/TouchSamples.asset | 19 + .../Touch Samples/TouchSamples.asset.meta | 8 + Assets/Scenes/LevelPlacementAR.unity | 886 ++++++++++++++++++ Assets/Scenes/LevelPlacementAR.unity.meta | 7 + Assets/Scenes/SampleScene.unity | 122 +-- Assets/Shared/Materials.meta | 8 + Assets/Shared/Materials/ARPlane.mat | 127 +++ Assets/Shared/Materials/ARPlane.mat.meta | 8 + Assets/Shared/Scripts/LevelContainer.cs | 21 + Assets/Shared/Scripts/LevelContainer.cs.meta | 11 + .../Scripts/LevelPlacementController.cs | 110 --- .../StaticLibraries/lib_burst_generated64.txt | 11 +- Packages/manifest.json | 1 + Packages/packages-lock.json | 9 + ProjectSettings/EditorBuildSettings.asset | 3 + ProjectSettings/ProjectSettings.asset | 1 + ProjectSettings/TagManager.asset | 3 +- 37 files changed, 1447 insertions(+), 226 deletions(-) rename Assets/{Prefabs/LevelPositionManager.meta => Managers/LevelPlacementManager.meta} (77%) rename Assets/{Prefabs/LevelPositionManager/LevelPositionManager.prefab => Managers/LevelPlacementManager/Level Placement Manager.prefab} (67%) rename Assets/{Prefabs/LevelPositionManager/LevelPositionManager.prefab.meta => Managers/LevelPlacementManager/Level Placement Manager.prefab.meta} (74%) create mode 100644 Assets/Managers/LevelPlacementManager/LevelPlacementManager.cs rename Assets/{Prefabs/LevelPositionManager/LevelPositionManager.cs.meta => Managers/LevelPlacementManager/LevelPlacementManager.cs.meta} (83%) create mode 100644 Assets/Managers/LevelPlacmentData.meta create mode 100644 Assets/Managers/LevelPlacmentData/Level Placement Data.prefab create mode 100644 Assets/Managers/LevelPlacmentData/Level Placement Data.prefab.meta create mode 100644 Assets/Managers/LevelPlacmentData/LevelPlacementData.cs rename Assets/{Shared/Scripts/LevelPlacementController.cs.meta => Managers/LevelPlacmentData/LevelPlacementData.cs.meta} (83%) delete mode 100644 Assets/Prefabs/LevelPositionManager/LevelPositionManager.cs create mode 100644 Assets/Samples.meta create mode 100644 Assets/Samples/Input System.meta create mode 100644 Assets/Samples/Input System/1.1.1.meta create mode 100644 Assets/Samples/Input System/1.1.1/Touch Samples.meta create mode 100644 Assets/Samples/Input System/1.1.1/Touch Samples/.sample.json create mode 100644 Assets/Samples/Input System/1.1.1/Touch Samples/TouchSamples.asset create mode 100644 Assets/Samples/Input System/1.1.1/Touch Samples/TouchSamples.asset.meta create mode 100644 Assets/Scenes/LevelPlacementAR.unity create mode 100644 Assets/Scenes/LevelPlacementAR.unity.meta create mode 100644 Assets/Shared/Materials.meta create mode 100644 Assets/Shared/Materials/ARPlane.mat create mode 100644 Assets/Shared/Materials/ARPlane.mat.meta create mode 100644 Assets/Shared/Scripts/LevelContainer.cs create mode 100644 Assets/Shared/Scripts/LevelContainer.cs.meta delete mode 100644 Assets/Shared/Scripts/LevelPlacementController.cs diff --git a/Assets/Prefabs/LevelPositionManager.meta b/Assets/Managers/LevelPlacementManager.meta similarity index 77% rename from Assets/Prefabs/LevelPositionManager.meta rename to Assets/Managers/LevelPlacementManager.meta index 49c5d9b..82bbfad 100644 --- a/Assets/Prefabs/LevelPositionManager.meta +++ b/Assets/Managers/LevelPlacementManager.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: b0d6835025d8a4c32bce8f0dc559bf98 +guid: c3e6d5b4029c74edeb132f890325fcbf folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Prefabs/LevelPositionManager/LevelPositionManager.prefab b/Assets/Managers/LevelPlacementManager/Level Placement Manager.prefab similarity index 67% rename from Assets/Prefabs/LevelPositionManager/LevelPositionManager.prefab rename to Assets/Managers/LevelPlacementManager/Level Placement Manager.prefab index 1e139f6..6dc2efa 100644 --- a/Assets/Prefabs/LevelPositionManager/LevelPositionManager.prefab +++ b/Assets/Managers/LevelPlacementManager/Level Placement Manager.prefab @@ -1,6 +1,6 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: ---- !u!1 &3624798292056245312 +--- !u!1 &1760304300311812898 GameObject: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -8,39 +8,39 @@ GameObject: m_PrefabAsset: {fileID: 0} serializedVersion: 6 m_Component: - - component: {fileID: 8109644083082424302} - - component: {fileID: 8133267252169484392} + - component: {fileID: 4719238613831707738} + - component: {fileID: -4828068412382251286} m_Layer: 0 - m_Name: LevelPositionManager + m_Name: Level Placement Manager m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 m_IsActive: 1 ---- !u!4 &8109644083082424302 +--- !u!4 &4719238613831707738 Transform: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3624798292056245312} + m_GameObject: {fileID: 1760304300311812898} m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: -6.0399113, y: -9.504788, z: 15.417434} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!114 &8133267252169484392 +--- !u!114 &-4828068412382251286 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3624798292056245312} + m_GameObject: {fileID: 1760304300311812898} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 05baa64f55a484af7924f141954d03ca, type: 3} + m_Script: {fileID: 11500000, guid: 6f79d4f192ccf4e8aba8e82bd0a46ef9, type: 3} m_Name: m_EditorClassIdentifier: diff --git a/Assets/Prefabs/LevelPositionManager/LevelPositionManager.prefab.meta b/Assets/Managers/LevelPlacementManager/Level Placement Manager.prefab.meta similarity index 74% rename from Assets/Prefabs/LevelPositionManager/LevelPositionManager.prefab.meta rename to Assets/Managers/LevelPlacementManager/Level Placement Manager.prefab.meta index e984c92..7bb7339 100644 --- a/Assets/Prefabs/LevelPositionManager/LevelPositionManager.prefab.meta +++ b/Assets/Managers/LevelPlacementManager/Level Placement Manager.prefab.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 063ba62cdbe5943b7a4a2fe0186c9672 +guid: fc3a533066e954e98bdd0627a9a66615 PrefabImporter: externalObjects: {} userData: diff --git a/Assets/Managers/LevelPlacementManager/LevelPlacementManager.cs b/Assets/Managers/LevelPlacementManager/LevelPlacementManager.cs new file mode 100644 index 0000000..d60724d --- /dev/null +++ b/Assets/Managers/LevelPlacementManager/LevelPlacementManager.cs @@ -0,0 +1,89 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.SceneManagement; +using UnityEngine.XR.ARFoundation; +using UnityEngine.XR.ARSubsystems; +using UnityEngine.InputSystem; + +public class LevelPlacementManager : MonoBehaviour +{ + [SerializeField] GameObject _levelPlaceholder; + + private ARRaycastManager _arRaycastManager; + + private List _raycastHits; + + private LevelPlacementData _levelPlacementData; + + private Camera _arCamera; + + private Pose _latestPlaneHit; + + // Start is called before the first frame update + void Start() + { + CompatibilityChecker.AddListener(delegate (CompatibilityChecker.DeviceSupport supportedDevice) { + if (supportedDevice != CompatibilityChecker.DeviceSupport.AR) { + Destroy(this.gameObject); + return; + } + + this._arRaycastManager = FindObjectOfType(); + this._arCamera = FindObjectOfType(); + this._levelPlacementData = FindObjectOfType(); + }); + } + + // Update is called once per frame + void Update() + { + if (!SetupManager.IsSetupCompleted) return; + this.LookForPlane(); + this.RenderLevelPlacementPlaceholder(); + this.CheckForUserInput(); + } + + private void LookForPlane() + { + Vector2 screenCenter = _arCamera.ViewportToScreenPoint(new Vector3(0.5f, 0.5f)); + var hits = new List(); + this._arRaycastManager.Raycast(screenCenter, hits, TrackableType.PlaneEstimated); + + if (hits.Count == 0) return; + Vector3 cameraForward = _arCamera.transform.forward; + Vector3 cameraBearing = new Vector3(cameraForward.x, 0, cameraForward.z); + Quaternion hitRotation = Quaternion.LookRotation(cameraBearing); + + this._latestPlaneHit = new Pose(hits[0].pose.position, hitRotation); + } + + private void RenderLevelPlacementPlaceholder() + { + if (this._latestPlaneHit == null) return; + _levelPlaceholder.transform.SetPositionAndRotation(this._latestPlaneHit.position, this._latestPlaneHit.rotation); + } + + private void CheckForUserInput() + { + if (this._latestPlaneHit == null) return; + bool tappingScreenOnceWithOneFinger = Touchscreen.current.IsPressed(0); + if (tappingScreenOnceWithOneFinger) + { + ChoosePositionAndRotationOfLevels(_latestPlaneHit); + } + } + + private void ChoosePositionAndRotationOfLevels(Pose pose) + { + _levelPlacementData.SetLevelPose(pose); + Debug.Log("Level Position Set"); + MoveToNextScene(); + } + + private void MoveToNextScene() + { + // TODO, create a level management system + SceneManager.LoadScene("SampleScene"); + } +} diff --git a/Assets/Prefabs/LevelPositionManager/LevelPositionManager.cs.meta b/Assets/Managers/LevelPlacementManager/LevelPlacementManager.cs.meta similarity index 83% rename from Assets/Prefabs/LevelPositionManager/LevelPositionManager.cs.meta rename to Assets/Managers/LevelPlacementManager/LevelPlacementManager.cs.meta index 5a74472..a0870ec 100644 --- a/Assets/Prefabs/LevelPositionManager/LevelPositionManager.cs.meta +++ b/Assets/Managers/LevelPlacementManager/LevelPlacementManager.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 05baa64f55a484af7924f141954d03ca +guid: 6f79d4f192ccf4e8aba8e82bd0a46ef9 MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Managers/LevelPlacmentData.meta b/Assets/Managers/LevelPlacmentData.meta new file mode 100644 index 0000000..73f9585 --- /dev/null +++ b/Assets/Managers/LevelPlacmentData.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 91c35d5ebdbba4dccbe1887467c3502d +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Managers/LevelPlacmentData/Level Placement Data.prefab b/Assets/Managers/LevelPlacmentData/Level Placement Data.prefab new file mode 100644 index 0000000..f0d4cce --- /dev/null +++ b/Assets/Managers/LevelPlacmentData/Level Placement Data.prefab @@ -0,0 +1,46 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!1 &4179574480081331153 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4664305778208492834} + - component: {fileID: 1261725758507793055} + m_Layer: 0 + m_Name: Level Placement Data + m_TagString: Untagged + m_Icon: {fileID: 3306451490063965843, guid: 0000000000000000d000000000000000, type: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &4664305778208492834 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4179574480081331153} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1261725758507793055 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4179574480081331153} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 2afa58682c2324d6192fba877a40520d, type: 3} + m_Name: + m_EditorClassIdentifier: diff --git a/Assets/Managers/LevelPlacmentData/Level Placement Data.prefab.meta b/Assets/Managers/LevelPlacmentData/Level Placement Data.prefab.meta new file mode 100644 index 0000000..bc9237c --- /dev/null +++ b/Assets/Managers/LevelPlacmentData/Level Placement Data.prefab.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 7378354008f2640238abd87f364424d2 +PrefabImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Managers/LevelPlacmentData/LevelPlacementData.cs b/Assets/Managers/LevelPlacmentData/LevelPlacementData.cs new file mode 100644 index 0000000..fe32b1f --- /dev/null +++ b/Assets/Managers/LevelPlacmentData/LevelPlacementData.cs @@ -0,0 +1,18 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class LevelPlacementData : MonoBehaviour +{ + private Pose _levelPose = new Pose(); + + public Pose LevelPose + { + get => _levelPose; + } + + public void SetLevelPose(Pose pose) + { + this._levelPose = pose; + } +} diff --git a/Assets/Shared/Scripts/LevelPlacementController.cs.meta b/Assets/Managers/LevelPlacmentData/LevelPlacementData.cs.meta similarity index 83% rename from Assets/Shared/Scripts/LevelPlacementController.cs.meta rename to Assets/Managers/LevelPlacmentData/LevelPlacementData.cs.meta index b2a2f78..4535087 100644 --- a/Assets/Shared/Scripts/LevelPlacementController.cs.meta +++ b/Assets/Managers/LevelPlacmentData/LevelPlacementData.cs.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 2ab3eaeb3e19e4f4598f2d085719a72e +guid: 2afa58682c2324d6192fba877a40520d MonoImporter: externalObjects: {} serializedVersion: 2 diff --git a/Assets/Managers/SetupManager/Setup Manager.prefab b/Assets/Managers/SetupManager/Setup Manager.prefab index 4b6da48..af8d3c2 100644 --- a/Assets/Managers/SetupManager/Setup Manager.prefab +++ b/Assets/Managers/SetupManager/Setup Manager.prefab @@ -48,3 +48,5 @@ MonoBehaviour: type: 3} _compatibilityCheckerPrefab: {fileID: 6226634792145431312, guid: bf9f823b685634a56aadd78dde3ecbc9, type: 3} + _levelPlacementDataPrefab: {fileID: 4179574480081331153, guid: 7378354008f2640238abd87f364424d2, + type: 3} diff --git a/Assets/Managers/SetupManager/SetupManager.cs b/Assets/Managers/SetupManager/SetupManager.cs index 61d73bd..226695b 100644 --- a/Assets/Managers/SetupManager/SetupManager.cs +++ b/Assets/Managers/SetupManager/SetupManager.cs @@ -1,15 +1,22 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; +using UnityEngine.SceneManagement; using UnityEngine.XR.ARFoundation; public class SetupManager : MonoBehaviour { private static bool SetupCompleted = false; + public static bool IsSetupCompleted + { + get => SetupCompleted; + } + [SerializeField] private GameObject _arSessionPrefab; [SerializeField] private GameObject _compatibilityCheckerPrefab; + [SerializeField] private GameObject _levelPlacementDataPrefab; private CrossPlatformCamera _crossPlatformCamera; @@ -25,7 +32,9 @@ void Start() { if (SetupCompleted) return; CompatibilityChecker.AddListener(ManagerDeviceSupport); - SetupCompleted = true; + CompatibilityChecker.AddListener(delegate (CompatibilityChecker.DeviceSupport supportedDevice) { + SetupCompleted = true; + }); } private void ManagerDeviceSupport(CompatibilityChecker.DeviceSupport deviceSupport) @@ -45,6 +54,7 @@ private void SpawnManagers() { SpawnPersistantManagerOnce(_arSessionPrefab); SpawnPersistantManagerOnce(_compatibilityCheckerPrefab); + SpawnPersistantManagerOnce(_levelPlacementDataPrefab); } private void SpawnPersistantManagerOnce(GameObject prefab) @@ -56,6 +66,7 @@ private void SpawnPersistantManagerOnce(GameObject prefab) private void EnableARMode() { Debug.Log("Device mode: AR"); + Screen.orientation = ScreenOrientation.LandscapeLeft; this.EnableARSessionScripts(); } diff --git a/Assets/Prefabs/CrossPlatformCamera/Cross Platform Camera.prefab b/Assets/Prefabs/CrossPlatformCamera/Cross Platform Camera.prefab index 435ae48..28ab6ac 100644 --- a/Assets/Prefabs/CrossPlatformCamera/Cross Platform Camera.prefab +++ b/Assets/Prefabs/CrossPlatformCamera/Cross Platform Camera.prefab @@ -346,6 +346,8 @@ GameObject: m_Component: - component: {fileID: 9147752777304813342} - component: {fileID: 8443179635172985928} + - component: {fileID: 6439132870008006910} + - component: {fileID: 87480407990898673} m_Layer: 0 m_Name: AR Session Origin m_TagString: Untagged @@ -382,6 +384,33 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Camera: {fileID: 1196194748485039263} +--- !u!114 &6439132870008006910 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4246324390340228444} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fa17d122634046b4a8e23048891fafc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_RaycastPrefab: {fileID: 0} +--- !u!114 &87480407990898673 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4246324390340228444} + m_Enabled: 0 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: e1760703bbd54c04488a8d10600262ab, type: 3} + m_Name: + m_EditorClassIdentifier: + m_PlanePrefab: {fileID: 0} + m_DetectionMode: -1 --- !u!1 &8157666076489325227 GameObject: m_ObjectHideFlags: 0 @@ -432,6 +461,7 @@ MonoBehaviour: _arContainer: {fileID: 8778032812811765415} _vrContainer: {fileID: 554659373511638886} _desktopContainer: {fileID: 3729540537599245260} + _arSessionOrigin: {fileID: 0} --- !u!1 &8778032812811765415 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Prefabs/CrossPlatformCamera/CrossPlatformCamera.cs b/Assets/Prefabs/CrossPlatformCamera/CrossPlatformCamera.cs index 9e5dd80..56aec04 100644 --- a/Assets/Prefabs/CrossPlatformCamera/CrossPlatformCamera.cs +++ b/Assets/Prefabs/CrossPlatformCamera/CrossPlatformCamera.cs @@ -1,19 +1,27 @@ using System.Collections; using System.Collections.Generic; using UnityEngine; +using UnityEngine.XR.ARFoundation; public class CrossPlatformCamera : MonoBehaviour { [SerializeField] private GameObject _arContainer; [SerializeField] private GameObject _vrContainer; [SerializeField] private GameObject _desktopContainer; - - // Start is called before the first frame update + + [Header("Augmented Reality")] + [SerializeField] private ARSessionOrigin _arSessionOrigin; + void Start() { CompatibilityChecker.AddListener(EnableCorrectCamera); } + void Update() + { + + } + private void EnableCorrectCamera(CompatibilityChecker.DeviceSupport deviceSupport) { switch (deviceSupport) @@ -41,4 +49,9 @@ public void EnableDesktopCamera() this._desktopContainer.SetActive(true); } + private void MakeOriginAppearAt(Pose levelPlacementPose) + { + _arSessionOrigin.MakeContentAppearAt(new GameObject().transform, levelPlacementPose.position, levelPlacementPose.rotation); + } + } diff --git a/Assets/Prefabs/LevelPositionManager/LevelPositionManager.cs b/Assets/Prefabs/LevelPositionManager/LevelPositionManager.cs deleted file mode 100644 index b395424..0000000 --- a/Assets/Prefabs/LevelPositionManager/LevelPositionManager.cs +++ /dev/null @@ -1,24 +0,0 @@ -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class LevelPositionManager : MonoBehaviour -{ - - private Pose _levelSpawnPosition = new Pose(); - - public Pose LevelSpawnPosition - { - get => _levelSpawnPosition; - } - - public void UpdateLevelSpawnPosition(Pose pose) - { - this._levelSpawnPosition = pose; - } - - void Start() { - DontDestroyOnLoad(this.gameObject); - } - -} diff --git a/Assets/Samples.meta b/Assets/Samples.meta new file mode 100644 index 0000000..079e109 --- /dev/null +++ b/Assets/Samples.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8c9b2462b0f9f4de690eb7a3d9c7cb7f +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/Input System.meta b/Assets/Samples/Input System.meta new file mode 100644 index 0000000..8773a7d --- /dev/null +++ b/Assets/Samples/Input System.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: bbfae258d1b6f4815b14a3231075cd43 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/Input System/1.1.1.meta b/Assets/Samples/Input System/1.1.1.meta new file mode 100644 index 0000000..03f9a1a --- /dev/null +++ b/Assets/Samples/Input System/1.1.1.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: c7e802d4537824b84b326f773dedc3b1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/Input System/1.1.1/Touch Samples.meta b/Assets/Samples/Input System/1.1.1/Touch Samples.meta new file mode 100644 index 0000000..aac9bed --- /dev/null +++ b/Assets/Samples/Input System/1.1.1/Touch Samples.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: f2938fcbb7130466592456bf7c49b7c8 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Samples/Input System/1.1.1/Touch Samples/.sample.json b/Assets/Samples/Input System/1.1.1/Touch Samples/.sample.json new file mode 100644 index 0000000..c09a114 --- /dev/null +++ b/Assets/Samples/Input System/1.1.1/Touch Samples/.sample.json @@ -0,0 +1,4 @@ +{ + "displayName": "Touch Samples", + "description": "A series of sample scenes for using touch input with the Input System package. This sample is not actually part of the package, but needs to be downloaded." +} diff --git a/Assets/Samples/Input System/1.1.1/Touch Samples/TouchSamples.asset b/Assets/Samples/Input System/1.1.1/Touch Samples/TouchSamples.asset new file mode 100644 index 0000000..af2a098 --- /dev/null +++ b/Assets/Samples/Input System/1.1.1/Touch Samples/TouchSamples.asset @@ -0,0 +1,19 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!114 &11400000 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9858d4c8055fd45539a2e86388f7c5ba, type: 3} + m_Name: TouchSamples + m_EditorClassIdentifier: + url: https://github.com/Unity-Technologies/InputSystem/releases/download/%VERSION%/TouchSamples-%VERSION%.unitypackage + packageDeps: + - com.unity.inputsystem + - com.unity.cinemachine + - com.unity.probuilder diff --git a/Assets/Samples/Input System/1.1.1/Touch Samples/TouchSamples.asset.meta b/Assets/Samples/Input System/1.1.1/Touch Samples/TouchSamples.asset.meta new file mode 100644 index 0000000..f671405 --- /dev/null +++ b/Assets/Samples/Input System/1.1.1/Touch Samples/TouchSamples.asset.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 9c6475617e9ca4013874288c8a78b210 +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 0 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/LevelPlacementAR.unity b/Assets/Scenes/LevelPlacementAR.unity new file mode 100644 index 0000000..b7e1108 --- /dev/null +++ b/Assets/Scenes/LevelPlacementAR.unity @@ -0,0 +1,886 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!29 &1 +OcclusionCullingSettings: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_OcclusionBakeSettings: + smallestOccluder: 5 + smallestHole: 0.25 + backfaceThreshold: 100 + m_SceneGUID: 00000000000000000000000000000000 + m_OcclusionCullingData: {fileID: 0} +--- !u!104 &2 +RenderSettings: + m_ObjectHideFlags: 0 + serializedVersion: 9 + m_Fog: 0 + m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1} + m_FogMode: 3 + m_FogDensity: 0.01 + m_LinearFogStart: 0 + m_LinearFogEnd: 300 + m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1} + m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1} + m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} + m_AmbientIntensity: 1 + m_AmbientMode: 0 + m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1} + m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0} + m_HaloStrength: 0.5 + m_FlareStrength: 1 + m_FlareFadeSpeed: 3 + m_HaloTexture: {fileID: 0} + m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0} + m_DefaultReflectionMode: 0 + m_DefaultReflectionResolution: 128 + m_ReflectionBounces: 1 + m_ReflectionIntensity: 1 + m_CustomReflection: {fileID: 0} + m_Sun: {fileID: 0} + m_IndirectSpecularColor: {r: 0.18028305, g: 0.22571313, b: 0.3069213, a: 1} + m_UseRadianceAmbientProbe: 0 +--- !u!157 &3 +LightmapSettings: + m_ObjectHideFlags: 0 + serializedVersion: 12 + m_GIWorkflowMode: 1 + m_GISettings: + serializedVersion: 2 + m_BounceScale: 1 + m_IndirectOutputScale: 1 + m_AlbedoBoost: 1 + m_EnvironmentLightingMode: 0 + m_EnableBakedLightmaps: 1 + m_EnableRealtimeLightmaps: 0 + m_LightmapEditorSettings: + serializedVersion: 12 + m_Resolution: 2 + m_BakeResolution: 40 + m_AtlasSize: 1024 + m_AO: 0 + m_AOMaxDistance: 1 + m_CompAOExponent: 1 + m_CompAOExponentDirect: 0 + m_ExtractAmbientOcclusion: 0 + m_Padding: 2 + m_LightmapParameters: {fileID: 0} + m_LightmapsBakeMode: 1 + m_TextureCompression: 1 + m_FinalGather: 0 + m_FinalGatherFiltering: 1 + m_FinalGatherRayCount: 256 + m_ReflectionCompression: 2 + m_MixedBakeMode: 2 + m_BakeBackend: 1 + m_PVRSampling: 1 + m_PVRDirectSampleCount: 32 + m_PVRSampleCount: 512 + m_PVRBounces: 2 + m_PVREnvironmentSampleCount: 256 + m_PVREnvironmentReferencePointCount: 2048 + m_PVRFilteringMode: 1 + m_PVRDenoiserTypeDirect: 1 + m_PVRDenoiserTypeIndirect: 1 + m_PVRDenoiserTypeAO: 1 + m_PVRFilterTypeDirect: 0 + m_PVRFilterTypeIndirect: 0 + m_PVRFilterTypeAO: 0 + m_PVREnvironmentMIS: 1 + m_PVRCulling: 1 + m_PVRFilteringGaussRadiusDirect: 1 + m_PVRFilteringGaussRadiusIndirect: 5 + m_PVRFilteringGaussRadiusAO: 2 + m_PVRFilteringAtrousPositionSigmaDirect: 0.5 + m_PVRFilteringAtrousPositionSigmaIndirect: 2 + m_PVRFilteringAtrousPositionSigmaAO: 1 + m_ExportTrainingData: 0 + m_TrainingDataDestination: TrainingData + m_LightProbeSampleCountMultiplier: 4 + m_LightingDataAsset: {fileID: 0} + m_LightingSettings: {fileID: 0} +--- !u!196 &4 +NavMeshSettings: + serializedVersion: 2 + m_ObjectHideFlags: 0 + m_BuildSettings: + serializedVersion: 2 + agentTypeID: 0 + agentRadius: 0.5 + agentHeight: 2 + agentSlope: 45 + agentClimb: 0.4 + ledgeDropHeight: 0 + maxJumpAcrossDistance: 0 + minRegionArea: 2 + manualCellSize: 0 + cellSize: 0.16666667 + manualTileSize: 0 + tileSize: 256 + accuratePlacement: 0 + maxJobWorkers: 0 + preserveTilesOutsideBounds: 0 + debug: + m_Flags: 0 + m_NavMeshData: {fileID: 0} +--- !u!1 &410087039 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 410087041} + - component: {fileID: 410087040} + - component: {fileID: 410087042} + m_Layer: 0 + m_Name: Directional Light + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!108 &410087040 +Light: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 410087039} + m_Enabled: 1 + serializedVersion: 10 + m_Type: 1 + m_Shape: 0 + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_Intensity: 2 + m_Range: 10 + m_SpotAngle: 30 + m_InnerSpotAngle: 21.80208 + m_CookieSize: 10 + m_Shadows: + m_Type: 2 + m_Resolution: -1 + m_CustomResolution: -1 + m_Strength: 1 + m_Bias: 0.05 + m_NormalBias: 0.4 + m_NearPlane: 0.2 + m_CullingMatrixOverride: + e00: 1 + e01: 0 + e02: 0 + e03: 0 + e10: 0 + e11: 1 + e12: 0 + e13: 0 + e20: 0 + e21: 0 + e22: 1 + e23: 0 + e30: 0 + e31: 0 + e32: 0 + e33: 1 + m_UseCullingMatrixOverride: 0 + m_Cookie: {fileID: 0} + m_DrawHalo: 0 + m_Flare: {fileID: 0} + m_RenderMode: 0 + m_CullingMask: + serializedVersion: 2 + m_Bits: 4294967295 + m_RenderingLayerMask: 1 + m_Lightmapping: 4 + m_LightShadowCasterMode: 0 + m_AreaSize: {x: 1, y: 1} + m_BounceIntensity: 1 + m_ColorTemperature: 5000 + m_UseColorTemperature: 1 + m_BoundingSphereOverride: {x: 0, y: 0, z: 0, w: 0} + m_UseBoundingSphereOverride: 0 + m_UseViewFrustumForShadowCasterCull: 1 + m_ShadowRadius: 0 + m_ShadowAngle: 0 +--- !u!4 &410087041 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 410087039} + m_LocalRotation: {x: 0.40821788, y: -0.23456968, z: 0.10938163, w: 0.8754261} + m_LocalPosition: {x: 0, y: 3, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 5 + m_LocalEulerAnglesHint: {x: 50, y: -30, z: 0} +--- !u!114 &410087042 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 410087039} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 474bcb49853aa07438625e644c072ee6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Version: 1 + m_UsePipelineSettings: 1 + m_AdditionalLightsShadowResolutionTier: 2 + m_LightLayerMask: 1 + m_CustomShadowLayers: 0 + m_ShadowLayerMask: 1 + m_LightCookieSize: {x: 1, y: 1} + m_LightCookieOffset: {x: 0, y: 0} +--- !u!1 &832575517 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 832575519} + - component: {fileID: 832575518} + m_Layer: 0 + m_Name: Global Volume + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!114 &832575518 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832575517} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 172515602e62fb746b5d573b38a5fe58, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IsGlobal: 1 + priority: 0 + blendDistance: 0 + weight: 1 + sharedProfile: {fileID: 11400000, guid: a6560a915ef98420e9faacc1c7438823, type: 2} +--- !u!4 &832575519 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 832575517} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &916699186 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 2915927645790500135, guid: 565e6c6e650ad4d63b0a432e3a63b0bf, + type: 3} + propertyPath: m_Name + value: Setup Manager + objectReference: {fileID: 0} + - target: {fileID: 7723732056556814669, guid: 565e6c6e650ad4d63b0a432e3a63b0bf, + type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7723732056556814669, guid: 565e6c6e650ad4d63b0a432e3a63b0bf, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7723732056556814669, guid: 565e6c6e650ad4d63b0a432e3a63b0bf, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7723732056556814669, guid: 565e6c6e650ad4d63b0a432e3a63b0bf, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7723732056556814669, guid: 565e6c6e650ad4d63b0a432e3a63b0bf, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 7723732056556814669, guid: 565e6c6e650ad4d63b0a432e3a63b0bf, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7723732056556814669, guid: 565e6c6e650ad4d63b0a432e3a63b0bf, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7723732056556814669, guid: 565e6c6e650ad4d63b0a432e3a63b0bf, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7723732056556814669, guid: 565e6c6e650ad4d63b0a432e3a63b0bf, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7723732056556814669, guid: 565e6c6e650ad4d63b0a432e3a63b0bf, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 7723732056556814669, guid: 565e6c6e650ad4d63b0a432e3a63b0bf, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 565e6c6e650ad4d63b0a432e3a63b0bf, type: 3} +--- !u!1001 &1085519982 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: 87480407990898673, guid: 1c1a3c4ff73a840788562288bb78e71b, + type: 3} + propertyPath: m_Enabled + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 87480407990898673, guid: 1c1a3c4ff73a840788562288bb78e71b, + type: 3} + propertyPath: m_PlanePrefab + value: + objectReference: {fileID: 1814517125} + - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, + type: 3} + propertyPath: m_RootOrder + value: 3 + objectReference: {fileID: 0} + - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8157666076489325226, guid: 1c1a3c4ff73a840788562288bb78e71b, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 8157666076489325227, guid: 1c1a3c4ff73a840788562288bb78e71b, + type: 3} + propertyPath: m_Icon + value: + objectReference: {fileID: 0} + - target: {fileID: 8157666076489325227, guid: 1c1a3c4ff73a840788562288bb78e71b, + type: 3} + propertyPath: m_Name + value: Cross Platform Camera + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: 1c1a3c4ff73a840788562288bb78e71b, type: 3} +--- !u!1 &1689156834 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1689156835} + - component: {fileID: 1689156836} + m_Layer: 0 + m_Name: Level Container + m_TagString: Level + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &1689156835 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1689156834} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &1689156836 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1689156834} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 569f89a1fed9e4ea08db007d70dceb24, type: 3} + m_Name: + m_EditorClassIdentifier: +--- !u!1 &1791053455 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1791053459} + - component: {fileID: 1791053458} + - component: {fileID: 1791053457} + - component: {fileID: 1791053456} + m_Layer: 0 + m_Name: Level Placement Placeholder + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!136 &1791053456 +CapsuleCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1791053455} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + m_Radius: 0.5000001 + m_Height: 2 + m_Direction: 1 + m_Center: {x: 0.000000059604645, y: 0, z: -0.00000008940697} +--- !u!23 &1791053457 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1791053455} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1791053458 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1791053455} + m_Mesh: {fileID: 10206, guid: 0000000000000000e000000000000000, type: 0} +--- !u!4 &1791053459 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1791053455} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0.1, z: 0} + m_LocalScale: {x: 1, y: 0.1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 7 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1 &1814517125 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1814517132} + - component: {fileID: 1814517131} + - component: {fileID: 1814517130} + - component: {fileID: 1814517129} + - component: {fileID: 1814517128} + - component: {fileID: 1814517127} + - component: {fileID: 1814517126} + m_Layer: 0 + m_Name: AR Default Plane + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!120 &1814517126 +LineRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1814517125} + m_Enabled: 1 + m_CastShadows: 0 + m_ReceiveShadows: 0 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 0 + m_LightProbeUsage: 0 + m_ReflectionProbeUsage: 0 + m_RayTracingMode: 0 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 10306, guid: 0000000000000000f000000000000000, type: 0} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_Positions: + - {x: 0, y: 0, z: 0} + - {x: 0, y: 0, z: 1} + m_Parameters: + serializedVersion: 3 + widthMultiplier: 1 + widthCurve: + serializedVersion: 2 + m_Curve: + - serializedVersion: 3 + time: 0 + value: 0.005 + inSlope: 0 + outSlope: 0 + tangentMode: 0 + weightedMode: 0 + inWeight: 0.33333334 + outWeight: 0.33333334 + m_PreInfinity: 2 + m_PostInfinity: 2 + m_RotationOrder: 4 + colorGradient: + serializedVersion: 2 + key0: {r: 0, g: 0, b: 0, a: 0.39215687} + key1: {r: 0, g: 0, b: 0, a: 0.39215687} + key2: {r: 0, g: 0, b: 0, a: 0} + key3: {r: 0, g: 0, b: 0, a: 0} + key4: {r: 0, g: 0, b: 0, a: 0} + key5: {r: 0, g: 0, b: 0, a: 0} + key6: {r: 0, g: 0, b: 0, a: 0} + key7: {r: 0, g: 0, b: 0, a: 0} + ctime0: 0 + ctime1: 65535 + ctime2: 0 + ctime3: 0 + ctime4: 0 + ctime5: 0 + ctime6: 0 + ctime7: 0 + atime0: 0 + atime1: 65535 + atime2: 0 + atime3: 0 + atime4: 0 + atime5: 0 + atime6: 0 + atime7: 0 + m_Mode: 0 + m_NumColorKeys: 2 + m_NumAlphaKeys: 2 + numCornerVertices: 4 + numCapVertices: 4 + alignment: 0 + textureMode: 0 + shadowBias: 0.5 + generateLightingData: 0 + m_UseWorldSpace: 0 + m_Loop: 1 +--- !u!23 &1814517127 +MeshRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1814517125} + m_Enabled: 1 + m_CastShadows: 1 + m_ReceiveShadows: 1 + m_DynamicOccludee: 1 + m_StaticShadowCaster: 0 + m_MotionVectors: 1 + m_LightProbeUsage: 1 + m_ReflectionProbeUsage: 1 + m_RayTracingMode: 2 + m_RayTraceProcedural: 0 + m_RenderingLayerMask: 1 + m_RendererPriority: 0 + m_Materials: + - {fileID: 2100000, guid: 1d92fdea1df194cf6b68014604c13bbd, type: 2} + m_StaticBatchInfo: + firstSubMesh: 0 + subMeshCount: 0 + m_StaticBatchRoot: {fileID: 0} + m_ProbeAnchor: {fileID: 0} + m_LightProbeVolumeOverride: {fileID: 0} + m_ScaleInLightmap: 1 + m_ReceiveGI: 1 + m_PreserveUVs: 0 + m_IgnoreNormalsForChartDetection: 0 + m_ImportantGI: 0 + m_StitchLightmapSeams: 1 + m_SelectedEditorRenderState: 3 + m_MinimumChartSize: 4 + m_AutoUVMaxDistance: 0.5 + m_AutoUVMaxAngle: 89 + m_LightmapParameters: {fileID: 0} + m_SortingLayerID: 0 + m_SortingLayer: 0 + m_SortingOrder: 0 + m_AdditionalVertexStreams: {fileID: 0} +--- !u!33 &1814517128 +MeshFilter: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1814517125} + m_Mesh: {fileID: 0} +--- !u!64 &1814517129 +MeshCollider: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1814517125} + m_Material: {fileID: 0} + m_IsTrigger: 0 + m_Enabled: 1 + serializedVersion: 4 + m_Convex: 0 + m_CookingOptions: 30 + m_Mesh: {fileID: 0} +--- !u!114 &1814517130 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1814517125} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3d180956a54db4646a1c6342921672ad, type: 3} + m_Name: + m_EditorClassIdentifier: + m_TrackingStateVisibilityThreshold: 1 + m_HideSubsumed: 1 +--- !u!114 &1814517131 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1814517125} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 5f66da7470dce8f4d821d71dd2b1d4ac, type: 3} + m_Name: + m_EditorClassIdentifier: + m_DestroyOnRemoval: 1 + m_VertexChangedThreshold: 0.01 +--- !u!4 &1814517132 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1814517125} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 0} + m_RootOrder: 6 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!1001 &8218435926485798667 +PrefabInstance: + m_ObjectHideFlags: 0 + serializedVersion: 2 + m_Modification: + m_TransformParent: {fileID: 0} + m_Modifications: + - target: {fileID: -4828068412382251286, guid: fc3a533066e954e98bdd0627a9a66615, + type: 3} + propertyPath: _levelPlaceholder + value: + objectReference: {fileID: 1791053455} + - target: {fileID: 1760304300311812898, guid: fc3a533066e954e98bdd0627a9a66615, + type: 3} + propertyPath: m_Name + value: Level Placement Manager + objectReference: {fileID: 0} + - target: {fileID: 4719238613831707738, guid: fc3a533066e954e98bdd0627a9a66615, + type: 3} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} + - target: {fileID: 4719238613831707738, guid: fc3a533066e954e98bdd0627a9a66615, + type: 3} + propertyPath: m_LocalPosition.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4719238613831707738, guid: fc3a533066e954e98bdd0627a9a66615, + type: 3} + propertyPath: m_LocalPosition.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4719238613831707738, guid: fc3a533066e954e98bdd0627a9a66615, + type: 3} + propertyPath: m_LocalPosition.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4719238613831707738, guid: fc3a533066e954e98bdd0627a9a66615, + type: 3} + propertyPath: m_LocalRotation.w + value: 1 + objectReference: {fileID: 0} + - target: {fileID: 4719238613831707738, guid: fc3a533066e954e98bdd0627a9a66615, + type: 3} + propertyPath: m_LocalRotation.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4719238613831707738, guid: fc3a533066e954e98bdd0627a9a66615, + type: 3} + propertyPath: m_LocalRotation.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4719238613831707738, guid: fc3a533066e954e98bdd0627a9a66615, + type: 3} + propertyPath: m_LocalRotation.z + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4719238613831707738, guid: fc3a533066e954e98bdd0627a9a66615, + type: 3} + propertyPath: m_LocalEulerAnglesHint.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4719238613831707738, guid: fc3a533066e954e98bdd0627a9a66615, + type: 3} + propertyPath: m_LocalEulerAnglesHint.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 4719238613831707738, guid: fc3a533066e954e98bdd0627a9a66615, + type: 3} + propertyPath: m_LocalEulerAnglesHint.z + value: 0 + objectReference: {fileID: 0} + m_RemovedComponents: [] + m_SourcePrefab: {fileID: 100100000, guid: fc3a533066e954e98bdd0627a9a66615, type: 3} diff --git a/Assets/Scenes/LevelPlacementAR.unity.meta b/Assets/Scenes/LevelPlacementAR.unity.meta new file mode 100644 index 0000000..f351ff2 --- /dev/null +++ b/Assets/Scenes/LevelPlacementAR.unity.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 5c95e8cc921a9493b931cb711ce445e8 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scenes/SampleScene.unity b/Assets/Scenes/SampleScene.unity index e4ba719..6d43ac6 100644 --- a/Assets/Scenes/SampleScene.unity +++ b/Assets/Scenes/SampleScene.unity @@ -238,6 +238,51 @@ MonoBehaviour: m_ShadowLayerMask: 1 m_LightCookieSize: {x: 1, y: 1} m_LightCookieOffset: {x: 0, y: 0} +--- !u!1 &486677887 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 486677888} + - component: {fileID: 486677889} + m_Layer: 0 + m_Name: Level Container + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &486677888 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 486677887} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 2055821021} + m_Father: {fileID: 0} + m_RootOrder: 4 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} +--- !u!114 &486677889 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 486677887} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 569f89a1fed9e4ea08db007d70dceb24, type: 3} + m_Name: + m_EditorClassIdentifier: --- !u!1 &832575517 GameObject: m_ObjectHideFlags: 0 @@ -514,80 +559,11 @@ Transform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 2055821017} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} + m_LocalPosition: {x: 0, y: 0.5, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] - m_Father: {fileID: 0} - m_RootOrder: 5 + m_Father: {fileID: 486677888} + m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} ---- !u!1001 &5807597000174049787 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - m_TransformParent: {fileID: 0} - m_Modifications: - - target: {fileID: 3624798292056245312, guid: 063ba62cdbe5943b7a4a2fe0186c9672, - type: 3} - propertyPath: m_Name - value: LevelPositionManager - objectReference: {fileID: 0} - - target: {fileID: 8109644083082424302, guid: 063ba62cdbe5943b7a4a2fe0186c9672, - type: 3} - propertyPath: m_RootOrder - value: 4 - objectReference: {fileID: 0} - - target: {fileID: 8109644083082424302, guid: 063ba62cdbe5943b7a4a2fe0186c9672, - type: 3} - propertyPath: m_LocalPosition.x - value: -6.0399113 - objectReference: {fileID: 0} - - target: {fileID: 8109644083082424302, guid: 063ba62cdbe5943b7a4a2fe0186c9672, - type: 3} - propertyPath: m_LocalPosition.y - value: -9.504788 - objectReference: {fileID: 0} - - target: {fileID: 8109644083082424302, guid: 063ba62cdbe5943b7a4a2fe0186c9672, - type: 3} - propertyPath: m_LocalPosition.z - value: 15.417434 - objectReference: {fileID: 0} - - target: {fileID: 8109644083082424302, guid: 063ba62cdbe5943b7a4a2fe0186c9672, - type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 8109644083082424302, guid: 063ba62cdbe5943b7a4a2fe0186c9672, - type: 3} - propertyPath: m_LocalRotation.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8109644083082424302, guid: 063ba62cdbe5943b7a4a2fe0186c9672, - type: 3} - propertyPath: m_LocalRotation.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8109644083082424302, guid: 063ba62cdbe5943b7a4a2fe0186c9672, - type: 3} - propertyPath: m_LocalRotation.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8109644083082424302, guid: 063ba62cdbe5943b7a4a2fe0186c9672, - type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8109644083082424302, guid: 063ba62cdbe5943b7a4a2fe0186c9672, - type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 8109644083082424302, guid: 063ba62cdbe5943b7a4a2fe0186c9672, - type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 063ba62cdbe5943b7a4a2fe0186c9672, type: 3} diff --git a/Assets/Shared/Materials.meta b/Assets/Shared/Materials.meta new file mode 100644 index 0000000..dd45511 --- /dev/null +++ b/Assets/Shared/Materials.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 81a76deec57a241e3a6ec292b353cfb2 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Shared/Materials/ARPlane.mat b/Assets/Shared/Materials/ARPlane.mat new file mode 100644 index 0000000..03530fe --- /dev/null +++ b/Assets/Shared/Materials/ARPlane.mat @@ -0,0 +1,127 @@ +%YAML 1.1 +%TAG !u! tag:unity3d.com,2011: +--- !u!21 &2100000 +Material: + serializedVersion: 6 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: ARPlane + m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3} + m_ShaderKeywords: _SURFACE_TYPE_TRANSPARENT + m_LightmapFlags: 4 + m_EnableInstancingVariants: 0 + m_DoubleSidedGI: 0 + m_CustomRenderQueue: 3000 + stringTagMap: + RenderType: Transparent + disabledShaderPasses: + - DepthOnly + - SHADOWCASTER + m_SavedProperties: + serializedVersion: 3 + m_TexEnvs: + - _BaseMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _BumpMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailAlbedoMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailMask: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _DetailNormalMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _EmissionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MainTex: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _MetallicGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _OcclusionMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _ParallaxMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - _SpecGlossMap: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_Lightmaps: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_LightmapsInd: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + - unity_ShadowMasks: + m_Texture: {fileID: 0} + m_Scale: {x: 1, y: 1} + m_Offset: {x: 0, y: 0} + m_Ints: [] + m_Floats: + - _AlphaClip: 0 + - _Blend: 0 + - _BumpScale: 1 + - _ClearCoatMask: 0 + - _ClearCoatSmoothness: 0 + - _Cull: 2 + - _Cutoff: 0.5 + - _DetailAlbedoMapScale: 1 + - _DetailNormalMapScale: 1 + - _DstBlend: 10 + - _EnvironmentReflections: 1 + - _GlossMapScale: 0 + - _Glossiness: 0 + - _GlossyReflections: 0 + - _Metallic: 0 + - _OcclusionStrength: 1 + - _Parallax: 0.005 + - _QueueOffset: 0 + - _ReceiveShadows: 1 + - _Smoothness: 0.5 + - _SmoothnessTextureChannel: 0 + - _SpecularHighlights: 1 + - _SrcBlend: 5 + - _Surface: 1 + - _WorkflowMode: 1 + - _ZWrite: 0 + m_Colors: + - _BaseColor: {r: 0.7075472, g: 0.7075472, b: 0.7075472, a: 0.09803922} + - _Color: {r: 0.7075471, g: 0.7075471, b: 0.7075471, a: 0.09803922} + - _EmissionColor: {r: 0, g: 0, b: 0, a: 1} + - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1} + m_BuildTextureStacks: [] +--- !u!114 &2651018892331844917 +MonoBehaviour: + m_ObjectHideFlags: 11 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 0} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3} + m_Name: + m_EditorClassIdentifier: + version: 5 diff --git a/Assets/Shared/Materials/ARPlane.mat.meta b/Assets/Shared/Materials/ARPlane.mat.meta new file mode 100644 index 0000000..9101f73 --- /dev/null +++ b/Assets/Shared/Materials/ARPlane.mat.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 1d92fdea1df194cf6b68014604c13bbd +NativeFormatImporter: + externalObjects: {} + mainObjectFileID: 2100000 + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Shared/Scripts/LevelContainer.cs b/Assets/Shared/Scripts/LevelContainer.cs new file mode 100644 index 0000000..89b2d6a --- /dev/null +++ b/Assets/Shared/Scripts/LevelContainer.cs @@ -0,0 +1,21 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class LevelContainer : MonoBehaviour +{ + private LevelPlacementData _levelPlacementData; + + void Start() + { + this._levelPlacementData = FindObjectOfType(); + } + + void Update() + { + this.transform.SetPositionAndRotation( + this._levelPlacementData.LevelPose.position, + this._levelPlacementData.LevelPose.rotation + ); + } +} diff --git a/Assets/Shared/Scripts/LevelContainer.cs.meta b/Assets/Shared/Scripts/LevelContainer.cs.meta new file mode 100644 index 0000000..e96be6e --- /dev/null +++ b/Assets/Shared/Scripts/LevelContainer.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 569f89a1fed9e4ea08db007d70dceb24 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Shared/Scripts/LevelPlacementController.cs b/Assets/Shared/Scripts/LevelPlacementController.cs deleted file mode 100644 index ab82bc9..0000000 --- a/Assets/Shared/Scripts/LevelPlacementController.cs +++ /dev/null @@ -1,110 +0,0 @@ - -using System.Collections; -using System.Collections.Generic; -using UnityEngine; -using UnityEngine.XR; -using UnityEngine.SceneManagement; -using UnityEngine.XR.ARFoundation; - -[RequireComponent(typeof(ARPlaneFinder))] -public class LevelPlacementController : MonoBehaviour -{ - - [SerializeField] private LevelPositionManager _levelPositionManager; - - private CompatibilityChecker _compatibilityChecker; - - private ARSessionOrigin _arSessionOrigin; - - private ARPlaneFinder _arPlaneFinder; - - [SerializeField] private GameObject _levelPlaceholderPrefab; - - - private GameObject _levelPlaceholder; - - private bool _hasPlacedLevel = false; - - public ARPlaneSearch LatestARPlaneSearch = new ARPlaneSearch() - { - FoundPlane = false - }; - - void Awake() - { - _arSessionOrigin = this.gameObject.GetComponent(); - this._arPlaneFinder = this.gameObject.GetComponent(); - } - - void Start() - { - _levelPlaceholder = Instantiate(_levelPlaceholderPrefab, Vector3.zero, Quaternion.identity); - _levelPlaceholder.SetActive(false); - - _compatibilityChecker = FindObjectOfType(); - CompatibilityChecker.AddListener(this.PlaceLevelDesktop); - } - - void Update() - { - if (!_hasPlacedLevel) - { - SearchForPlane(); - RenderLevelPlaceholderOnPlane(); - HandelUserTouch(); - } - } - - private void HandelUserTouch() - { - bool hasStartedTouching = Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began; - if (hasStartedTouching) PlaceLevel(); - } - - private void PlaceLevel() - { - if (!this.LatestARPlaneSearch.IsReasonableForLevelPlacement) return; - - _hasPlacedLevel = true; - if (_levelPositionManager != null) { - _levelPositionManager.UpdateLevelSpawnPosition(new Pose( - this.LatestARPlaneSearch.PlaneHitPosition, - this.LatestARPlaneSearch.CameraRotationTowardsPlane - )); - } - this.MoveToNextScene(); - - } - - private void PlaceLevelDesktop(CompatibilityChecker.DeviceSupport deviceSupport) - { - if (deviceSupport != CompatibilityChecker.DeviceSupport.DESKTOP) return; - Debug.Log("Place level desktop"); - _hasPlacedLevel = true; - this._levelPositionManager.UpdateLevelSpawnPosition(new Pose()); - this.MoveToNextScene(); - } - - private void SearchForPlane() - { - this.LatestARPlaneSearch = this._arPlaneFinder.SearchForPointedARPlane(); - } - - private void RenderLevelPlaceholderOnPlane() - { - if (!this.LatestARPlaneSearch.IsReasonableForLevelPlacement) - { - _levelPlaceholder.SetActive(false); - } - else - { - _levelPlaceholder.SetActive(true); - _levelPlaceholder.transform.SetPositionAndRotation(this.LatestARPlaneSearch.PlaneHitPosition, this.LatestARPlaneSearch.CameraRotationTowardsPlane); - } - } - - private void MoveToNextScene() - { - SceneManager.LoadScene("JoinGameSetup"); - } -} diff --git a/IOSBuild_BurstDebugInformation_DoNotShip/StaticLibraries/lib_burst_generated64.txt b/IOSBuild_BurstDebugInformation_DoNotShip/StaticLibraries/lib_burst_generated64.txt index 578cdf8..374dcae 100644 --- a/IOSBuild_BurstDebugInformation_DoNotShip/StaticLibraries/lib_burst_generated64.txt +++ b/IOSBuild_BurstDebugInformation_DoNotShip/StaticLibraries/lib_burst_generated64.txt @@ -126,6 +126,8 @@ Library: lib_burst_generated64 --compilation-defines=CSHARP_7_3_OR_NEWER --compilation-defines=ENABLE_VR_MODULE --compilation-defines=ENABLE_XR_MODULE +--compilation-defines=ENABLE_INPUT_SYSTEM_PACKAGE +--compilation-defines=PACKAGE_INPUT_SYSTEM_EXISTS --compilation-defines=MODULE_AI_EXISTS --compilation-defines=MODULE_ANIMATION_EXISTS --compilation-defines=MODULE_PHYSICS_EXISTS @@ -133,11 +135,17 @@ Library: lib_burst_generated64 --compilation-defines=MODULE_PARTICLE_SYSTEM_EXISTS --compilation-defines=MODULE_URP_ENABLED --compilation-defines=USE_LEGACY_INPUT_HELPERS +--compilation-defines=UNITY_INPUT_SYSTEM --compilation-defines=ENABLE_BURST_1_0_0_OR_NEWER --compilation-defines=USING_ANIMATION_MODULE --compilation-defines=USING_PHYSICS2D_MODULE --compilation-defines=TIMELINE_FRAMEACCURATE --compilation-defines=UNITY_ANALYTICS +--compilation-defines=UNITY_INPUT_SYSTEM_ENABLE_VR +--compilation-defines=UNITY_XR_AVAILABLE +--compilation-defines=UNITY_INPUT_SYSTEM_ENABLE_PHYSICS +--compilation-defines=UNITY_INPUT_SYSTEM_ENABLE_PHYSICS2D +--compilation-defines=UNITY_INPUT_SYSTEM_ENABLE_UI --generate-link-xml=Temp/burst.link.xml --debug=Full --generate-static-linkage-methods @@ -157,13 +165,14 @@ Library: lib_burst_generated64 --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.TextMeshPro.dll --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.Timeline.dll --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.RenderPipeline.Universal.ShaderLibrary.dll ---root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.XR.Management.dll --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll +--root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.XR.Management.dll --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.RenderPipelines.Core.ShaderLibrary.dll --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/UnityEngine.SpatialTracking.dll --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.Subsystem.Registration.dll --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.RenderPipelines.Universal.Shaders.dll --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll +--root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.InputSystem.dll --assembly-folder=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/ --pdb-search-paths=Temp/ManagedSymbols/ --method=Unity.Jobs.IJobForExtensions+ForJobStruct`1[[UnityEngine.Rendering.Universal.ReorderJob`1[[UnityEngine.Rendering.Universal.LightMinMaxZ, Unity.RenderPipelines.Universal.Runtime, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], Unity.RenderPipelines.Universal.Runtime, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null::Execute(UnityEngine.Rendering.Universal.ReorderJob`1[[UnityEngine.Rendering.Universal.LightMinMaxZ, Unity.RenderPipelines.Universal.Runtime, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]&, Unity.RenderPipelines.Universal.Runtime, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|Unity.Jobs.LowLevel.Unsafe.JobRanges&, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)--e943843acfb78f5f2f3716a6553740d9 diff --git a/Packages/manifest.json b/Packages/manifest.json index 1c114ea..a1abb2b 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -5,6 +5,7 @@ "com.unity.ide.rider": "3.0.7", "com.unity.ide.visualstudio": "2.0.11", "com.unity.ide.vscode": "1.2.4", + "com.unity.inputsystem": "1.1.1", "com.unity.render-pipelines.universal": "12.1.1", "com.unity.test-framework": "1.1.29", "com.unity.textmeshpro": "3.0.6", diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index 18de0a5..a9111fc 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -58,6 +58,15 @@ "dependencies": {}, "url": "https://packages.unity.com" }, + "com.unity.inputsystem": { + "version": "1.1.1", + "depth": 0, + "source": "registry", + "dependencies": { + "com.unity.modules.uielements": "1.0.0" + }, + "url": "https://packages.unity.com" + }, "com.unity.mathematics": { "version": "1.2.4", "depth": 1, diff --git a/ProjectSettings/EditorBuildSettings.asset b/ProjectSettings/EditorBuildSettings.asset index 7fb3723..adc6f1a 100644 --- a/ProjectSettings/EditorBuildSettings.asset +++ b/ProjectSettings/EditorBuildSettings.asset @@ -5,6 +5,9 @@ EditorBuildSettings: m_ObjectHideFlags: 0 serializedVersion: 2 m_Scenes: + - enabled: 1 + path: Assets/Scenes/LevelPlacementAR.unity + guid: 5c95e8cc921a9493b931cb711ce445e8 - enabled: 1 path: Assets/Scenes/SampleScene.unity guid: 99c9720ab356a0642a771bea13969a05 diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 1af1220..7787bdd 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -138,6 +138,7 @@ PlayerSettings: preloadedAssets: - {fileID: 0} - {fileID: 0} + - {fileID: 0} metroInputSource: 0 wsaTransparentSwapchain: 0 m_HolographicPauseOnTrackingLoss: 1 diff --git a/ProjectSettings/TagManager.asset b/ProjectSettings/TagManager.asset index 1c92a78..b5e9e55 100644 --- a/ProjectSettings/TagManager.asset +++ b/ProjectSettings/TagManager.asset @@ -3,7 +3,8 @@ --- !u!78 &1 TagManager: serializedVersion: 2 - tags: [] + tags: + - Level layers: - Default - TransparentFX From e2f2a1e82fa2fb30c4426b2dabbedbcdb84415d0 Mon Sep 17 00:00:00 2001 From: Adam Jonsson Date: Wed, 17 Nov 2021 16:02:16 +0100 Subject: [PATCH 3/5] fix: Remove unused code --- .../CrossPlatformCamera/Cross Platform Camera.prefab | 2 +- .../Prefabs/CrossPlatformCamera/CrossPlatformCamera.cs | 9 --------- 2 files changed, 1 insertion(+), 10 deletions(-) diff --git a/Assets/Prefabs/CrossPlatformCamera/Cross Platform Camera.prefab b/Assets/Prefabs/CrossPlatformCamera/Cross Platform Camera.prefab index 28ab6ac..d56178d 100644 --- a/Assets/Prefabs/CrossPlatformCamera/Cross Platform Camera.prefab +++ b/Assets/Prefabs/CrossPlatformCamera/Cross Platform Camera.prefab @@ -461,7 +461,7 @@ MonoBehaviour: _arContainer: {fileID: 8778032812811765415} _vrContainer: {fileID: 554659373511638886} _desktopContainer: {fileID: 3729540537599245260} - _arSessionOrigin: {fileID: 0} + _arSessionOrigin: {fileID: 8443179635172985928} --- !u!1 &8778032812811765415 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Prefabs/CrossPlatformCamera/CrossPlatformCamera.cs b/Assets/Prefabs/CrossPlatformCamera/CrossPlatformCamera.cs index 56aec04..d745504 100644 --- a/Assets/Prefabs/CrossPlatformCamera/CrossPlatformCamera.cs +++ b/Assets/Prefabs/CrossPlatformCamera/CrossPlatformCamera.cs @@ -9,9 +9,6 @@ public class CrossPlatformCamera : MonoBehaviour [SerializeField] private GameObject _vrContainer; [SerializeField] private GameObject _desktopContainer; - [Header("Augmented Reality")] - [SerializeField] private ARSessionOrigin _arSessionOrigin; - void Start() { CompatibilityChecker.AddListener(EnableCorrectCamera); @@ -48,10 +45,4 @@ public void EnableDesktopCamera() this._arContainer.SetActive(false); this._desktopContainer.SetActive(true); } - - private void MakeOriginAppearAt(Pose levelPlacementPose) - { - _arSessionOrigin.MakeContentAppearAt(new GameObject().transform, levelPlacementPose.position, levelPlacementPose.rotation); - } - } From 96a72536ad3e47253a5f6b7a3c505c6d97160de1 Mon Sep 17 00:00:00 2001 From: Adam Jonsson Date: Wed, 17 Nov 2021 16:08:12 +0100 Subject: [PATCH 4/5] feat: New input system --- .../StaticLibraries/lib_burst_generated64.txt | 40 +++++++++---------- ProjectSettings/ProjectSettings.asset | 3 ++ 2 files changed, 23 insertions(+), 20 deletions(-) diff --git a/IOSBuild_BurstDebugInformation_DoNotShip/StaticLibraries/lib_burst_generated64.txt b/IOSBuild_BurstDebugInformation_DoNotShip/StaticLibraries/lib_burst_generated64.txt index 374dcae..67438a2 100644 --- a/IOSBuild_BurstDebugInformation_DoNotShip/StaticLibraries/lib_burst_generated64.txt +++ b/IOSBuild_BurstDebugInformation_DoNotShip/StaticLibraries/lib_burst_generated64.txt @@ -127,52 +127,52 @@ Library: lib_burst_generated64 --compilation-defines=ENABLE_VR_MODULE --compilation-defines=ENABLE_XR_MODULE --compilation-defines=ENABLE_INPUT_SYSTEM_PACKAGE ---compilation-defines=PACKAGE_INPUT_SYSTEM_EXISTS ---compilation-defines=MODULE_AI_EXISTS ---compilation-defines=MODULE_ANIMATION_EXISTS ---compilation-defines=MODULE_PHYSICS_EXISTS ---compilation-defines=MODULE_PHYSICS_2D_EXISTS ---compilation-defines=MODULE_PARTICLE_SYSTEM_EXISTS --compilation-defines=MODULE_URP_ENABLED --compilation-defines=USE_LEGACY_INPUT_HELPERS --compilation-defines=UNITY_INPUT_SYSTEM ---compilation-defines=ENABLE_BURST_1_0_0_OR_NEWER ---compilation-defines=USING_ANIMATION_MODULE ---compilation-defines=USING_PHYSICS2D_MODULE ---compilation-defines=TIMELINE_FRAMEACCURATE ---compilation-defines=UNITY_ANALYTICS --compilation-defines=UNITY_INPUT_SYSTEM_ENABLE_VR --compilation-defines=UNITY_XR_AVAILABLE --compilation-defines=UNITY_INPUT_SYSTEM_ENABLE_PHYSICS --compilation-defines=UNITY_INPUT_SYSTEM_ENABLE_PHYSICS2D --compilation-defines=UNITY_INPUT_SYSTEM_ENABLE_UI +--compilation-defines=ENABLE_BURST_1_0_0_OR_NEWER +--compilation-defines=USING_ANIMATION_MODULE +--compilation-defines=USING_PHYSICS2D_MODULE +--compilation-defines=PACKAGE_INPUT_SYSTEM_EXISTS +--compilation-defines=MODULE_AI_EXISTS +--compilation-defines=MODULE_ANIMATION_EXISTS +--compilation-defines=MODULE_PHYSICS_EXISTS +--compilation-defines=MODULE_PHYSICS_2D_EXISTS +--compilation-defines=MODULE_PARTICLE_SYSTEM_EXISTS +--compilation-defines=TIMELINE_FRAMEACCURATE +--compilation-defines=UNITY_ANALYTICS --generate-link-xml=Temp/burst.link.xml --debug=Full --generate-static-linkage-methods --output=/Users/adam/Repositories/Lightenize/Temp/StagingArea/StaticLibraries/lib_burst_generated64 --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/UnityEngine.UI.dll --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.RenderPipelines.Core.Runtime.dll ---root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.VisualScripting.Flow.dll ---root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.Mathematics.dll --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.XR.ARFoundation.dll --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.XR.ARKit.dll --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.XR.ARSubsystems.dll +--root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.InputSystem.dll --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.VisualScripting.State.dll ---root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.VisualScripting.Core.dll --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.RenderPipelines.Universal.Runtime.dll ---root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/UnityEngine.XR.LegacyInputHelpers.dll ---root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.Burst.dll +--root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.VisualScripting.Flow.dll +--root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.VisualScripting.Core.dll --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.TextMeshPro.dll ---root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.Timeline.dll +--root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.Burst.dll --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.RenderPipeline.Universal.ShaderLibrary.dll --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Assembly-CSharp.dll +--root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.Timeline.dll +--root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.Mathematics.dll --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.XR.Management.dll ---root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.RenderPipelines.Core.ShaderLibrary.dll --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/UnityEngine.SpatialTracking.dll +--root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/UnityEngine.XR.LegacyInputHelpers.dll --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.Subsystem.Registration.dll ---root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.RenderPipelines.Universal.Shaders.dll --root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.RenderPipelines.ShaderGraph.ShaderGraphLibrary.dll ---root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.InputSystem.dll +--root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.RenderPipelines.Core.ShaderLibrary.dll +--root-assembly=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/Unity.RenderPipelines.Universal.Shaders.dll --assembly-folder=/Users/adam/Repositories/Lightenize/Temp/StagingArea/Data/Managed/ --pdb-search-paths=Temp/ManagedSymbols/ --method=Unity.Jobs.IJobForExtensions+ForJobStruct`1[[UnityEngine.Rendering.Universal.ReorderJob`1[[UnityEngine.Rendering.Universal.LightMinMaxZ, Unity.RenderPipelines.Universal.Runtime, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], Unity.RenderPipelines.Universal.Runtime, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]], UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null::Execute(UnityEngine.Rendering.Universal.ReorderJob`1[[UnityEngine.Rendering.Universal.LightMinMaxZ, Unity.RenderPipelines.Universal.Runtime, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null]]&, Unity.RenderPipelines.Universal.Runtime, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|System.IntPtr, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089|Unity.Jobs.LowLevel.Unsafe.JobRanges&, UnityEngine.CoreModule, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null|System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089)--e943843acfb78f5f2f3716a6553740d9 diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 7787bdd..4644e75 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -139,6 +139,9 @@ PlayerSettings: - {fileID: 0} - {fileID: 0} - {fileID: 0} + - {fileID: 4800000, guid: e7c77f6eaab324a819efdc13b8125a39, type: 3} + - {fileID: 0} + - {fileID: 5498958275016953305, guid: 655f7a88dec894b51856adaa316a3a84, type: 2} metroInputSource: 0 wsaTransparentSwapchain: 0 m_HolographicPauseOnTrackingLoss: 1 From 4db2aeb731e61a43db1caf0a8ecc4c588ad79f33 Mon Sep 17 00:00:00 2001 From: Adam Jonsson Date: Wed, 17 Nov 2021 16:11:29 +0100 Subject: [PATCH 5/5] fix: Move annas test scene to development folder --- Assets/Scenes/{ => Development}/Anna test.meta | 2 +- .../Scenes/{ => Development}/Anna test/Anna test lights.unity | 0 .../{ => Development}/Anna test/Anna test lights.unity.meta | 0 Assets/Scenes/{ => Development}/Anna test/Ground.mat | 0 Assets/Scenes/{ => Development}/Anna test/Ground.mat.meta | 0 Assets/Scenes/{ => Development}/Anna test/New Material.mat | 0 Assets/Scenes/{ => Development}/Anna test/New Material.mat.meta | 0 ProjectSettings/ProjectSettings.asset | 1 + 8 files changed, 2 insertions(+), 1 deletion(-) rename Assets/Scenes/{ => Development}/Anna test.meta (77%) rename Assets/Scenes/{ => Development}/Anna test/Anna test lights.unity (100%) rename Assets/Scenes/{ => Development}/Anna test/Anna test lights.unity.meta (100%) rename Assets/Scenes/{ => Development}/Anna test/Ground.mat (100%) rename Assets/Scenes/{ => Development}/Anna test/Ground.mat.meta (100%) rename Assets/Scenes/{ => Development}/Anna test/New Material.mat (100%) rename Assets/Scenes/{ => Development}/Anna test/New Material.mat.meta (100%) diff --git a/Assets/Scenes/Anna test.meta b/Assets/Scenes/Development/Anna test.meta similarity index 77% rename from Assets/Scenes/Anna test.meta rename to Assets/Scenes/Development/Anna test.meta index 7b0536b..afaba60 100644 --- a/Assets/Scenes/Anna test.meta +++ b/Assets/Scenes/Development/Anna test.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: c3450580629a942908519821ef422106 +guid: cd9e104b5063649db8b4b00749b25c6f folderAsset: yes DefaultImporter: externalObjects: {} diff --git a/Assets/Scenes/Anna test/Anna test lights.unity b/Assets/Scenes/Development/Anna test/Anna test lights.unity similarity index 100% rename from Assets/Scenes/Anna test/Anna test lights.unity rename to Assets/Scenes/Development/Anna test/Anna test lights.unity diff --git a/Assets/Scenes/Anna test/Anna test lights.unity.meta b/Assets/Scenes/Development/Anna test/Anna test lights.unity.meta similarity index 100% rename from Assets/Scenes/Anna test/Anna test lights.unity.meta rename to Assets/Scenes/Development/Anna test/Anna test lights.unity.meta diff --git a/Assets/Scenes/Anna test/Ground.mat b/Assets/Scenes/Development/Anna test/Ground.mat similarity index 100% rename from Assets/Scenes/Anna test/Ground.mat rename to Assets/Scenes/Development/Anna test/Ground.mat diff --git a/Assets/Scenes/Anna test/Ground.mat.meta b/Assets/Scenes/Development/Anna test/Ground.mat.meta similarity index 100% rename from Assets/Scenes/Anna test/Ground.mat.meta rename to Assets/Scenes/Development/Anna test/Ground.mat.meta diff --git a/Assets/Scenes/Anna test/New Material.mat b/Assets/Scenes/Development/Anna test/New Material.mat similarity index 100% rename from Assets/Scenes/Anna test/New Material.mat rename to Assets/Scenes/Development/Anna test/New Material.mat diff --git a/Assets/Scenes/Anna test/New Material.mat.meta b/Assets/Scenes/Development/Anna test/New Material.mat.meta similarity index 100% rename from Assets/Scenes/Anna test/New Material.mat.meta rename to Assets/Scenes/Development/Anna test/New Material.mat.meta diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 4644e75..2ce4284 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -139,6 +139,7 @@ PlayerSettings: - {fileID: 0} - {fileID: 0} - {fileID: 0} + - {fileID: 0} - {fileID: 4800000, guid: e7c77f6eaab324a819efdc13b8125a39, type: 3} - {fileID: 0} - {fileID: 5498958275016953305, guid: 655f7a88dec894b51856adaa316a3a84, type: 2}