コード例 #1
0
    private void StartBark(BarkEvent barkEvent)
    {
        if (!canBark)
        {
            return;
        }

        // Barks only play when player is in all of the same zones as the character
        List <CameraZone> characterZones = RegionManager.Instance.GetCharacterCurrentZones(gameObject);

        foreach (CameraZone cz in characterZones)
        {
            if (!RegionManager.Instance.PlayerIsInZone(cz))
            {
                return;
            }
        }

        // Dont start new bark if a current bark is in place
        if (currentBark != null)
        {
            return;
        }

        // Get a random bark
        List <Bark> barks = BarkManager.Instance.GetBarkLines(barkEvent);
        Bark        bark  = barks[Random.Range(0, barks.Count)];

        string speakerId = DialogueManager.Instance.GetSpeakerId(gameObject);

        currentBark = DialogueManager.Instance.StartBark(speakerId, bark);

        DialogueManager.Instance.OnFinishConversation += FinishBark;
    }
コード例 #2
0
 private void LoadNewBarks(ReactiveBarkType reactiveBarkType, BarkEvent barkEvent)
 {
     foreach (BaseNavAi enemy in instantiatedEnemies)
     {
         Debug.Log(enemy.gameObject.name);
         NPCReactiveBark reactiveBark = Utils.GetRequiredComponent <NPCReactiveBark>(enemy.gameObject);
         reactiveBark.LoadNewBark(reactiveBarkType, barkEvent);
     }
 }
コード例 #3
0
    private IEnumerator TryLostBark(BarkEvent barkEvent)
    {
        yield return(new WaitForSeconds(waitTimeBeforeLost));

        if (Time.time - timeLostVision >= waitTimeBeforeLost && playerStatus != PlayerDetectionStatus.Visible)
        {
            StartBark(barkEvent);
            SetPlayerStatusHidden();
        }
    }
コード例 #4
0
    public void LoadNewBark(ReactiveBarkType reactiveBarkType, BarkEvent barkEvent)
    {
        switch (reactiveBarkType)
        {
        case ReactiveBarkType.IdleBark:
            idleBark = barkEvent;
            break;

        case ReactiveBarkType.SpottedBark:
            spottedBark = barkEvent;
            break;

        case ReactiveBarkType.LostBark:
            lostBark = barkEvent;
            break;

        case ReactiveBarkType.NoiseBark:
            reactiveNoiseBark = barkEvent;
            break;
        }
    }
コード例 #5
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;
        }
    }