2019年03月07日

UnityのCustomEditorでInspector表示を強制的に再描画する方法

UnityでCustomEditorを使っていて、内容が更新されているのにInspectorの表示が更新されないときはEditorUtility.SetDirty(target)を実行してみると良いそうです。

void OnInspectorGUI()
{
EditorUtility.SetDirty(target);
}

リンク

How do you force a custom inspector to redraw? - Unity Answers
https://answers.unity.com/questions/333181/how-do-you-force-a-custom-inspector-to-redraw.html
タグ:CustomEditor
posted by unity-chan at 01:17 | Script