浏览代码

Changed to isPlayingOrWillChangePlaymode instead of isPlaying

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

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


[CustomPropertyDrawer(typeof(InitOnlyAttribute))]
public class InitOnlyAttributeDrawer : PropertyDrawer
{
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 string _text = "Changes to this parameter during play mode will only take effect on new state machine instances, or the next time you enter play mode.";
if (EditorApplication.isPlaying)
if (EditorApplication.isPlayingOrWillChangePlaymode)
{
position.height = _style.CalcHeight(new GUIContent(_text), EditorGUIUtility.currentViewWidth);
EditorGUI.HelpBox(position, _text, MessageType.Info);

{
float height = EditorGUI.GetPropertyHeight(property, label);
if (EditorApplication.isPlaying)
if (EditorApplication.isPlayingOrWillChangePlaymode)
{
height += _style.CalcHeight(new GUIContent(_text), EditorGUIUtility.currentViewWidth)
+ EditorGUIUtility.standardVerticalSpacing * 4;

正在加载...
取消
保存