GeneratePrefab.cs 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  1. using UnityEngine;
  2. using UnityEditor;
  3. using Ximmerse.XR.InputSystems.GazeAndGestureInteraction;
  4. using Unity.XR.CoreUtils;
  5. using Ximmerse.XR;
  6. using Ximmerse.XR.Tag;
  7. public class GeneratePrefab
  8. {
  9. [MenuItem("GameObject/Ximmerse XR/XR Origin (ActionBase)", false,0)]
  10. [MenuItem("Component/Ximmerse XR/XR Origin (ActionBase)", false, 0)]
  11. public static void GenerateXROriginActionBase()
  12. {
  13. GameObject go = GameObject.Instantiate(Resources.Load("XR Origin (ActionBase)")) as GameObject;
  14. go.name = "XR Origin (ActionBase)";
  15. }
  16. [MenuItem("GameObject/Ximmerse XR/XR Origin (Device Base)", false, 1)]
  17. [MenuItem("Component/Ximmerse XR/XR Origin (Device Base)", false, 1)]
  18. public static void GenerateXROriginDeviceBase()
  19. {
  20. GameObject go = GameObject.Instantiate(Resources.Load("XR Origin (Device Base)")) as GameObject;
  21. go.name = "XR Origin (Device Base)";
  22. }
  23. [MenuItem("GameObject/Ximmerse XR/Tag Profile Loading", false, 3)]
  24. [MenuItem("Component/Ximmerse XR/Tag Profile Loading", false, 3)]
  25. public static void GenerateTagLoading()
  26. {
  27. GameObject go = GameObject.Instantiate(Resources.Load("Tag/Prefabs/Tag Profile Loading")) as GameObject;
  28. go.name = "Tag Profile Loading";
  29. }
  30. [MenuItem("GameObject/Ximmerse XR/Creates Ground Plane By Json", false, 4)]
  31. [MenuItem("Component/Ximmerse XR/Creates Ground Plane By Json", false, 4)]
  32. public static void GenerateCreatesGroundPlane()
  33. {
  34. GameObject go = GameObject.Instantiate(Resources.Load("Tag/Prefabs/Creates Ground Plane By Json")) as GameObject;
  35. go.name = "Creates Ground Plane By Json";
  36. }
  37. [MenuItem("GameObject/Ximmerse XR/Tracking Target", false, 5)]
  38. [MenuItem("Component/Ximmerse XR/Tracking Target", false, 5)]
  39. public static void GenerateTagTracking()
  40. {
  41. TagTracking go = new GameObject("Tracking Target").AddComponent<TagTracking>();
  42. }
  43. [MenuItem("GameObject/Ximmerse XR/Ground Plane", false, 6)]
  44. [MenuItem("Component/Ximmerse XR/Ground Plane", false, 6)]
  45. public static void GenerateTagGround()
  46. {
  47. TagGroundPlane go = new GameObject("Ground Plane").AddComponent<TagGroundPlane>();
  48. }
  49. [MenuItem("GameObject/Ximmerse XR/EyeRay", false, 7)]
  50. [MenuItem("Component/Ximmerse XR/EyeRay", false, 7)]
  51. public static void GenerateEyeRay()
  52. {
  53. GameObject eyeRay = GameObject.Instantiate(Resources.Load("Gesture/Prefabs/Eye Ray")) as GameObject;
  54. eyeRay.name = "Eye Ray";
  55. eyeRay.transform.parent = Object.FindObjectOfType<XROrigin>().CameraFloorOffsetObject.transform;
  56. }
  57. [MenuItem("GameObject/Ximmerse XR/Gaze And Hand Interaction System", false, 8)]
  58. [MenuItem("Component/Ximmerse XR/Gaze And Hand Interaction System", false, 8)]
  59. public static void GenerateGazeAndHandInteractionSystem()
  60. {
  61. GazeAndHandInteractionSystem go = new GameObject("Gaze And Hand Interaction System").AddComponent<GazeAndHandInteractionSystem>();
  62. }
  63. [MenuItem("GameObject/Ximmerse XR/Virtual Hand Model", false, 9)]
  64. [MenuItem("Component/Ximmerse XR/Virtual Hand Model", false, 9)]
  65. public static void GenerateVirtualHandModel()
  66. {
  67. GameObject go = GameObject.Instantiate(Resources.Load("Gesture/Prefabs/Virtual Hand Model")) as GameObject;
  68. go.name = "Virtual Hand Model";
  69. }
  70. }