PointCloudRendererInspector.cs 990 B

1234567891011121314151617181920212223242526272829303132333435
  1. // Pcx - Point cloud importer & renderer for Unity
  2. // https://github.com/keijiro/Pcx
  3. using UnityEngine;
  4. using UnityEditor;
  5. namespace Pcx
  6. {
  7. [CanEditMultipleObjects]
  8. [CustomEditor(typeof(PointCloudRenderer))]
  9. public class PointCloudRendererInspector : Editor
  10. {
  11. SerializedProperty _sourceData;
  12. SerializedProperty _pointTint;
  13. SerializedProperty _pointSize;
  14. void OnEnable()
  15. {
  16. _sourceData = serializedObject.FindProperty("_sourceData");
  17. _pointTint = serializedObject.FindProperty("_pointTint");
  18. _pointSize = serializedObject.FindProperty("_pointSize");
  19. }
  20. public override void OnInspectorGUI()
  21. {
  22. serializedObject.Update();
  23. EditorGUILayout.PropertyField(_sourceData);
  24. EditorGUILayout.PropertyField(_pointTint);
  25. EditorGUILayout.PropertyField(_pointSize);
  26. serializedObject.ApplyModifiedProperties();
  27. }
  28. }
  29. }