Skip to content
This repository has been archived by the owner on Aug 11, 2024. It is now read-only.

Commit

Permalink
Consolidate and clean up editor assembly (#753)
Browse files Browse the repository at this point in the history
* Fix XRTK.Editor.Rendering namespace

* Move USB utilities to editor assembly

* Remove USB utilities from Runtime assembly hierarchy

* Remove editor utilities from Runtime assembly and move to editor assembly

* Remove redundanct license file in Tests folder

* Move check for axis mappings to editor utility

* Move build tools to editor assembly

* Fix namespaces

* Adds log for updated axis mappings

* Fix core path finder location in strings

* Update submodules
  • Loading branch information
FejZa authored Jan 14, 2021
1 parent 2066d3f commit f2a5e7c
Show file tree
Hide file tree
Showing 75 changed files with 281 additions and 308 deletions.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@
using System.IO;
using UnityEditor;
using UnityEngine;
using XRTK.Utilities.Editor;
using XRTK.Editor.Utilities;

namespace XRTK.Utilities.Build
namespace XRTK.Editor.BuildAndDeploy
{
/// <summary>
/// Build and Deploy Specific Editor Preferences for the Build and Deploy Window.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
using System.Xml;
using UnityEditor;
using UnityEngine;
using XRTK.Utilities.Editor;
using XRTK.Utilities.Editor.Usb;
using XRTK.Editor.Utilities;
using XRTK.Editor.Utilities.USB;
using XRTK.Utilities.Gltf;
using XRTK.Utilities.WebRequestRest;
using XRTK.Utilities.WindowsDevicePortal;
using XRTK.Utilities.WindowsDevicePortal.DataStructures;
using Debug = UnityEngine.Debug;
using FileInfo = System.IO.FileInfo;

namespace XRTK.Utilities.Build
namespace XRTK.Editor.BuildAndDeploy
{
/// <summary>
/// Build window - supports SLN creation, APPX from SLN, Deploy on device, and misc helper utilities associated with the build/deploy/test iteration loop
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using UnityEditor.Build.Reporting;
using UnityEngine;

namespace XRTK.Utilities.Build
namespace XRTK.Editor.BuildAndDeploy
{
public class BuildInfo : IBuildInfo
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using System.Linq;
using UnityEditor;

namespace XRTK.Utilities.Build
namespace XRTK.Editor.BuildAndDeploy
{
public static class BuildInfoExtensions
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
using UnityEditor.Build.Reporting;
using UnityEngine;

namespace XRTK.Utilities.Build
namespace XRTK.Editor.BuildAndDeploy
{
/// <summary>
/// The Build Info defines common properties for a build.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
using XRTK.Extensions;
using Debug = UnityEngine.Debug;

namespace XRTK.Utilities.Build
namespace XRTK.Editor.BuildAndDeploy
{
/// <summary>
/// Class containing various utility methods to build a lumin mpk installer from a Unity project.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System;

namespace XRTK.Utilities.Build
namespace XRTK.Editor.BuildAndDeploy
{
/// <summary>
/// Build profile for saving 3d app icon's path in the build settings.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@
using UnityEditor.Build.Reporting;
using UnityEngine;
using XRTK.Extensions;
using XRTK.Utilities.Editor;
using XRTK.Editor.Utilities;
using Debug = UnityEngine.Debug;

namespace XRTK.Utilities.Build
namespace XRTK.Editor.BuildAndDeploy
{
/// <summary>
/// Cross platform player build tools
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
using UnityEditor;
using UnityEngine;
using XRTK.Extensions;
using XRTK.Utilities.Editor;
using XRTK.Editor.Utilities;
using Debug = UnityEngine.Debug;

namespace XRTK.Utilities.Build
namespace XRTK.Editor.BuildAndDeploy
{
public static class UwpAppxBuildTools
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
using System;
using System.IO;
using UnityEngine;
using XRTK.Utilities.Editor;
using XRTK.Editor.Utilities;
using XRTK.Utilities.WindowsDevicePortal.DataStructures;

namespace XRTK.Utilities.Build
namespace XRTK.Editor.BuildAndDeploy
{
public static class UwpBuildDeployPreferences
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

using UnityEditor;

namespace XRTK.Utilities.Build
namespace XRTK.Editor.BuildAndDeploy
{
public class UwpBuildInfo : BuildInfo
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
using System.Threading.Tasks;
using UnityEditor;
using UnityEditor.Build.Reporting;
using XRTK.Utilities.Editor;
using XRTK.Editor.Utilities;

namespace XRTK.Utilities.Build
namespace XRTK.Editor.BuildAndDeploy
{
/// <summary>
/// Class containing various utility methods to build a WSA solution from a Unity project.
Expand Down
5 changes: 2 additions & 3 deletions Editor/ControllerPopupWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
using XRTK.Interfaces.Providers.Controllers.Hands;
using XRTK.Providers.Controllers.OpenVR;
using XRTK.Providers.Controllers.UnityInput;
using XRTK.Utilities.Editor;

namespace XRTK.Editor
{
Expand Down Expand Up @@ -106,7 +105,7 @@ private void OnFocus()
Close();
}

currentControllerTexture = ControllerMappingLibrary.GetControllerTexture(controllerDataProviderProfile);
currentControllerTexture = ControllerMappingUtilities.GetControllerTexture(controllerDataProviderProfile);
}

/// <summary>
Expand Down Expand Up @@ -136,7 +135,7 @@ public static void Show(MixedRealityControllerMappingProfile profile, Serialized
window.titleContent = new GUIContent($"{window.currentControllerName} {handednessTitleText}Input Action Assignment");
window.controllerDataProviderProfile = profile;
window.currentInteractionProfiles = interactionMappingProfiles;
window.currentControllerTexture = ControllerMappingLibrary.GetControllerTexture(profile);
window.currentControllerTexture = ControllerMappingUtilities.GetControllerTexture(profile);

isMouseInRects = new bool[interactionMappingProfiles.arraySize];

Expand Down
36 changes: 36 additions & 0 deletions Editor/EditorActiveProfileChangeHandler.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
// Copyright (c) XRTK. All rights reserved.
// Licensed under the MIT License. See LICENSE in the project root for license information.

using UnityEditor;
using UnityEngine;
using XRTK.Extensions;
using XRTK.Services;

namespace XRTK.Editor
{
[InitializeOnLoad]
public static class EditorActiveProfileChangeHandler
{
static EditorActiveProfileChangeHandler()
{
EditorApplication.hierarchyChanged += EditorApplication_hierarchyChanged;
}

private static void EditorApplication_hierarchyChanged()
{
if (!MixedRealityToolkit.Instance.IsNull())
{
if (MixedRealityToolkit.Instance.ActiveProfile.IsInputSystemEnabled &&
Utilities.InputMappingAxisUtility.CheckUnityInputManagerMappings(Utilities.ControllerMappingUtilities.UnityInputManagerAxes))
{
Debug.Log("XRTK Input System was enabled, updated input axis mappings.");
}
else if (!MixedRealityToolkit.Instance.ActiveProfile.IsInputSystemEnabled &&
Utilities.InputMappingAxisUtility.RemoveMappings(Utilities.ControllerMappingUtilities.UnityInputManagerAxes))
{
Debug.Log("XRTK Input System was disabled, removed input axis mappings.");
}
}
}
}
}
11 changes: 11 additions & 0 deletions Editor/EditorActiveProfileChangeHandler.cs.meta

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

2 changes: 1 addition & 1 deletion Editor/MixedRealityPreferences.cs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
using XRTK.Editor.Utilities.SymbolicLinks;
using XRTK.Editor.Extensions;
using XRTK.Extensions;
using XRTK.Utilities.Editor;
using XRTK.Editor.Utilities;

namespace XRTK.Editor
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
using System.Runtime.InteropServices;
using XRTK.Editor.Extensions;
using XRTK.Editor.PropertyDrawers;
using XRTK.Editor.Utilities;

namespace XRTK.Editor.Profiles.InputSystem.Controllers
{
Expand Down Expand Up @@ -283,7 +284,7 @@ internal void RenderControllerMappingButton(MixedRealityControllerMappingProfile
typeName = "HoloLens 1";
}

var buttonContent = new GUIContent($"Edit {typeName} Action Mapping", ControllerMappingLibrary.GetControllerTextureScaled(controllerMappingProfile));
var buttonContent = new GUIContent($"Edit {typeName} Action Mapping", ControllerMappingUtilities.GetControllerTextureScaled(controllerMappingProfile));
if (GUILayout.Button(buttonContent, ControllerButtonStyle, GUILayout.Height(128f), GUILayout.MinWidth(32f), GUILayout.ExpandWidth(true)))
{
EditorApplication.delayCall += () => ControllerPopupWindow.Show(controllerMappingProfile, new SerializedObject(controllerMappingProfile).FindProperty("interactionMappingProfiles"));
Expand Down
2 changes: 1 addition & 1 deletion Editor/Utilities/ChannelPackerWindow.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
using UnityEditor;
using UnityEngine;

namespace XRTK.Editor
namespace XRTK.Editor.Utilities
{
public class ChannelPackerWindow : EditorWindow
{
Expand Down
Loading

0 comments on commit f2a5e7c

Please sign in to comment.