public void EndMission(MissionsEnum missionEnumValue) { AMission missionLogic = GetMissionLogic(missionEnumValue); ObjectiveList.Instance.HideObjectiveList(); Chaser.ResetChaserCount(); if (activeMissions.Contains(missionEnumValue)) { activeMissions.Remove(missionEnumValue); missionLogic.gameObject.SetActive(false); ProgressManager.Instance.UpdateMissionStatus(missionLogic, MissionStatusCode.Closed); StampCollectible collectible = GetStampCollectibleFromEnum(missionEnumValue); if (collectible != null) { ProgressManager.Instance.UnlockStampCollectible(collectible); } } else { Debug.LogError($"Tried to end an invalid mission: {missionEnumValue}"); } }
public void SetObjectiveTextForList(MissionsEnum missionEnumValue) { if (missionMapping[missionEnumValue].objective) { ObjectiveList.Instance.DisplayObjectiveText(missionMapping[missionEnumValue].objective.line); ObjectiveList.Instance.SlideOutObjectTextForSeconds(5f); } }
public void RestartMission(MissionsEnum missionEnumValue) { ProgressManager.Instance.UpdateMissionStatus(GetMissionLogic(missionEnumValue), MissionStatusCode.Started); SetObjectiveTextForList(missionEnumValue); Chaser.ResetChaserCount(); OnMissionRestart?.Invoke(missionEnumValue); }
public GameObject GetMissionFromEnum(MissionsEnum missionEnumValue) { if (missionMapping.TryGetValue(missionEnumValue, out MissionMapping mapping)) { return(mapping.mission.gameObject); } else { Debug.LogWarning($"Unmapped MissionsEnum value: {missionEnumValue} passed into GetMissionFromEnum!"); return(null); } }
public AMission GetMissionLogic(MissionsEnum missionEnumValue) { if (missionMapping.TryGetValue(missionEnumValue, out MissionMapping mapping)) { return(mapping.mission); } else { Debug.LogWarning($"Unmapped MissionsEnum value: {missionEnumValue} passed into GetMissionLogic!"); return(null); } }
public StampCollectible GetStampCollectibleFromEnum(MissionsEnum missionEnumValue) { if (missionMapping.TryGetValue(missionEnumValue, out MissionMapping mission)) { return(mission.collectible); } else { Debug.LogWarning($"Unmapped MissionsEnum value: {missionEnumValue} passed into GetMissionFromEnum!"); return(null); } }
private void MissionRestart(MissionsEnum missionsEnumValue) { if (missionsEnumValue != missionsEnum) { return; } MissionManager.Instance.OnMissionRestart -= MissionRestart; StopAllCoroutines(); timeLastHiddenBark = Time.time; }
public AMission StartMission(MissionsEnum missionEnumValue) { AMission missionLogic = GetMissionLogic(missionEnumValue); missionLogic.gameObject.SetActive(true); ProgressManager.Instance.AddMission(missionLogic); activeMissions.Add(missionEnumValue); SetObjectiveTextForList(missionEnumValue); return(missionLogic); }
public void LoadBarks(MissionsEnum missionEnum) { switch (missionEnum) { case MissionsEnum.MissionTutorial: break; case MissionsEnum.KitchenMission: idleBark = BarkEvent.KitchenIdleBark; spottedBark = BarkEvent.KitchenSpottedNurseReaction; lostBark = BarkEvent.KitchenLostNurseReaction; reactiveNoiseBark = BarkEvent.KitchenPlateDroppedNurseReaction; break; case MissionsEnum.BrutusOfficeSneak: idleBark = BarkEvent.BrutusOfficeIdleReaction; spottedBark = BarkEvent.BrutusOfficeSpottedReaction; lostBark = BarkEvent.BrutusOfficeLostReation; reactiveNoiseBark = BarkEvent.BrutusOfficeNoiseReaction; break; case MissionsEnum.HedgeMaze: if (isBrutus) { idleBark = BarkEvent.BrutusHedgeMazeIdleBark; spottedBark = BarkEvent.BrutusHedgeMazeSpottedBark; lostBark = BarkEvent.BrutusHedgeMazeLostBark; reactiveNoiseBark = BarkEvent.BrutusHedgeMazeNoiseBark; } else { idleBark = BarkEvent.HedgeMazeIdleBark; spottedBark = BarkEvent.HedgeMazeSpottedBark; lostBark = BarkEvent.HedgeMazeLostBark; reactiveNoiseBark = BarkEvent.HedgeMazeNoiseBark; } break; } }
public void CompleteMissionObjective(MissionsEnum missionEnumValue) { ProgressManager.Instance.UpdateMissionStatus(GetMissionLogic(missionEnumValue), MissionStatusCode.Completed); ObjectiveList.Instance.CrossOutObjectiveText(); Debug.Log("Objective Complete"); }
public bool IsMissionActive(MissionsEnum missionEnumValue) { return(activeMissions.Contains(missionEnumValue)); }