ARAbilities.cs 925 B

12345678910111213141516171819202122232425
  1. using EZXR.Glass.Rendering;
  2. using UnityEditor;
  3. using UnityEngine;
  4. namespace EZXR.Glass.Core
  5. {
  6. public partial class ARAbilities : MonoBehaviour
  7. {
  8. #region PhoneScreenUI(针对分体式眼镜)
  9. [MenuItem("GameObject/XR Abilities/Additional.../PhoneScreenUI", false, 90)]
  10. public static void EnablePhoneScreenUI()
  11. {
  12. if (FindObjectOfType<PhoneUIRenderer>() == null)
  13. {
  14. string filePath = "Assets/EZXRGlassSDK/Core/Shared/Resources/PhoneScreenUI.prefab";
  15. if (AssetDatabase.LoadAssetAtPath<GameObject>(filePath) == null)
  16. {
  17. filePath = AssetDatabase.GUIDToAssetPath("cfbaf50af0b162b4ebe2e4180ff35950");
  18. }
  19. Core.PrefabUtility.InstantiatePrefabWithUndoAndSelection(AssetDatabase.LoadAssetAtPath<GameObject>(filePath));
  20. }
  21. }
  22. #endregion
  23. }
  24. }