private void OnAnyMainConditionCompleted(MainCondition main) { UpdateQuestProgress(questUI1); UpdateQuestProgress(questUI2); UpdateQuestProgress(questUI3); //UpdateAllQuestDisplays(); ///Todo, make it not update all the displays only progress SaveJson(); }
private void FinishQuest(MainCondition main) { Debug.Log($"{GetType().FullName} :: Quest finished"); completed = true; if (OnQuestCompleted != null) { OnQuestCompleted(this); } main.OnMainConditionCompleted -= FinishQuest; }
public Quest SetupRandomQuest() { List <System.Type> mainConditions = MainConditions(); System.Type condType = mainConditions[random.Next(0, mainConditions.Count)]; mainCondition = (MainCondition)condType. GetMethod("SetupMainCondition", new Type[] { typeof(int), typeof(int) }). Invoke(Activator.CreateInstance(condType), new object[] { id, level }); mainCondition.OnMainConditionCompleted += FinishQuest; return(this); }