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; } }
public void LaunchDialogueWithPlayer() { if (curPlayer.GetCurrentState().stateName == "PLAYER_DIALOGUE_STATE") { return; } curPlayer.ChangeState(new PlayerDialogueState(curPlayer, curPnj.gameObject, curPlayer.GetCurrentState())); curPnj.ChangeState(new PnjDialogueState(curPnj, curPlayer, this.prevState)); }
//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); }
public void EndDialogue() { curPnj.ChangeState(prevState); }
public void EndWalk() { curPnj.ChangeState(new WanderAroundState(curPnj, target)); }