SamsonGame/Assets/Sources/Lean/Transition/Editor/Scripts/LeanTemplate.cs

28 lines
733 B
C#
Raw Normal View History

2021-12-29 20:50:11 +03:00
using UnityEngine;
using UnityEditor;
namespace Lean.Transition.Editor
{
/// <summary>This allows you to define a transition template.</summary>
[CreateAssetMenu(fileName = "NewTemplate", menuName = "Lean/Transition/Template")]
public class LeanTemplate : ScriptableObject
{
[Multiline(100)]
public string Body;
}
[CustomEditor(typeof(LeanTemplate))]
public class LeanTemplate_Editor : UnityEditor.Editor
{
public override void OnInspectorGUI()
{
var labelWidth = EditorGUIUtility.labelWidth;
EditorGUIUtility.labelWidth = 50.0f;
EditorGUILayout.PropertyField(serializedObject.FindProperty("Body"));
EditorGUIUtility.labelWidth = labelWidth;
serializedObject.ApplyModifiedProperties();
}
}
}