1234567891011121314151617181920212223242526272829303132333435363738394041 |
- using UnityEditor;
- using UnityEngine;
- using UnityEngine.EventSystems;
- namespace EZXR.Glass.Core
- {
- public partial class ARAbilities : MonoBehaviour
- {
- #region InputSystem
- [MenuItem("GameObject/XR Abilities/InputSystem", false, 20)]
- public static void EnableInputSystem()
- {
- if (FindObjectOfType<EZXR.Glass.Inputs.InputSystem>() == null)
- {
- string filePath = "Assets/EZXRGlassSDK/Core/InputSystem/Prefabs/InputSystem.prefab";
- if (AssetDatabase.LoadAssetAtPath<GameObject>(filePath) == null)
- {
- filePath = AssetDatabase.GUIDToAssetPath("4c1509f78a7904c9980227d2731ebe61");
- }
- Core.PrefabUtility.InstantiatePrefabWithUndoAndSelection(AssetDatabase.LoadAssetAtPath<GameObject>(filePath));
- }
- }
- #endregion
- #region EventSystem
- [MenuItem("GameObject/XR Abilities/Additional.../EventSystem", false, 20)]
- public static void EnableEventSystem()
- {
- if (FindObjectOfType<HandInputModule>() == null)
- {
- string filePath = "Assets/EZXRGlassSDK/Core/HandTracking/Resources/EventSystem.prefab";
- if (AssetDatabase.LoadAssetAtPath<GameObject>(filePath) == null)
- {
- filePath = AssetDatabase.GUIDToAssetPath("6e33b2edc7ac4784ebe0163210ea60f2");
- }
- Core.PrefabUtility.InstantiatePrefabWithUndoAndSelection(AssetDatabase.LoadAssetAtPath<GameObject>(filePath));
- }
- }
- #endregion
- }
- }
|