Skip to content

Commit

Permalink
Remove old manual sample import prompt
Browse files Browse the repository at this point in the history
  • Loading branch information
bnco-dev committed Mar 27, 2024
1 parent ae6b599 commit 072abea
Show file tree
Hide file tree
Showing 26 changed files with 84 additions and 402 deletions.
2 changes: 1 addition & 1 deletion Unity/Assets/Ubiq/Editor/Avatars/AvatarEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Ubiq.Avatars
{
[CustomEditor(typeof(Avatar))]
public class AvatarEditor : Editor
public class AvatarEditor : UnityEditor.Editor
{
public override void OnInspectorGUI()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Ubiq.Samples
{
[CustomEditor(typeof(TexturedAvatar))]
public class TexturedAvatarEditor : Editor
public class TexturedAvatarEditor : UnityEditor.Editor
{
public override void OnInspectorGUI()
{
Expand Down
2 changes: 1 addition & 1 deletion Unity/Assets/Ubiq/Editor/Logging/LogCollectorEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Ubiq.Logging
{
[CustomEditor(typeof(LogCollector))]
public class LogCollectorEditor : Editor
public class LogCollectorEditor : UnityEditor.Editor
{
public override void OnInspectorGUI()
{
Expand Down
4 changes: 2 additions & 2 deletions Unity/Assets/Ubiq/Editor/Messaging/LatencyMeterEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,14 @@
namespace Ubiq.Messaging
{
[CustomEditor(typeof(LatencyMeter))]
public class LatencyMeterEditor : Editor
public class LatencyMeterEditor : UnityEditor.Editor
{
public override void OnInspectorGUI()
{
base.OnInspectorGUI();

EditorGUI.BeginDisabledGroup(!Application.isPlaying);

var component = target as LatencyMeter;
if (GUILayout.Button("Measure Latencies"))
{
Expand Down
2 changes: 1 addition & 1 deletion Unity/Assets/Ubiq/Editor/Messaging/NetworkSceneEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace Ubiq.Messaging
{
[CustomEditor(typeof(NetworkScene))]
public class NetworkSceneEditor : Editor
public class NetworkSceneEditor : UnityEditor.Editor
{
public override void OnInspectorGUI()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace Ubiq.Networking
{
[CustomEditor(typeof(ConnectionDefinition))]
public class ConnectionDefinitionEditor : Editor
public class ConnectionDefinitionEditor : UnityEditor.Editor
{
private ReorderableList platformsReorderableList;
private SerializedProperty platformsProperty;
Expand Down
4 changes: 2 additions & 2 deletions Unity/Assets/Ubiq/Editor/Packages/AddPackageWebRTC.cs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#if !UNITY_WEBRTC_NO_VULKAN_HOOK && !(UNITY_WEBRTC && UBIQ_DISABLE_WEBRTCCOMPATIBILITYCHECK)
using UnityEngine;
using UnityEditor;
using UbiqEditor;
using Ubiq.Editor;

namespace UbiqEditor
namespace Ubiq.Editor
{
[InitializeOnLoad]
public class AddPackageWebRTC
Expand Down
2 changes: 1 addition & 1 deletion Unity/Assets/Ubiq/Editor/Packages/PackageManagerHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using System.Text;
using Unity.EditorCoroutines.Editor;

namespace UbiqEditor
namespace Ubiq.Editor
{
public static class PackageManagerHelper
{
Expand Down
2 changes: 1 addition & 1 deletion Unity/Assets/Ubiq/Editor/Rooms/RoomClientEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
namespace Ubiq.Rooms
{
[CustomEditor(typeof(RoomClient))]
public class RoomClientEditor : Editor
public class RoomClientEditor : UnityEditor.Editor
{
private ReorderableList managerReorderableList;
private SerializedProperty serversProperty;
Expand Down
2 changes: 1 addition & 1 deletion Unity/Assets/Ubiq/Editor/Scenes/SceneInfoEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
namespace Ubiq.Samples
{
[CustomEditor(typeof(SceneInfo))]
public class SceneInfoEditor : Editor
public class SceneInfoEditor : UnityEditor.Editor
{
public override void OnInspectorGUI()
{
Expand Down
2 changes: 1 addition & 1 deletion Unity/Assets/Ubiq/Editor/Spawning/PrefabCatalogueEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
namespace Ubiq.Spawning
{
[CustomEditor(typeof(PrefabCatalogue))]
public class PrefabCatalogueEditor : Editor
public class PrefabCatalogueEditor : UnityEditor.Editor
{
private ReorderableList prefabsReorderableList;
// private SerializedProperty uuids;
Expand Down
2 changes: 1 addition & 1 deletion Unity/Assets/Ubiq/Editor/Voip/VoipPeerConnectionEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
namespace Ubiq.Voip
{
[CustomEditor(typeof(VoipPeerConnection))]
public class VoipPeerConnectionEditor : Editor
public class VoipPeerConnectionEditor : UnityEditor.Editor
{
public override void OnInspectorGUI()
{
Expand Down
8 changes: 8 additions & 0 deletions Unity/Assets/Ubiq/Editor/XRI.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 34 additions & 0 deletions Unity/Assets/Ubiq/Editor/XRI/Ubiq.Editor.XRI.asmdef
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"name": "Ubiq.Editor.XRI",
"rootNamespace": "",
"references": [
"GUID:ab979a98ba0be4546bceb48f770b11c8",
"GUID:a8b0ee606e2d3ea47a04b62a948d4604",
"GUID:fe685ec1767f73d42b749ea8045bfe43"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": true,
"defineConstraints": [],
"versionDefines": [
{
"name": "com.unity.xr.interaction.toolkit",
"expression": "0.0.0",
"define": "XRI_0_0_0_OR_NEWER"
},
{
"name": "com.unity.xr.interaction.toolkit",
"expression": "2.5.2",
"define": "XRI_2_5_2_OR_NEWER"
},
{
"name": "com.unity.xr.interaction.toolkit",
"expression": "2.5.3",
"define": "XRI_2_5_3_OR_NEWER"
}
],
"noEngineReferences": false
}
7 changes: 7 additions & 0 deletions Unity/Assets/Ubiq/Editor/XRI/Ubiq.Editor.XRI.asmdef.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -1,22 +1,9 @@
using UnityEngine;
using UnityEditor;
using UbiqEditor;

namespace Ubiq.Samples.WebXR.Editor
namespace Ubiq.Editor.XRI
{
[InitializeOnLoad]
public class AddPackageXRI_WebXR
public static class XRIImportHelper
{
static AddPackageXRI_WebXR()
public static void Import()
{
// Custom for WebXR sample begins
if (RequireSamplesXRIUtil.AssetExistsFromGUID(RequireSamplesXRIUtil.DEMO_SCENE_GUID))
{
// XRI sample is already in the project, let that handle it
return;
}
// Custom for WebXR sample ends

#if XRI_2_5_3_OR_NEWER && XRI_0_0_0_OR_NEWER
#if !UBIQ_SILENCEWARNING_XRIVERSION
Debug.LogWarning(
Expand All @@ -27,19 +14,13 @@ static AddPackageXRI_WebXR()
" symbols");
#endif
#endif
// Safer to interact with Unity on main thread
EditorApplication.update += Update;
}

static void Update()
{
#if !XRI_0_0_0_OR_NEWER
PackageManagerHelper.AddPackage("com.unity.xr.interaction.toolkit@2.5.2");
#else
PackageManagerHelper.RequireSample("com.unity.xr.interaction.toolkit","Starter Assets");
PackageManagerHelper.RequireSample("com.unity.xr.interaction.toolkit","XR Device Simulator");
#endif
EditorApplication.update -= Update;
}
}
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 6 additions & 1 deletion Unity/Assets/Ubiq/Runtime/XRI/Ubiq.XRI.asmdef
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "Ubiq.Examples.Players",
"name": "Ubiq.XRI",
"rootNamespace": "",
"references": [
"GUID:ab979a98ba0be4546bceb48f770b11c8",
Expand All @@ -22,6 +22,11 @@
"name": "com.unity.xr.interaction.toolkit",
"expression": "2.5.2",
"define": "XRI_2_5_2_OR_NEWER"
},
{
"name": "com.unity.xr.interaction.toolkit",
"expression": "2.5.3",
"define": "XRI_2_5_3_OR_NEWER"
}
],
"noEngineReferences": false
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using UnityEngine;
using UnityEditor;
using UbiqEditor;
using Ubiq.Editor.XRI;

namespace Ubiq.Samples.Demo.Editor
{
Expand All @@ -9,28 +8,13 @@ public class AddPackageXRI
{
static AddPackageXRI()
{
#if XRI_2_5_3_OR_NEWER && XRI_0_0_0_OR_NEWER
#if !UBIQ_SILENCEWARNING_XRIVERSION
Debug.LogWarning(
"Ubiq sample DemoScene (XRI) requires XRI = 2.5.2, but a" +
" different version is installed. The sample may not work" +
" correctly. To silence this warning, add the string" +
" UBIQ_SILENCEWARNING_XRIVERSION to your scripting define" +
" symbols");
#endif
#endif
// Safer to interact with Unity on main thread
EditorApplication.update += Update;
}

static void Update()
{
#if !XRI_0_0_0_OR_NEWER
PackageManagerHelper.AddPackage("com.unity.xr.interaction.toolkit@2.5.2");
#else
PackageManagerHelper.RequireSample("com.unity.xr.interaction.toolkit","Starter Assets");
PackageManagerHelper.RequireSample("com.unity.xr.interaction.toolkit","XR Device Simulator");
#endif
XRIImportHelper.Import();
EditorApplication.update -= Update;
}
}
Expand Down
Loading

0 comments on commit 072abea

Please sign in to comment.