//STATE GESTION______________________________________________________________________________

    public override void Enter()
    {
        Camera.main.GetComponent<CameraManager>().SetDialogueCamera(pnj.gameObject);
        manager.Move(false);
        manager.ResetNearInteractObject();
        manager.transform.LookAt(pnj.transform.position);
        manager.GetAnimator().SetFloat("MoveSpeed", 0f);
        Dialogue curDialogue = pnj.dialogueManager.GetDialogue();
        pnj.PlayOnomatope();
        GameManager.Instance.AddToHistoric(curDialogue);
        if (pnj.GetCurrentState().stateName != "PNJ_DIALOGUE_STATE")
            pnj.ChangeState(new PnjDialogueState(pnj, manager, pnj.GetCurrentState()));
        dialogueUiManager.StartDialogue(curDialogue);
    }
Example #2
0
    void ApplyPnjSwitchBehavior()
    {
        if (characterConcerned == PnjManager.CharacterType.none)
        {
            return;
        }
        PnjManager pnj = EventManager.Instance.GetPNJ(characterConcerned);

        switch (actionChoice)
        {
        case CharacterAction.Boude:
            break;

        case CharacterAction.PursuitPlayer:
            pnj.ChangeState(new PursuitPlayerState(pnj, pnj.GetCurrentState()));
            break;

        case CharacterAction.GoToPlace:
            Vector3 pnjDesiredPosition = GameManager.Instance.GetInterestPointManager().GetInterestPointPosition(placeConcerned);
            pnj.ChangeState(new WanderAroundState(pnj, pnjDesiredPosition));
            break;

        case CharacterAction.WaitingForObject:
            pnj.IsWaitingObject = boolModificator;
            break;
        }
    }