Commit 4d61c60a authored by Sally552sally's avatar Sally552sally
Browse files

Merge branch 'master' into Spring_v3

parents ccef5edd 9cd6c493
Showing with 3591 additions and 616 deletions
+3591 -616
......@@ -8,3 +8,4 @@
*.jpg filter=lfs diff=lfs merge=lfs -text
*.fbx filter=lfs diff=lfs merge=lfs -text
*.hdr filter=lfs diff=lfs merge=lfs -text
*.aar filter=lfs diff=lfs merge=lfs -text
# Default ignored files
/workspace.xml
\ No newline at end of file
This diff is collapsed.
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ContentModelUserStore">
<attachedFolders>
<Path>$USER_HOME$/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.xr.arsubsystems@3.1.0-preview.4</Path>
</attachedFolders>
<explicitIncludes>
<Path>$USER_HOME$/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.xr.management@3.0.5</Path>
<Path>Library/PackageCache/com.unity.ads@3.4.4</Path>
<Path>Library/PackageCache/com.unity.analytics@3.3.5</Path>
<Path>Library/PackageCache/com.unity.burst@1.3.0-preview.9</Path>
<Path>Library/PackageCache/com.unity.collab-proxy@1.2.16</Path>
<Path>Library/PackageCache/com.unity.collections@0.7.1-preview.3</Path>
<Path>Library/PackageCache/com.unity.editorcoroutines@0.0.2-preview.1</Path>
<Path>Library/PackageCache/com.unity.entities@0.9.1-preview.15</Path>
<Path>Library/PackageCache/com.unity.ext.nunit@1.0.0</Path>
<Path>Library/PackageCache/com.unity.ide.rider@1.1.4</Path>
<Path>Library/PackageCache/com.unity.ide.vscode@1.1.4</Path>
<Path>Library/PackageCache/com.unity.jobs@0.2.8-preview.3</Path>
<Path>Library/PackageCache/com.unity.mathematics@1.1.0</Path>
<Path>Library/PackageCache/com.unity.memoryprofiler@0.1.0-preview.7</Path>
<Path>Library/PackageCache/com.unity.performance.profile-analyzer@0.4.0-preview.6</Path>
<Path>Library/PackageCache/com.unity.physics@0.3.2-preview</Path>
<Path>Library/PackageCache/com.unity.platforms@0.2.2-preview.7</Path>
<Path>Library/PackageCache/com.unity.postprocessing@2.2.2</Path>
<Path>Library/PackageCache/com.unity.properties.ui@1.1.0-preview</Path>
<Path>Library/PackageCache/com.unity.properties@1.1.0-preview</Path>
<Path>Library/PackageCache/com.unity.purchasing@2.0.6</Path>
<Path>Library/PackageCache/com.unity.rendering.hybrid@0.4.2-preview.16</Path>
<Path>Library/PackageCache/com.unity.scriptablebuildpipeline@1.6.4-preview</Path>
<Path>Library/PackageCache/com.unity.searcher@4.0.9</Path>
<Path>Library/PackageCache/com.unity.serialization@1.1.0-preview</Path>
<Path>Library/PackageCache/com.unity.subsystemregistration@1.0.6</Path>
<Path>Library/PackageCache/com.unity.test-framework.performance@1.3.3-preview</Path>
<Path>Library/PackageCache/com.unity.test-framework@1.1.13</Path>
<Path>Library/PackageCache/com.unity.textmeshpro@2.0.1</Path>
<Path>Library/PackageCache/com.unity.timeline@1.2.6</Path>
<Path>Library/PackageCache/com.unity.vectorgraphics@2.0.0-preview.12</Path>
<Path>Library/PackageCache/com.unity.xr.arcore@3.1.0-preview.4</Path>
<Path>Library/PackageCache/com.unity.xr.arcore@4.0.0-preview.1</Path>
<Path>Library/PackageCache/com.unity.xr.arfoundation@3.1.0-preview.8</Path>
<Path>Library/PackageCache/com.unity.xr.arfoundation@4.0.0-preview.1</Path>
<Path>Library/PackageCache/com.unity.xr.arkit-face-tracking@3.1.0-preview.4</Path>
<Path>Library/PackageCache/com.unity.xr.arkit@3.1.0-preview.4</Path>
<Path>Library/PackageCache/com.unity.xr.arkit@4.0.0-preview.1</Path>
<Path>Library/PackageCache/com.unity.xr.arsubsystems@4.0.0-preview.1</Path>
<Path>Library/PackageCache/com.unity.xr.legacyinputhelpers@2.0.6</Path>
<Path>Library/PackageCache/nuget.mono-cecil@0.1.5-preview</Path>
<Path>Packages</Path>
<Path>ProjectSettings</Path>
</explicitIncludes>
<explicitExcludes>
<Path>.git</Path>
<Path>.idea</Path>
<Path>Library</Path>
<Path>Logs</Path>
<Path>Temp</Path>
<Path>UnityCloudCI</Path>
<Path>UserSettings</Path>
<Path>obj</Path>
</explicitExcludes>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="ProjectModuleManager">
<modules>
<module fileurl="file://$PROJECT_DIR$/.idea/.idea.DomidoApp/riderModule.iml" filepath="$PROJECT_DIR$/.idea/.idea.DomidoApp/riderModule.iml" />
</modules>
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="RiderProjectSettingsUpdater">
<option name="vcsConfiguration" value="1" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<project version="4">
<component name="VcsDirectoryMappings">
<mapping directory="$PROJECT_DIR$" vcs="Git" />
<mapping directory="$PROJECT_DIR$/Assets/DomiDo/Core" vcs="Git" />
</component>
</project>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8"?>
<module type="RIDER_MODULE" version="4">
<component name="NewModuleRootManager">
<content url="file://$USER_HOME$/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.xr.arsubsystems@3.1.0-preview.4" />
<content url="file://$USER_HOME$/AppData/Local/Unity/cache/packages/packages.unity.com/com.unity.xr.management@3.0.5" />
<content url="file://$MODULE_DIR$/../.." />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
\ No newline at end of file
......@@ -201,20 +201,46 @@
<e p="ARVoxelGrid.cs" t="Include" />
<e p="ARWorldMap.cs" t="Include" />
<e p="ARWorldState.cs" t="Include" />
<e p="CreateComponents.cs" t="Include" />
<e p="ParentComponent.cs" t="Include" />
<e p="Plan" t="Include">
<e p="CreatePlanComponents.cs" t="Include" />
<e p="IPlanComponent.cs" t="Include" />
<e p="RemovePlanComponents.cs" t="Include" />
</e>
<e p="SetupUserCommandComponent.cs" t="Include" />
<e p="UserCommandApprovedTag.cs" t="Include" />
<e p="UserCommandCanceledTag.cs" t="Include" />
<e p="UserCommands.cs" t="Include" />
</e>
<e p="system" t="Include">
<e p="CreatePlanSystemGroup" t="Include">
<e p="CreateBlockPlanSystem.cs" t="Include" />
<e p="CreateChunkPlanSystem.cs" t="Include" />
<e p="CreateGridPlanSystem.cs" t="Include" />
<e p="CreateWorldPlanSystem.cs" t="Include" />
</e>
<e p="CreateTargetChunkSystem.cs" t="Include" />
<e p="ExecuteAddBlockActionSystem.cs" t="Include" />
<e p="ExecuteAnchorCreateCmdSystem.cs" t="Include" />
<e p="ExecuteCreateSystemGroup" t="Include">
<e p="CreateBlockSystem.cs" t="Include" />
<e p="CreateChunkSystem.cs" t="Include" />
<e p="CreateGridSystem.cs" t="Include" />
<e p="CreateWorldSystem.cs" t="Include" />
</e>
<e p="ExecuteRemoveBlockActionSystem.cs" t="Include" />
<e p="ExecuteWorldMapCreateCmdSystem.cs" t="Include" />
<e p="MakeBlockCommandsConnectedSystem.cs" t="Include" />
<e p="RemoveExecutedAnchorCreateCmdSystem.cs" t="Include" />
<e p="RemovePlanSystemGroup" t="Include">
<e p="RemoveBlockPlanSystem.cs" t="Include" />
<e p="RemoveChunkPlanSystem.cs" t="Include" />
<e p="RemoveGridPlanSystem.cs" t="Include" />
<e p="RemoveWorldPlanSystem.cs" t="Include" />
</e>
<e p="ReqestGridToWorldMapBindingSystem.cs" t="Include" />
<e p="SystemGroups.cs" t="Include" />
</e>
<e p="Voxels" t="Include">
<e p="BlockCoreInstaller.cs" t="Include" />
......
......@@ -42,7 +42,6 @@
<Path>.git</Path>
<Path>.idea</Path>
<Path>Library</Path>
<Path>Temp</Path>
<Path>UnityCloudCI</Path>
<Path>obj</Path>
</explicitExcludes>
......
......@@ -20,9 +20,72 @@ public class SpatialAnchorsUnityBuildProcessing : IPreprocessBuildWithReport, IP
{
private const string AzureSpatialAnchorsPackage = "Microsoft.Azure.SpatialAnchors.WinCPP";
private const string AzureSpatialAnchorsRedistPackage = "Microsoft.Azure.SpatialAnchors.WinCPP.Redist";
private const string UnityRelativePodFilePath = "Assets/AzureSpatialAnchors.SDK/Plugins/iOS/Podfile";
private const string UnityRelativeNuGetConfigFilePath = @"Assets\\AzureSpatialAnchors.SDK\\Plugins\\HoloLens\\NuGet.Config";
private const string UnityRelativePackageVersionFilePath = @"Assets\\AzureSpatialAnchors.SDK\\Plugins\\HoloLens\\version.txt";
private const string defaultUnityRelativePodFilePath = "Assets/AzureSpatialAnchors.SDK/Plugins/iOS/Podfile";
private static string unityRelativePodFilePath = string.Empty;
private static string UnityRelativePodFilePath
{
get
{
if (string.IsNullOrEmpty(unityRelativePodFilePath) &&
!TryFindAssetPath("Podfile", "AzureSpatialAnchors.SDK/Plugins/iOS", out unityRelativePodFilePath))
{
return defaultUnityRelativePodFilePath;
}
return unityRelativePodFilePath;
}
}
private const string defaultUnityRelativeNuGetConfigFilePath = @"Assets\\AzureSpatialAnchors.SDK\\Plugins\\HoloLens\\NuGet.Config";
private static string unityRelativeNuGetConfigFilePath = string.Empty;
private static string UnityRelativeNuGetConfigFilePath
{
get
{
if (string.IsNullOrEmpty(unityRelativeNuGetConfigFilePath) &&
!TryFindAssetPath("NuGet", "AzureSpatialAnchors.SDK/Plugins/HoloLens", out unityRelativeNuGetConfigFilePath))
{
return defaultUnityRelativeNuGetConfigFilePath;
}
return unityRelativeNuGetConfigFilePath;
}
}
private const string defaultUnityRelativePackageVersionFilePath = @"Assets\\AzureSpatialAnchors.SDK\\Plugins\\HoloLens\\version.txt";
private static string unityRelativePackageVersionFilePath = string.Empty;
private static string UnityRelativePackageVersionFilePath
{
get
{
if (string.IsNullOrEmpty(unityRelativePackageVersionFilePath) &&
!TryFindAssetPath("version", "AzureSpatialAnchors.SDK/Plugins/HoloLens", out unityRelativePackageVersionFilePath))
{
return defaultUnityRelativePackageVersionFilePath;
}
return unityRelativePackageVersionFilePath;
}
}
private static bool TryFindAssetPath(string assetName, string assetPrefix, out string assetPath)
{
assetPath = string.Empty;
string[] assets = AssetDatabase.FindAssets(assetName);
foreach (var guid in assets)
{
string tempAssetPath = AssetDatabase.GUIDToAssetPath(guid);
if (tempAssetPath.Contains(assetPrefix))
{
assetPath = tempAssetPath;
return true;
}
}
Debug.LogWarning($"{assetPrefix}/*/{assetName} wasn't found in the Unity Project.");
return false;
}
public int callbackOrder
{
......
fileFormatVersion: 2
guid: add54d21323bb754394dfa038e892087
guid: b797ebd8dd2260e42af5afb0457b98d8
MonoImporter:
externalObjects: {}
serializedVersion: 2
......
......@@ -9,7 +9,6 @@ PluginImporter:
isPreloaded: 0
isOverridable: 0
isExplicitlyReferenced: 0
validateReferences: 1
platformData:
- first:
'': Any
......@@ -68,7 +67,7 @@ PluginImporter:
second:
enabled: 0
settings:
CPU: AnyCPU
CPU: x86_64
- first:
Standalone: OSXUniversal
second:
......
2.1.1
\ No newline at end of file
2.2.1
\ No newline at end of file
platform :ios, '11.0'
use_frameworks!
target 'Unity-iPhone' do
# Pods for Unity-iPhone
pod 'AzureSpatialAnchors', '2.1.1'
end
platform :ios, '11.0'
target 'Unity-iPhone' do
end
target 'UnityFramework' do
pod 'AzureSpatialAnchors', '2.2.1'
# add other dependencies below as static framework
# e.g. pod 'Firebase/Core', '6.17.0'
end
// Copyright (c) Microsoft Corporation. All rights reserved.
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT license.
using UnityEngine;
......@@ -14,29 +14,29 @@ namespace Microsoft.Azure.SpatialAnchors.Unity
[Header("Authentication")]
[SerializeField]
[Tooltip("The method to use for authentication.")]
private AuthenticationMode authenticationMode = AuthenticationMode.ApiKey;
protected AuthenticationMode authenticationMode = AuthenticationMode.ApiKey;
public AuthenticationMode AuthenticationMode => authenticationMode;
[Header("Credentials")]
[SerializeField]
[Tooltip("The Account ID provided by the Spatial Anchors service portal.")]
private string spatialAnchorsAccountId = "";
protected string spatialAnchorsAccountId = "";
public string SpatialAnchorsAccountId => spatialAnchorsAccountId;
[SerializeField]
[Tooltip("The Account Key provided by the Spatial Anchors service portal.")]
private string spatialAnchorsAccountKey = "";
protected string spatialAnchorsAccountKey = "";
public string SpatialAnchorsAccountKey => spatialAnchorsAccountKey;
[Header("Credentials")]
[SerializeField]
[Tooltip("The Client ID to use when authenticating using Azure Active Directory.")]
private string clientId = "";
protected string clientId = "";
public string ClientId => clientId;
[SerializeField]
[Tooltip("The Tenant ID to use when authenticating using Azure Active Directory.")]
private string tenantId = "";
protected string tenantId = "";
public string TenantId => tenantId;
}
}
......@@ -48,9 +48,9 @@ namespace Microsoft.Azure.SpatialAnchors.Unity
public class SpatialAnchorManager : MonoBehaviour
{
#region Member Variables
private bool isSessionStarted = false;
private CloudSpatialAnchorSession session = null;
private SessionStatus sessionStatus = null;
protected bool isSessionStarted = false;
protected CloudSpatialAnchorSession session = null;
protected SessionStatus sessionStatus = null;
// Android-specific variables
#if UNITY_ANDROID
......@@ -58,13 +58,13 @@ namespace Microsoft.Azure.SpatialAnchors.Unity
#endif
//ARFoundation specific variables
#if UNITY_ANDROID || UNITY_IOS
private long lastFrameProcessedTimeStamp;
private static Dictionary<string, ARAnchor> pointerToReferencePoints = new Dictionary<string, ARAnchor>();
private List<AnchorLocatedEventArgs> pendingEventArgs = new List<AnchorLocatedEventArgs>();
protected long lastFrameProcessedTimeStamp;
protected static Dictionary<string, ARAnchor> pointerToReferencePoints = new Dictionary<string, ARAnchor>();
protected List<AnchorLocatedEventArgs> pendingEventArgs = new List<AnchorLocatedEventArgs>();
internal static ARAnchorManager arReferencePointManager = null;
private ARCameraManager arCameraManager = null;
private ARSession arSession = null;
private Camera mainCamera;
protected ARCameraManager arCameraManager = null;
protected ARSession arSession = null;
protected Camera mainCamera;
#endif // UNITY_ANDROID
#endregion // Member Variables
......@@ -73,37 +73,37 @@ namespace Microsoft.Azure.SpatialAnchors.Unity
[Header("Authentication")]
[SerializeField]
[Tooltip("The method to use for authentication.")]
private AuthenticationMode authenticationMode = AuthenticationMode.ApiKey;
protected AuthenticationMode authenticationMode = AuthenticationMode.ApiKey;
[Header("Credentials")]
[SerializeField]
[Tooltip("The Account ID to use when authenticating using API Key. This is provided by the Spatial Anchors service portal.")]
private string spatialAnchorsAccountId = "";
protected string spatialAnchorsAccountId = "";
[SerializeField]
[Tooltip("The Account Key to use when authenticating using API Key. This is provided by the Spatial Anchors service portal.")]
private string spatialAnchorsAccountKey = "";
protected string spatialAnchorsAccountKey = "";
[Header("Credentials")]
[SerializeField]
[Tooltip("The Client ID to use when authenticating using Azure Active Directory.")]
private string clientId = "";
protected string clientId = "";
[SerializeField]
[Tooltip("The Tenant ID to use when authenticating using Azure Active Directory.")]
private string tenantId = "";
protected string tenantId = "";
[Header("Logging")]
[SerializeField]
[Tooltip("The log level for messages from the Spatial Anchors service.")]
private SessionLogLevel logLevel = SessionLogLevel.All;
protected SessionLogLevel logLevel = SessionLogLevel.All;
#endregion // Unity Inspector Variables
#region Internal Methods
/// <summary>
/// Throws an exception if there is not a currently active session.
/// </summary>
protected void EnsureSessionStarted()
private void EnsureSessionStarted()
{
if (!isSessionStarted)
{
......@@ -111,43 +111,6 @@ namespace Microsoft.Azure.SpatialAnchors.Unity
}
}
/// <summary>
/// Ensures that the manager has a valid configuration.
/// </summary>
/// <param name="disable">
/// If true, the manager will be disabled if configuration is invalid.
/// </param>
/// <param name="exception">
/// If true, an exception will be thrown if configuration is invalid.
/// </param>
private async Task<bool> EnsureValidConfiguration(bool disable, bool exception)
{
if (!await IsValidateConfiguration())
{
// Define message
string msg = $"{nameof(SpatialAnchorManager)} is improperly configured.";
// Disable or except?
if (disable)
{
Debug.LogError(msg + " It has been disabled.");
this.enabled = false;
}
else if (exception)
{
throw new InvalidOperationException(msg);
}
// Not valid
return false;
}
else
{
// Valid!
return true;
}
}
#if UNITY_ANDROID || UNITY_IOS
/// <summary>
/// Sends the latest ARFoundation frame to Azure Spatial Anchors
......@@ -241,6 +204,44 @@ namespace Microsoft.Azure.SpatialAnchors.Unity
#endregion // Internal Methods
#region Overridables
/// <summary>
/// Ensures that the manager has a valid configuration. This
/// method can be customized by inheritors.
/// </summary>
/// <param name="disable">
/// If true, the manager will be disabled if configuration is invalid.
/// </param>
/// <param name="exception">
/// If true, an exception will be thrown if configuration is invalid.
/// </param>
protected virtual async Task<bool> EnsureValidConfiguration(bool disable, bool exception)
{
if (!await IsValidateConfiguration())
{
// Define message
string msg = $"{nameof(SpatialAnchorManager)} is improperly configured.";
// Disable or except?
if (disable)
{
Debug.LogError(msg + " It has been disabled.");
this.enabled = false;
}
else if (exception)
{
throw new InvalidOperationException(msg);
}
// Not valid
return false;
}
else
{
// Valid!
return true;
}
}
/// <summary>
/// Obtains an Azure Active Directory token for the application. This
/// method can be customized by inheritors.
......@@ -258,7 +259,7 @@ namespace Microsoft.Azure.SpatialAnchors.Unity
// TODO: Uncomment the lines below when supporting AAD
/*
#if UNITY_WSA && !UNITY_EDITOR
#if UNITY_WSA && !UNITY_EDITOR
var authority = $"https://login.microsoftonline.com/{TenantId}";
AuthenticationContext authenticationContext = new AuthenticationContext(authority);
......@@ -266,11 +267,11 @@ namespace Microsoft.Azure.SpatialAnchors.Unity
return authenticationResult.AccessToken;
#else
#else
throw new NotSupportedException("Obtaining an AAD token is not supported on this platform.");
#endif
#endif
*/
}
......@@ -343,10 +344,6 @@ namespace Microsoft.Azure.SpatialAnchors.Unity
break;
case AuthenticationMode.AAD:
if (string.IsNullOrWhiteSpace(clientId) || string.IsNullOrWhiteSpace(tenantId))
{
return false;
}
break;
default:
......@@ -545,9 +542,9 @@ namespace Microsoft.Azure.SpatialAnchors.Unity
// Raise the event
SessionUpdated?.Invoke(this, args);
}
#endregion // Overridables
#endregion // Overridables
#region Event Handlers
#region Event Handlers
private async void Session_TokenRequired(object sender, TokenRequiredEventArgs args)
{
// Get the deferral
......@@ -618,9 +615,9 @@ namespace Microsoft.Azure.SpatialAnchors.Unity
ProcessLatestFrame();
}
#endif
#endregion // Event Handlers
#endregion // Event Handlers
#region Unity Overrides
#region Unity Overrides
/// <summary>
/// Awake is called when the script instance is being loaded.
/// </summary>
......@@ -762,6 +759,9 @@ namespace Microsoft.Azure.SpatialAnchors.Unity
#else
throw new NotSupportedException("The platform is not supported.");
#endif
// Notify
OnSessionCreated();
}
/// <summary>
......@@ -1073,7 +1073,7 @@ namespace Microsoft.Azure.SpatialAnchors.Unity
{
return session;
}
private set
protected set
{
if (session != value)
{
......
......@@ -34,6 +34,8 @@ ScriptedImporter:
wrapMode: 0
filterMode: 1
sampleCount: 4
preserveSVGImageAspect: 0
useSVGPixelsPerUnit: 0
spriteData:
TessellationDetail: 0
SpriteRect:
......
......@@ -34,6 +34,8 @@ ScriptedImporter:
wrapMode: 0
filterMode: 1
sampleCount: 4
preserveSVGImageAspect: 0
useSVGPixelsPerUnit: 0
spriteData:
TessellationDetail: 0
SpriteRect:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment