11// Copyright (c) Microsoft Corporation. All rights reserved.
22// Licensed under the MIT License. See LICENSE in the project root for license information.
33
4+ using Microsoft . MixedReality . Toolkit . Utilities ;
45using Microsoft . MixedReality . Toolkit . Utilities . Editor ;
56using System . Collections . Generic ;
67using UnityEditor ;
@@ -40,7 +41,7 @@ public static class InputMappingAxisUtility
4041 /// <param name="axisMappings">Optional array of Axis Mappings, to configure your own custom set</param>
4142 public static void CheckUnityInputManagerMappings ( InputManagerAxis [ ] axisMappings )
4243 {
43- AssureInputManagerReference ( ) ;
44+ EnsureInputManagerReference ( ) ;
4445
4546 if ( axisMappings != null )
4647 {
@@ -65,7 +66,7 @@ public static void CheckUnityInputManagerMappings(InputManagerAxis[] axisMapping
6566 /// <param name="axisMappings">Optional array of Axis Mappings, to configure your own custom set</param>
6667 public static void RemoveMappings ( InputManagerAxis [ ] axisMappings )
6768 {
68- AssureInputManagerReference ( ) ;
69+ EnsureInputManagerReference ( ) ;
6970
7071 if ( axisMappings != null )
7172 {
@@ -83,7 +84,7 @@ public static void RemoveMappings(InputManagerAxis[] axisMappings)
8384
8485 private static void AddAxis ( InputManagerAxis axis )
8586 {
86- AssureInputManagerReference ( ) ;
87+ EnsureInputManagerReference ( ) ;
8788
8889 SerializedProperty axesProperty = inputManagerAsset . FindProperty ( "m_Axes" ) ;
8990
@@ -149,7 +150,7 @@ private static void AddAxis(InputManagerAxis axis)
149150
150151 private static void RemoveAxis ( string axis )
151152 {
152- AssureInputManagerReference ( ) ;
153+ EnsureInputManagerReference ( ) ;
153154
154155 SerializedProperty axesProperty = inputManagerAsset . FindProperty ( "m_Axes" ) ;
155156
@@ -169,7 +170,7 @@ private static void RemoveAxis(string axis)
169170 /// </summary>
170171 public static bool DoesAxisNameExist ( string axisName )
171172 {
172- AssureInputManagerReference ( ) ;
173+ EnsureInputManagerReference ( ) ;
173174
174175 if ( AxisNames . Count == 0 || inputManagerAsset . UpdateIfRequiredOrScript ( ) )
175176 {
@@ -184,7 +185,7 @@ public static bool DoesAxisNameExist(string axisName)
184185 /// </summary>
185186 private static void RefreshLocalAxesList ( )
186187 {
187- AssureInputManagerReference ( ) ;
188+ EnsureInputManagerReference ( ) ;
188189
189190 AxisNames . Clear ( ) ;
190191
@@ -196,12 +197,12 @@ private static void RefreshLocalAxesList()
196197 }
197198 }
198199
199- private static void AssureInputManagerReference ( )
200+ private static void EnsureInputManagerReference ( )
200201 {
201202 if ( inputManagerAsset == null )
202203 {
203204 // Grabs the actual asset file into a SerializedObject, so we can iterate through it and edit it.
204- inputManagerAsset = new SerializedObject ( AssetDatabase . LoadAssetAtPath ( "ProjectSettings/ InputManager.asset" , typeof ( UnityEngine . Object ) ) ) ;
205+ inputManagerAsset = MixedRealityOptimizeUtils . GetSettingsObject ( " InputManager" ) ;
205206 }
206207 }
207208
0 commit comments