PlyImporterInspector.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. // Pcx - Point cloud importer & renderer for Unity
  2. // https://github.com/keijiro/Pcx
  3. using UnityEngine;
  4. using UnityEditor;
  5. using UnityEditor.Experimental.AssetImporters;
  6. namespace Pcx
  7. {
  8. // Note: Not sure why but EnumPopup doesn't work in ScriptedImporterEditor,
  9. // so it has been replaced with a normal Popup control.
  10. [CustomEditor(typeof(PlyImporter))]
  11. class PlyImporterInspector : ScriptedImporterEditor
  12. {
  13. SerializedProperty _containerType;
  14. string[] _containerTypeNames;
  15. protected override bool useAssetDrawPreview { get { return false; } }
  16. public override void OnEnable()
  17. {
  18. base.OnEnable();
  19. _containerType = serializedObject.FindProperty("_containerType");
  20. _containerTypeNames = System.Enum.GetNames(typeof(PlyImporter.ContainerType));
  21. }
  22. public override void OnInspectorGUI()
  23. {
  24. _containerType.intValue = EditorGUILayout.Popup(
  25. "Container Type", _containerType.intValue, _containerTypeNames);
  26. base.ApplyRevertGUI();
  27. }
  28. }
  29. }