Hey everyone,
Ok ok i know this was asked many times. However i wasn’t able to find any solution in the other threads.
First of all here is my editor script, or at least the important part:
public override void OnInspectorGUI()
{
serializedObject.Update ();
elements = EditorGUILayout.PropertyField (serializedObject.FindProperty ("publicScenes"), false);
serializedObject.ApplyModifiedProperties ();
EditorGUI.indentLevel += 1;
if (elements)
{
for (int count = 0; count < myScript.publicScenes.Count; ++count)
{
if (showPublicScenesElement.Length != myScript.publicScenes.Count)
{
if(Event.current.type == EventType.Repaint)
UpdateScenesElementBools ();
}
else
{
showPublicScenesElement [count] = EditorGUILayout.Foldout (showPublicScenesElement [count], "Element " + count);
}
}
}
EditorGUI.indentLevel -= 1;
if (GUILayout.Button ("Update Level buttons Animation"))
{
myScript.UpdateLevelAnimation ();
}
if (GUILayout.Button ("Recreate Buttons"))
{
myScript.RecreateButtons ();
}
}
At the beginning i had the same error but with a 9 instead of a 3 and i managed to solve part of this problem by adding the following line on line 15:
if(Event.current.type == EventType.Repaint)
The problem persisted but now i could’t find any simple solution. I tried many things and with commenting out a lot of my code i found out that the problem is by the foldout at line 20.
Does anyone know how to get rid of this error. I am actually going crazy.
Thanks in advance
-Jorge