PhysicsRayConf.cs 998 B

12345678910111213141516171819202122232425262728293031323334353637
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. #if UNITY_EDITOR
  4. using UnityEditor;
  5. #endif
  6. using UnityEngine;
  7. using XRTool.Util;
  8. namespace XRTool.WorldUI
  9. {
  10. public class PhysicsRayConf : ScriptableObject
  11. {
  12. public LayerMask eventMask;
  13. #if UNITY_EDITOR
  14. [MenuItem("Assets/Create/DataBase/PhysicsRayConf", false, 0)]
  15. static void CreateDynamicConf()
  16. {
  17. Object obj = Selection.activeObject;
  18. if (obj)
  19. {
  20. string path = AssetDatabase.GetAssetPath(obj);
  21. PhysicsRayConf bullet = CreateInstance<PhysicsRayConf>();
  22. if (bullet)
  23. {
  24. string confName = UnityUtil.TryGetName<PhysicsRayConf>(path);
  25. AssetDatabase.CreateAsset(bullet, confName);
  26. }
  27. else
  28. {
  29. Debug.Log(typeof(PhysicsRayConf) + " is null");
  30. }
  31. }
  32. }
  33. #endif
  34. }
  35. }