mirror of
https://github.com/mob-sakai/UIEffect.git
synced 2026-11-19 17:22:37 +08:00
f8682f3c98
NOTE: This change will rename the built-in runtime preset. For example, change the name `001 - Tone - Glayscale` to `Tone-Glayscale`. close #333
28 lines
793 B
C#
28 lines
793 B
C#
using UnityEditor;
|
|
|
|
internal static class UserDataEditor
|
|
{
|
|
[InitializeOnLoadMethod]
|
|
private static void InitializeOnLoadMethod()
|
|
{
|
|
Editor.finishedDefaultHeaderGUI += OnFinishedDefaultHeaderGUI;
|
|
}
|
|
|
|
private static void OnFinishedDefaultHeaderGUI(Editor editor)
|
|
{
|
|
var importer = editor.target as AssetImporter;
|
|
if (!importer)
|
|
{
|
|
if (!AssetDatabase.Contains(editor.target)) return;
|
|
|
|
importer = AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(editor.target));
|
|
}
|
|
|
|
if (!importer) return;
|
|
|
|
EditorGUIUtility.labelWidth = 55;
|
|
importer.userData = EditorGUILayout.DelayedTextField("userdata", importer.userData);
|
|
AssetDatabase.WriteImportSettingsIfDirty(importer.assetPath);
|
|
}
|
|
}
|