1234567891011121314151617181920212223242526272829303132333435363738 |
- // Pcx - Point cloud importer & renderer for Unity
- // https://github.com/keijiro/Pcx
- using UnityEngine;
- using UnityEditor;
- using UnityEditor.Experimental.AssetImporters;
- namespace Pcx
- {
- // Note: Not sure why but EnumPopup doesn't work in ScriptedImporterEditor,
- // so it has been replaced with a normal Popup control.
- [CustomEditor(typeof(PlyImporter))]
- class PlyImporterInspector : ScriptedImporterEditor
- {
- SerializedProperty _containerType;
- string[] _containerTypeNames;
- protected override bool useAssetDrawPreview { get { return false; } }
- public override void OnEnable()
- {
- base.OnEnable();
- _containerType = serializedObject.FindProperty("_containerType");
- _containerTypeNames = System.Enum.GetNames(typeof(PlyImporter.ContainerType));
- }
- public override void OnInspectorGUI()
- {
- _containerType.intValue = EditorGUILayout.Popup(
- "Container Type", _containerType.intValue, _containerTypeNames);
- base.ApplyRevertGUI();
- }
- }
- }
|