protected void NotifyCompletion(Mission completedMission) { if (MissionComplete != null) { MissionComplete(completedMission); } }
public void AddMission(Mission mission) { missions.Add(mission); mission.MissionComplete += OnMissionComplete; if (!HasActiveMission) { ActivateMission(mission); } }
private void OnMissionComplete(Mission completedMission) { if (completedMission == tutorialMissions.Peek()) { tutorialMissions.Dequeue().MissionComplete -= OnMissionComplete; } if (tutorialMissions.Count > 0) { MissionManager.Instance.AddMission(tutorialMissions.Peek()); } }
private void ActivateMission(Mission mission) { CurrentMission = mission; mission.OnActivate(); // NOTE: if mission.Title is "", it's a "fake mission", i.e. some event // which needs to be triggered during the tutorial (e.g. ActivateObject) if (mission.Title.Length > 0) { if (!missionPanel.activeSelf) missionPanel.SetActive(true); missionPanel.SendMessage("SetTitle", mission.Title); missionPanel.SendMessage("SetDescription", mission.Description); } }
private void OnMissionComplete(Mission mission) { mission.OnAccomplished(); mission.MissionComplete -= OnMissionComplete; missions.Remove(mission); if (missions.Count > 0) { ActivateMission(missions[0]); } else { CurrentMission = null; if (missionPanel != null) missionPanel.SetActive(false); } }
private void OnSubMissionComplete(Mission mission) { }
public void AddSubMission(Mission mission) { //some stuff... mission.MissionComplete += OnSubMissionComplete; }