Can anyone help with this serialization script (missing the class attribute 'ExtensionOfNativeClass'!)

I was creating big game but I can’t solve this problem:

I don’t whats wrong with this script, name is “SaveLoadManager”, can anyone help?

public static class SaveLoadManager
{
    public static string SaveName;

    public static void SavePlayer (Player player)
    {
        BinaryFormatter bf = new BinaryFormatter();
        FileStream stream = new FileStream(Application.persistentDataPath + SaveName + ".fun", FileMode.Create);

        PlayerData data = new PlayerData(player);

        bf.Serialize(stream, data);
        stream.Close();
    }

    public static PlayerData LoadPlayer()
    {
        if (File.Exists(Application.persistentDataPath + SaveName + ".fun"));
        {
            BinaryFormatter bf = new BinaryFormatter();
            FileStream stream = new FileStream(Application.persistentDataPath + SaveName + ".fun", FileMode.Open);

            PlayerData data = bf.Deserialize(stream) as PlayerData;
            stream.Close();
            return data;
        }
    }
}

[Serializable]
public class PlayerData
{
    public int health;
    public float hunger;
    public float thirst;
    public float[] position;
    public GameObject PlayerGameObject;
    
    public PlayerData(Player player)
    {
        health = player.health;
        thirst = player.thirst;
        hunger = player.hunger;
        position = new float[3];
        position[0] = PlayerGameObject.transform.position.x;
        position[1] = PlayerGameObject.transform.position.y;
        position[2] = PlayerGameObject.transform.position.z;
         
    }
}

My only problem is this error:
164835-error.png

Please help me!

Did you perhaps have same named class earlier that was inherited from Monobehaviour or something… ? Try renaming the SaveLoadManager class and check if that helps.

I was searching everything and I know the problem - I assigned static class to GameObject and I did public static class. Thanks @CodeCove for good intentions - I will reward you anyway.