public void RecordProgress(ObjectiveItem item) { switch (item.objectiveType) { case ObjectiveType.Kill: currentProgress++; break; case ObjectiveType.Gather: currentProgress++; break; case ObjectiveType.Deliver: currentProgress++; break; case ObjectiveType.Escort: currentProgress++; break; case ObjectiveType.Visit: currentProgress++; break; case ObjectiveType.Talk: currentProgress++; break; case ObjectiveType.Other: currentProgress++; break; case ObjectiveType.None: Debug.LogWarning($"No objective type set on {item.gameObject.name}"); break; default: throw new ArgumentOutOfRangeException(); } if (currentProgress == fullProgress) { status = ObjectiveStatus.Completed; OnCompleted(this); // BE - QuestManager.Instance[connectedQuestId].Continue(); } }
private void Awake() { quest = GetComponent <Quest>(); item = GetComponent <ObjectiveItem>(); }