Skip to content

Commit 57cd3ef

Browse files
committed
Release 0.2.0
Develop @f0c20f024ae1aaa0274a242a44ac8ff1961905b3
1 parent 9f2a8d3 commit 57cd3ef

File tree

234 files changed

+6592
-1655
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

234 files changed

+6592
-1655
lines changed

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,3 +57,5 @@ ReferenceProject/Assets/Unity Cloud.meta
5757
ReferenceProject/Assets/Samples
5858
ReferenceProject/Assets/Samples.meta
5959
ReferenceProject/UIElementsSchema
60+
ReferenceProject/Assets/Utilities/Git/Resources
61+
ReferenceProject/Assets/Resources.meta

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ It also leverages Unity services that make it easier to:
7575

7676
### MacOS
7777

78-
To open this Unity project on MacOS, you must have the Xcode commnand line tools installed.
78+
To open this Unity project on MacOS, you must have the Xcode command line tools installed.
7979

8080
1. Open the `Terminal` app on MacOS
8181
2. Enter the following command `xcode-select --install`
@@ -90,9 +90,9 @@ Configuring Unity services typically involves signing into your Unity account an
9090

9191
### Sign into your Unity account
9292

93-
> **Important**: The packages used in this project currently point to services hosted on GCP. When you sign in, ensure the toggle next to the `Sign In` button says `Using GCP`. This will change in an upcoming release that uses newer packages pointing to Azure.
93+
> **Important**: The packages used in this project recently switched to services hosted on Azure. When you sign in, ensure the toggle next to the `Sign In` button says `Using Azure`. If you were using a release prior to version `0.2.0` then you will need to register a new App Id and upload your assets to be processed again.
9494
95-
* To sign in, go to the [Asset Manager](https://dashboard.unity3d.com/digital-twins/).
95+
* To sign in, go to the [Digital Twin dashboard](https://dashboard.unity3d.com/digital-twins/).
9696

9797
### Create an ID for your application
9898

@@ -102,7 +102,7 @@ For your application to function effectively with Unity streaming services and d
102102
103103
To create an `App Id`, follow these steps:
104104

105-
1. Log into the [Asset Manager](https://dashboard.unity3d.com/digital-twins/).
105+
1. Log into the [Digital Twin dashboard](https://dashboard.unity3d.com/digital-twins/) and ensure you have selected "Using Azure".
106106
2. Select **Developer Hub** > **Registered Applications**.
107107
3. Select the **+ Register an application**.
108108
4. Enter the application name in the **App Name** field.
@@ -127,7 +127,7 @@ To access assets in a different organization, change organizations in the upper-
127127

128128
To upload an asset:
129129

130-
1. In the [Asset Manager](https://dashboard.unity3d.com/digital-twins/), select **+ New**.
130+
1. In the [Digital Twin dashboard](https://dashboard.unity3d.com/digital-twins/), select **+ New**.
131131
2. Name the asset.
132132
3. Drag your 3D asset and its dependent files into the upload area.
133133
4. Select **Create**.

ReferenceProject/Assets/Build/DisplayBuildVersion.cs

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
using System;
2+
using System.Text;
3+
using Unity.Cloud.ReferenceProject.Utils.Git;
24
using UnityEngine;
35

46
namespace Unity.DTReferenceProject
@@ -7,25 +9,47 @@ namespace Unity.DTReferenceProject
79
public class DisplayBuildVersion : MonoBehaviour
810
{
911
GUIStyle m_Style;
12+
string m_VersionStr;
13+
string m_GitVersion;
14+
string m_Version;
15+
StringBuilder m_Sb = new StringBuilder();
1016

1117
void OnGUI()
1218
{
1319
m_Style ??= new GUIStyle(GUI.skin.label) { alignment = TextAnchor.MiddleRight };
14-
15-
var versionStr = $"ver. {Application.version}";
16-
17-
var rect = new Rect(0.0f, Screen.height - 20.0f, Screen.width - 10.0f, 20.0f);
20+
if (Application.version != m_Version)
21+
{
22+
m_Version = Application.version;
23+
m_Sb.Append("ver. ");
24+
m_Sb.Append(m_Version);
25+
m_Sb.Append("\n");
26+
}
27+
#if USE_GIT_INFO
28+
if (VersionControlInformation.Instance.CommitHash != m_GitVersion)
29+
{
30+
m_GitVersion = VersionControlInformation.Instance.CommitHash;
31+
m_Sb.Append("hash. ");
32+
m_Sb.Append(m_GitVersion);
33+
}
34+
#endif
35+
if (m_Sb.Length != 0)
36+
{
37+
m_VersionStr = m_Sb.ToString();
38+
m_Sb = m_Sb.Clear();
39+
}
40+
41+
var rect = new Rect(0.0f, Screen.height - 40.0f, Screen.width - 10.0f, 60.0f);
1842

1943
var currentColor = GUI.color;
2044

2145
GUI.color = Color.black;
22-
GUI.Label(rect, versionStr, m_Style);
46+
GUI.Label(rect, m_VersionStr, m_Style);
2347

2448
rect.x -= 1.0f;
2549
rect.y -= 1.0f;
2650

2751
GUI.color = Color.white;
28-
GUI.Label(rect, versionStr, m_Style);
52+
GUI.Label(rect, m_VersionStr, m_Style);
2953

3054
GUI.color = currentColor;
3155
}

ReferenceProject/Assets/Build/Editor/BuildSettingsParser.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
using Unity.Cloud.Common.Runtime;
55
using UnityEditor;
66
using UnityEditor.Build;
7+
#if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
8+
using UnityEditor.OSXStandalone;
9+
#endif
710
using UnityEngine;
811

912
namespace Unity.ReferenceProject.Editor
@@ -106,6 +109,9 @@ void SwitchToRespectiveBuildTarget(string buildTarget)
106109

107110
case BuilderConstants.OSX_BUILD_TARGET:
108111
ActiveBuildTarget = BuildTarget.StandaloneOSX;
112+
#if UNITY_EDITOR_OSX || UNITY_STANDALONE_OSX
113+
UserBuildSettings.architecture = MacOSArchitecture.x64;
114+
#endif
109115
break;
110116

111117
case BuilderConstants.WIN_BUILD_TARGET:

ReferenceProject/Assets/Build/Editor/Builder.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.IO;
33
using System.Text;
4+
using Unity.Cloud.ReferenceProject.Utils.Git;
45
using UnityEditor;
56
using UnityEditor.Build.Reporting;
67
using UnityEngine;
@@ -12,6 +13,9 @@ public static class Builder
1213
// CI Entry point
1314
static void PerformBuild()
1415
{
16+
#if USE_GIT_INFO
17+
GitVersionControlEditor.UpdateGitHashShort();
18+
#endif
1519
var buildSettings = new BuildSettingsParser();
1620
buildSettings.StartParsing();
1721

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
using System.Collections;
2+
using System.Collections.Generic;
3+
using Unity.ReferenceProject.Navigation;
4+
using UnityEngine;
5+
6+
namespace Unity.ReferenceProject.Editor
7+
{
8+
using UnityEditor;
9+
using UnityEngine;
10+
11+
[CustomEditor(typeof(CameraViewDataDefault))]
12+
public class CameraViewDataDefaultEditor : Editor
13+
{
14+
SerializedProperty m_Icon;
15+
SerializedProperty m_ViewName;
16+
SerializedProperty m_UseDefaultView;
17+
SerializedProperty m_AngleRotation;
18+
19+
void OnEnable()
20+
{
21+
m_Icon = serializedObject.FindProperty("m_Icon");
22+
m_ViewName = serializedObject.FindProperty("m_ViewName");
23+
m_UseDefaultView = serializedObject.FindProperty("m_UseDefaultView");
24+
m_AngleRotation = serializedObject.FindProperty("m_AngleRotation");
25+
}
26+
27+
public override void OnInspectorGUI()
28+
{
29+
serializedObject.Update();
30+
EditorGUILayout.PropertyField(m_Icon);
31+
EditorGUILayout.PropertyField(m_ViewName);
32+
EditorGUILayout.PropertyField(m_UseDefaultView);
33+
34+
if (m_UseDefaultView.boolValue)
35+
{
36+
GUI.enabled = false;
37+
}
38+
39+
EditorGUILayout.PropertyField(m_AngleRotation);
40+
GUI.enabled = true;
41+
serializedObject.ApplyModifiedProperties();
42+
}
43+
}
44+
}
Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 87 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
1+
using System;
2+
using System.Linq;
3+
using UnityEditor;
4+
using UnityEngine;
5+
using UnityEngine.Rendering;
6+
using UnityEngine.Rendering.Universal;
7+
8+
namespace Unity.ReferenceProject.Editor
9+
{
10+
public class QuestProjectSettings : UnityEditor.Editor
11+
{
12+
static string s_PipeLineName = "URP-Performant";
13+
static readonly AndroidSdkVersions s_MinAndroidVersion = AndroidSdkVersions.AndroidApiLevel29;
14+
15+
[MenuItem("ReferenceProject/VR/Switch to Quest project", false, 10)]
16+
public static void Switch2Quest()
17+
{
18+
EnsureAndroidBuildTarget();
19+
20+
SetupVR.SetupOpenXR(SetupVR.DeviceTarget.Standalone); // Added to be able to test in Editor
21+
SetupVR.SetupOpenXR(SetupVR.DeviceTarget.Quest);
22+
SetupVR.SetVRBuildScenes();
23+
24+
try
25+
{
26+
EditorApplication.LockReloadAssemblies();
27+
try
28+
{
29+
PrepareRendererPipelineAsset();
30+
SetAndroidSettings();
31+
}
32+
finally
33+
{
34+
EditorApplication.UnlockReloadAssemblies();
35+
}
36+
37+
AssetDatabase.Refresh(ImportAssetOptions.ForceSynchronousImport);
38+
Debug.Log("Switch to Quest finished with success");
39+
}
40+
catch (Exception e)
41+
{
42+
Debug.LogError($"Quest 2 settings could not be set: {e.GetType().Name}; {e.Message}; {e.StackTrace}");
43+
}
44+
}
45+
46+
static void EnsureAndroidBuildTarget()
47+
{
48+
if (EditorUserBuildSettings.activeBuildTarget != BuildTarget.Android || EditorUserBuildSettings.selectedBuildTargetGroup != BuildTargetGroup.Android)
49+
{
50+
EditorUserBuildSettings.SwitchActiveBuildTarget(BuildTargetGroup.Android, BuildTarget.Android);
51+
AssetDatabase.Refresh(ImportAssetOptions.ForceSynchronousImport);
52+
}
53+
}
54+
55+
static void PrepareRendererPipelineAsset()
56+
{
57+
foreach (var pipeline in GraphicsSettings.allConfiguredRenderPipelines.OfType<UniversalRenderPipelineAsset>())
58+
{
59+
if (pipeline.name == s_PipeLineName)
60+
{
61+
GraphicsSettings.defaultRenderPipeline = pipeline;
62+
EditorUtility.SetDirty(pipeline);
63+
AssetDatabase.SaveAssetIfDirty(pipeline);
64+
return;
65+
}
66+
}
67+
}
68+
69+
static void SetAndroidSettings()
70+
{
71+
// Enable multi-threaded rendering
72+
PlayerSettings.SetMobileMTRendering(BuildTargetGroup.Android, true);
73+
74+
// Set Minimum Android version
75+
// https://developer.oculus.com/documentation/native/android/mobile-application-signing/
76+
if (PlayerSettings.Android.minSdkVersion < s_MinAndroidVersion || PlayerSettings.Android.targetSdkVersion < s_MinAndroidVersion)
77+
{
78+
PlayerSettings.Android.minSdkVersion = s_MinAndroidVersion;
79+
}
80+
81+
PlayerSettings.Android.androidTVCompatibility = false;
82+
PlayerSettings.Android.preferredInstallLocation = AndroidPreferredInstallLocation.Auto;
83+
PlayerSettings.Android.targetArchitectures = AndroidArchitecture.ARM64;
84+
PlayerSettings.SetGraphicsAPIs(BuildTarget.Android, new[] { GraphicsDeviceType.OpenGLES3, GraphicsDeviceType.Vulkan });
85+
}
86+
}
87+
}

ReferenceProject/Assets/Editor/Scripts/QuestProjectSettings.cs.meta

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)