private void Awake() { authInfoFile = Application.persistentDataPath + "/auth.json"; var readAuthResult = TryReadAuthorization(); //Try to read saved auth data if (!readAuthResult) { PlayerInfo = new GameAuthModel(); } }
public bool TryReadAuthorization() { if (!File.Exists(authInfoFile)) { return(false); } var json = File.ReadAllText(authInfoFile); PlayerInfo = JsonConvert.DeserializeObject <GameAuthModel>(json); return(true); }