public void EcoTalkTo(EBudgetType pnjTargetName) { for (int i = 0; i < Quests.Count; i++) { if (Quests[i].step == 2) { for (int j = 0; j < Quests[i].activitiesName.Length; j++) { if (Quests[i].activitiesName[j] == pnjTargetName) { Quests[i].step++; if (_runningQuest == Quests[i]) { DisplayQuest(); } return; } } } } }
public void Init(string pnjKey) { NPCWrap info = null; int l = ResourcesManager.Instance.NPCs.objects.Count; for (int i = 0; i < l; i++) { NPCWrap wrap = ResourcesManager.Instance.NPCs.objects[i]; if (wrap.ID == pnjKey) { info = wrap; break; } } if (info != null) { EWorldImpactType baseImpact = PropertyUtils.CastEnum <EWorldImpactType>(info.impactType); impacts.Add(baseImpact); type = ResourcesManager.GetBuildingType(baseImpact); BudgetValues values; if (ResourcesManager.Instance.BudgetValues.ContainsKey(baseImpact)) { values = ResourcesManager.Instance.BudgetValues[baseImpact]; } else { values = ResourcesManager.Instance.BudgetValues[EWorldImpactType.None]; } initialBudget = values.initialBudget; workingLimitBudget = values.workingLimitBudget; budget = values.initialBudget; productBenefit = values.productBenefit; } SetWorking(); ResourcesManager.Instance.AddBudgetComponent(this); }