浏览代码

minor changes

/main
DeivSky 4 年前
当前提交
10ac1ce1
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 4
      UOP1_Project/Assets/Scripts/StateMachine/Editor/Utilities/InitOnlyAttributeDrawer.cs

4
UOP1_Project/Assets/Scripts/StateMachine/Editor/Utilities/InitOnlyAttributeDrawer.cs


[CustomPropertyDrawer(typeof(InitOnlyAttribute))]
public class InitOnlyAttributeDrawer : PropertyDrawer
{
private static readonly string _text = "Changes to this field will only take effect on new state machine instances, or the next time you enter play mode.";
private static readonly string _text = "Changes to this parameter will only take effect on new state machine instances, or the next time you enter play mode.";
private static readonly GUIStyle _style = new GUIStyle(GUI.skin.GetStyle("helpbox")) { padding = new RectOffset(5, 5, 5, 5) };
public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)

if (EditorApplication.isPlaying)
{
height += _style.CalcHeight(new GUIContent(_text), EditorGUIUtility.currentViewWidth)
+ EditorGUIUtility.standardVerticalSpacing;
+ EditorGUIUtility.standardVerticalSpacing * 4;
}
return height;

正在加载...
取消
保存