コード例 #1
0
    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}");
        }
    }
コード例 #2
0
 public void SetObjectiveTextForList(MissionsEnum missionEnumValue)
 {
     if (missionMapping[missionEnumValue].objective)
     {
         ObjectiveList.Instance.DisplayObjectiveText(missionMapping[missionEnumValue].objective.line);
         ObjectiveList.Instance.SlideOutObjectTextForSeconds(5f);
     }
 }
コード例 #3
0
    public void RestartMission(MissionsEnum missionEnumValue)
    {
        ProgressManager.Instance.UpdateMissionStatus(GetMissionLogic(missionEnumValue), MissionStatusCode.Started);

        SetObjectiveTextForList(missionEnumValue);
        Chaser.ResetChaserCount();
        OnMissionRestart?.Invoke(missionEnumValue);
    }
コード例 #4
0
 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);
     }
 }
コード例 #5
0
 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);
     }
 }
コード例 #6
0
 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);
     }
 }
コード例 #7
0
    private void MissionRestart(MissionsEnum missionsEnumValue)
    {
        if (missionsEnumValue != missionsEnum)
        {
            return;
        }

        MissionManager.Instance.OnMissionRestart -= MissionRestart;

        StopAllCoroutines();
        timeLastHiddenBark = Time.time;
    }
コード例 #8
0
    public AMission StartMission(MissionsEnum missionEnumValue)
    {
        AMission missionLogic = GetMissionLogic(missionEnumValue);

        missionLogic.gameObject.SetActive(true);

        ProgressManager.Instance.AddMission(missionLogic);
        activeMissions.Add(missionEnumValue);

        SetObjectiveTextForList(missionEnumValue);

        return(missionLogic);
    }
コード例 #9
0
    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;
        }
    }
コード例 #10
0
 public void CompleteMissionObjective(MissionsEnum missionEnumValue)
 {
     ProgressManager.Instance.UpdateMissionStatus(GetMissionLogic(missionEnumValue), MissionStatusCode.Completed);
     ObjectiveList.Instance.CrossOutObjectiveText();
     Debug.Log("Objective Complete");
 }
コード例 #11
0
 public bool IsMissionActive(MissionsEnum missionEnumValue)
 {
     return(activeMissions.Contains(missionEnumValue));
 }