public bool MissingMonoBehaviourGUI()
{
serializedObject.Update();
SerializedProperty scriptProperty = serializedObject.FindProperty("m_Script");
if (scriptProperty == null)
{
return(false);
}
EditorGUILayout.PropertyField(scriptProperty);
MonoScript targetScript = scriptProperty.objectReferenceValue as MonoScript;
bool showScriptWarning = true;
if (targetScript != null && targetScript.GetScriptTypeWasJustCreatedFromComponentMenu())
{
showScriptWarning = false;
}
if (showScriptWarning)
{
GUIContent c = EditorGUIUtility.TrTextContent("The associated script can not be loaded.\nPlease fix any compile errors\nand assign a valid script.");
EditorGUILayout.HelpBox(c.text, MessageType.Warning, true);
}
if (serializedObject.ApplyModifiedProperties())
{
EditorUtility.ForceRebuildInspectors();
}
return(true);
}