public void Load(string file) { if (!IsLoaded) { ManagerImproveJsonData jsonData = JsonConvert.DeserializeObject <ManagerImproveJsonData>(Resources.Load <TextAsset>(file).text); Improvements = new ManagerImproveData(jsonData); IsLoaded = true; } }
public ManagerImproveData(ManagerImproveJsonData jsonData) { EfficiencyImprovements = new Dictionary <int, ManagerEfficiencyImproveData>(); if (jsonData.efficiencyImprovements != null) { foreach (var kvp in jsonData.efficiencyImprovements) { EfficiencyImprovements.Add(kvp.Key, new ManagerEfficiencyImproveData(kvp.Value)); } } RollbackImprovements = new Dictionary <int, ManagerRollbackImproveData>(); if (jsonData.rollbackImprovements != null) { foreach (var kvp in jsonData.rollbackImprovements) { RollbackImprovements.Add(kvp.Key, new ManagerRollbackImproveData(kvp.Value)); } } MegaImprovement = new MegaManagerImproveData(jsonData.megaImprovement); }