public static IntPtr SessionHandle(this ARSession session) { if (session.subsystem == null || session.subsystem.nativePtr == null) { return(IntPtr.Zero); } SessionNativePointerStruct info = (SessionNativePointerStruct) Marshal.PtrToStructure( session.subsystem.nativePtr, typeof(SessionNativePointerStruct)); return(info.SessionHandle); }
public static IntPtr SessionHandle(this ARSession session) { if (session.subsystem == null || session.subsystem.nativePtr == null) { return(IntPtr.Zero); } #if UNITY_EDITOR if (UnityEngine.Application.isEditor) { return(ARCoreCloudAnchorsEditorDelegate.dummySessionPtr); } #endif SessionNativePointerStruct info = (SessionNativePointerStruct) Marshal.PtrToStructure( session.subsystem.nativePtr, typeof(SessionNativePointerStruct)); return(info.SessionHandle); }