|
|
|
|
|
|
|
|
|
|
private void Start() |
|
|
|
{ |
|
|
|
_winDialogueEvent.OnEventRaised += PlayWinDialogue; |
|
|
|
_loseDialogueEvent.OnEventRaised += PlayLoseDialogue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
void PlayDefaultDialogue() |
|
|
|
|
|
|
_startDialogueEvent.RaiseEvent(_currentDialogue); |
|
|
|
_endDialogueEvent.OnEventRaised += EndDialogue; |
|
|
|
StopTalkingToCurrentActor(); |
|
|
|
_winDialogueEvent.OnEventRaised += PlayWinDialogue; |
|
|
|
_loseDialogueEvent.OnEventRaised += PlayLoseDialogue; |
|
|
|
_winDialogueEvent.OnEventRaised -= PlayWinDialogue; |
|
|
|
_loseDialogueEvent.OnEventRaised -= PlayLoseDialogue; |
|
|
|
ResumeTalkingToCurrentActor(); |
|
|
|
isInDialogue = false; |
|
|
|
} |
|
|
|
|
|
|
private void StopTalkingToCurrentActor() |
|
|
|
{ |
|
|
|
GameObject[] talkingTo = gameObject.GetComponent<NPC>().talkingTo; |
|
|
|
if(talkingTo != null) |
|
|
|
if (talkingTo != null) |
|
|
|
{ |
|
|
|
for (int i = 0; i < talkingTo.Length; ++i) |
|
|
|
{ |
|
|
|