unity make a static class script and access it code example
Example: unity static class
//The static class
using UnityEngine;
public static class SaveManager
{
public static string GetString(string key)
{
return PlayerPrefs.GetString(key);
}
}
//Where it´s used
Playername = SaveManager.GetString("PlayernameKey");