62 lines
1.7 KiB
C#
62 lines
1.7 KiB
C#
using Sirenix.OdinInspector.Editor;
|
|
using UnityEditor;
|
|
using UnityEngine;
|
|
|
|
public class LTTextureMergeEditor: OdinEditorWindow
|
|
{
|
|
// [MenuItem("Tools/资源处理/表情合图")]
|
|
public static void ShowWindow()
|
|
{
|
|
var window = GetWindow<LTTextureMergeEditor>();
|
|
window.Show();
|
|
window.Focus();
|
|
}
|
|
|
|
private string _playerDir = "Assets/Art/Character/Models/Players";
|
|
private string _emojiDir = "Assets/Art/Character/Models/Emoji";
|
|
private bool _isInited;
|
|
|
|
private int _matchPlayerCount;
|
|
private int _matchEmojiCount;
|
|
|
|
private void _Init()
|
|
{
|
|
if (_isInited) return;
|
|
_isInited = true;
|
|
|
|
}
|
|
|
|
protected override void OnGUI()
|
|
{
|
|
// base.OnGUI();
|
|
_Init();
|
|
|
|
// 选择players文件夹
|
|
EditorGUILayout.BeginHorizontal();
|
|
_playerDir = EditorGUILayout.TextField("Players文件夹", _playerDir);
|
|
if (GUILayout.Button("选择" ,GUILayout.Width(100)))
|
|
{
|
|
var newPath = EditorUtility.OpenFolderPanel("选择Players文件夹", _playerDir, "");
|
|
if (!string.IsNullOrEmpty(newPath))
|
|
{
|
|
_playerDir = newPath;
|
|
}
|
|
}
|
|
EditorGUILayout.EndHorizontal();
|
|
|
|
// 选择emoji文件夹
|
|
EditorGUILayout.BeginHorizontal();
|
|
_emojiDir = EditorGUILayout.TextField("Emoji文件夹", _emojiDir);
|
|
if (GUILayout.Button("选择" ,GUILayout.Width(100)))
|
|
{
|
|
var newPath = EditorUtility.OpenFolderPanel("选择Emoji文件夹", _emojiDir, "");
|
|
if (!string.IsNullOrEmpty(newPath))
|
|
{
|
|
_emojiDir = newPath;
|
|
}
|
|
}
|
|
EditorGUILayout.EndHorizontal();
|
|
}
|
|
|
|
}
|