Missing the class attribute 'ExtensionOfNativeClass'

After updating unity to the version 2018.3.7f1 I have tihs error in my released project:

'Saves' is missing the class attribute 'ExtensionOfNativeClass'!
'SavesForAllSlots' is missing the class attribute 'ExtensionOfNativeClass'!
'Saves' is missing the class attribute 'ExtensionOfNativeClass'!
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
'SavesForAllSlots' is missing the class attribute 'ExtensionOfNativeClass'!
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
...

138417-1.jpg

Why is tihs happening?

Saves.cs

[System.Serializable]
public class Saves
{
    public string dateTime;
    public float transformPositionX;
    public float transformPositionY;
    public float transformPositionZ;
    public int latestSaveSlot;
    public int actNumber;
    public string sceneName;
    public int slotImage;
    public int currentActiveSlot;
    public int stepNumber;
}

SavesForAllSlots.cs

[System.Serializable]
public class SavesForAllSlots
{
    public int latestSaveSlotForAll;
}

@dmitry-kozyr this was happening to me earlier today. What was happening is that I changed a script from inheriting MonoBehaviour to being a static class. After doing this I started to get errors. Turns out the original prefab object that was in my screen was still referencing this MonoBehaviour script. So I went to my prefab, deleted the script from it and it fixed these errors. I believe that static scripts don’t need to be attached to GameObjects. If this doesn’t work I am not sure what is wrong, I am also not an expert just an avid learner!

PFF Wouldn’t you know it, all I did was restart Unity and the error went away. No deleting neccesary.

You have to create your save script in the script editor be it rider or android studio then copy input all the Data’s you want to save int it. After that you can add serializable to the class. Make sure you don’t create the class in unity or else it will create an inheritance of mono behavior with it.

In my case I had a script that was added as a component to a Transform. I later changed this script from MonoBehaviour to just a generic class. I started to see the errors.

The solution was to remove the dead reference to the script in the GameObject that was referencing it. I just did a search in the Hierarchy using the offending script/class name and found the missing reference. Once removed, the errors were gone.