Beispiel #1
0
    public void PopulateCache()
    {
        if (!PathIsFolder)
        {
            string filePath = Path.Combine(Application.streamingAssetsPath, JsonPathInStreamingAssets + ".json");

            Objects = JsonUtilities.DeserializeFile <List <T> >(filePath);

            Ready = true;
            if (ReadyEvent != null)
            {
                ReadyEvent.Invoke();
            }
        }
        else
        {
            throw new System.NotImplementedException();
        }
    }
Beispiel #2
0
        internal static ModuleSettings LoadSettings()
        {
            string path = ModuleRunTimeState.ModuleDataPath;

            if (!File.Exists($"{path}\\ModuleSettings.json"))
            {
                var tempSettings = new ModuleSettings();
                tempSettings.SaveSettings();
                return(tempSettings);
            }

            var settings = JsonUtilities.DeserializeFile <ModuleSettings>($"{path}\\ModuleSettings.json");

            if (!(settings.KnownVstsProviders.Comparer == StringComparer.OrdinalIgnoreCase))
            {
                settings.KnownVstsProviders = new Dictionary <string, string>(settings.KnownVstsProviders, StringComparer.OrdinalIgnoreCase);
            }

            return(settings);
        }