using UnityEditor;
using UnityEngine;
public class StringEncrypter : EditorWindow
{
[MenuItem("MyPlugins/open window", false)]
public static void open()
{
StringEncrypter _stringEncrypter = GetWindow<StringEncrypter>(true, "window");
}
private string[] filePaths = null;
private string tip;
private void OnGUI()
{
if (mouseOverWindow == this)
{
if (Event.current.type == EventType.DragUpdated)
{
DragAndDrop.visualMode = DragAndDropVisualMode.Generic;
}
else if (Event.current.type == EventType.DragExited)
{
Focus();
if (DragAndDrop.paths != null)
{
filePaths = DragAndDrop.paths;
Event.current.Use();
}
}
}
if (!string.IsNullOrEmpty(tip))
{
GUIStyle style2 = new GUIStyle();
style2.fontSize = 20;
style2.alignment = TextAnchor.MiddleCenter;
GUILayout.Label(tip, style2);
}
}
}
|