#if false using System.Collections; using System.Collections.Generic; using System.IO; using UnityEditor; using UnityEngine; //[CustomEditor(typeof(ImageFileWatcher))] public class ImageFileWatcherEditor : Editor { public override void OnInspectorGUI() { DrawDefaultInspector(); /* int selected = 0; string[] options = new string[] { "Option1", "Option2", "Option3", }; selected = EditorGUILayout.Popup("Label", selected, options); */ ImageFileWatcher image_watcher = target as ImageFileWatcher; //List result = new List(); string[] file_list = Directory.GetFiles(image_watcher.originFolder); foreach (string f in file_list) { FileInfo file = new FileInfo(f); if (file.Extension == ".meta") continue; GUILayout.BeginHorizontal(); { string typename = file.Name.Substring(0, file.Name.Length - file.Extension.Length); GUILayout.Label(typename, GUILayout.Width(100)); GUILayout.TextField("", GUILayout.ExpandWidth(true)); string name = ""; switch (Event.current.type) { case EventType.DragUpdated: case EventType.DragPerform: DragAndDrop.visualMode = DragAndDropVisualMode.Copy; if (Event.current.type == EventType.DragPerform) { name = DragAndDrop.objectReferences[0].ToString(); } break; } } GUILayout.EndHorizontal(); } } } #endif