Example #1
0
        void Awake()
        {
            //Create default file
            //Config.SetDefaults();
            //Config.Save();

            if (Config == null)
            {
                Config = new UploadConfigData();
            }
            Config.TryLoad();
        }
Example #2
0
            public void TryLoad()
            {
                string PathToSave = filePath;

                if (File.Exists(PathToSave))
                {
                    string data = File.ReadAllText(PathToSave);

                    UploadConfigData ucd = JsonUtility.FromJson <UploadConfigData>(data);
                    ClientIdentifier           = ucd.ClientIdentifier;
                    ClientCredentialApplicator = ucd.ClientCredentialApplicator;
                    ApiUrl = ucd.ApiUrl;
                }
                else
                {
                    Debug.LogError("Map Upload Config file not found: " + PathToSave);
                    SetDefaults();
                }
            }