PropertyInScene.cs 723 B

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using UnityEngine;
  3. [AddComponentMenu("FantaBlade/添加一个Editor模式显示编辑器")]
  4. public class PropertyInScene : MonoBehaviour
  5. {
  6. private void OnDrawGizmos()
  7. {
  8. if (string.IsNullOrEmpty(this.property))
  9. {
  10. this.property = base.name;
  11. }
  12. if (this.show)
  13. {
  14. DebugX.DrawText(this.property, base.transform.position);
  15. if (this.showGizmos)
  16. {
  17. Color col = this.color;
  18. DebugX.DrawPoint(base.transform.position, col, 0.1f);
  19. }
  20. }
  21. }
  22. [SerializeField]
  23. public bool show = true;
  24. [SerializeField]
  25. public bool showGizmos = true;
  26. [SerializeField]
  27. public string property;
  28. [SerializeField]
  29. public Color color = new Color(0.7f, 0.3f, 0.15f);
  30. }