Exemplo n.º 1
0
        private void Awake()
        {
            authInfoFile = Application.persistentDataPath + "/auth.json";

            var readAuthResult = TryReadAuthorization();   //Try to read saved auth data

            if (!readAuthResult)
            {
                PlayerInfo = new GameAuthModel();
            }
        }
Exemplo n.º 2
0
        public bool TryReadAuthorization()
        {
            if (!File.Exists(authInfoFile))
            {
                return(false);
            }

            var json = File.ReadAllText(authInfoFile);

            PlayerInfo = JsonConvert.DeserializeObject <GameAuthModel>(json);

            return(true);
        }