|
|
|
|
|
|
using UnityEngine; |
|
|
|
using UnityEngine.UI; |
|
|
|
using UnityEngine.XR.ARFoundation; |
|
|
|
using UnityEngine.XR.ARSubsystems; |
|
|
|
#if UNITY_IOS
|
|
|
|
using UnityEngine.XR.ARKit; |
|
|
|
#endif
|
|
|
|
|
|
|
#if UNITY_IOS
|
|
|
|
IEnumerator Save() |
|
|
|
{ |
|
|
|
var sessionSubsystem = ARSubsystemManager.sessionSubsystem; |
|
|
|
var sessionSubsystem = (ARKitSessionSubsystem)m_ARSession.subsystem; |
|
|
|
if (sessionSubsystem == null) |
|
|
|
{ |
|
|
|
Log("No session subsystem available. Could not save."); |
|
|
|
|
|
|
|
|
|
|
IEnumerator Load() |
|
|
|
{ |
|
|
|
var sessionSubsystem = ARSubsystemManager.sessionSubsystem; |
|
|
|
var sessionSubsystem = (ARKitSessionSubsystem)m_ARSession.subsystem; |
|
|
|
if (sessionSubsystem == null) |
|
|
|
{ |
|
|
|
Log("No session subsystem available. Could not load."); |
|
|
|
|
|
|
get |
|
|
|
{ |
|
|
|
#if UNITY_IOS
|
|
|
|
var sessionSubsystem = ARSubsystemManager.sessionSubsystem; |
|
|
|
var sessionSubsystem = (ARKitSessionSubsystem)m_ARSession.subsystem; |
|
|
|
return sessionSubsystem.WorldMapSupported(); |
|
|
|
return sessionSubsystem.worldMapSupported; |
|
|
|
#endif
|
|
|
|
return false; |
|
|
|
} |
|
|
|
|
|
|
SetActive(mappingStatusText, false); |
|
|
|
} |
|
|
|
|
|
|
|
var sessionSubsystem = ARSubsystemManager.sessionSubsystem; |
|
|
|
#if UNITY_IOS
|
|
|
|
var sessionSubsystem = (ARKitSessionSubsystem)m_ARSession.subsystem; |
|
|
|
#else
|
|
|
|
XRSessionSubsystem sessionSubsystem = null; |
|
|
|
#endif
|
|
|
|
if (sessionSubsystem == null) |
|
|
|
return; |
|
|
|
|
|
|
|
|
|
|
SetText(logText, msg); |
|
|
|
|
|
|
|
#if UNITY_IOS
|
|
|
|
SetText(mappingStatusText, string.Format("Mapping Status: {0}", sessionSubsystem.GetWorldMappingStatus())); |
|
|
|
SetText(mappingStatusText, string.Format("Mapping Status: {0}", sessionSubsystem.worldMappingStatus)); |
|
|
|
#endif
|
|
|
|
} |
|
|
|
|