public void Init() { ItemModels = new List <Item>(); foreach (EItemType it in Enum.GetValues(typeof(EItemType))) { if (it != EItemType.None) { ItemModels.Add(Resources.Load <Item>("Items/" + it.ToString())); } } _impacts = StreamingAssetAccessor.FromJson <ImpactsWrapper>(impactsPath); List <KeyValuePair <string, BudgetWorldValues> > pairImpact = FileManager.GenerateList <BudgetWorldValues, ImpactWrap>(_impacts.objects); DicWrapper <BudgetWorldValues> wrapperImpact = FileManager.GenerateDicWrapper(pairImpact); _impactsDatabase = FileManager.GenerateDicFromJson <EWorldImpactType, BudgetWorldValues>(wrapperImpact); foreach (KeyValuePair <EWorldImpactType, BudgetWorldValues> item in _impactsDatabase) { _bonusValues.Add(item.Key, 0); } _budgets = StreamingAssetAccessor.FromJson <BudgetWrapper>(valuesPath); List <KeyValuePair <string, BudgetValues> > pairBudget = FileManager.GenerateList <BudgetValues, BudgetWrap>(_budgets.objects); DicWrapper <BudgetValues> wrapperBudget = FileManager.GenerateDicWrapper(pairBudget); _budgetValues = FileManager.GenerateDicFromJson <EWorldImpactType, BudgetValues>(wrapperBudget); _npcs = StreamingAssetAccessor.FromJson <NPCWrapper>(npcPath); DialogueWrapper dialogueWrapper = StreamingAssetAccessor.FromJson <DialogueWrapper>(dialoguesPath); List <KeyValuePair <string, DialoguePNJ> > dialoguePairs = FileManager.GenerateList <DialoguePNJ, DialogueWrap>(dialogueWrapper.objects); DicWrapper <DialoguePNJ> wrapperDialogue = FileManager.GenerateDicWrapper(dialoguePairs); InteractablePNJ.DialoguesDatabase = FileManager.GenerateDicFromJson(wrapperDialogue); }
public void Awake() { RoadInfo json = StreamingAssetAccessor.FromJson <RoadInfo>("Json/Roads/" + roadInfo.name + ".json"); if (roadInfo != null) { TRACKS.Add(roadInfo.name, roadInfo); } }
public static bool LoadTraduction(SystemLanguage language) { if (_texts.ContainsKey(language)) { return(true); } _language = language; GameTexts newText = new GameTexts(); newText.Texts = StreamingAssetAccessor.FromJson <TradWrapper>("Json/" + language + ".json"); if (newText.Texts != null) { newText.Generate(); _texts.Add(language, newText); return(true); } else { return(false); } }