|
|
|
|
|
|
private DialogueLineChannelSO _sayLineEvent; |
|
|
|
private ActorSO _protagonistActor; |
|
|
|
private bool _isNPCSayingTheLine = false; |
|
|
|
private NPC _npcScript; |
|
|
|
|
|
|
|
public IsNPCSayingTheLineCondition(DialogueLineChannelSO sayLineEvent, ActorSO protagonistActor) |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
public override void Awake(StateMachine stateMachine) |
|
|
|
{ |
|
|
|
_npcScript = stateMachine.GetComponent<NPC>(); |
|
|
|
} |
|
|
|
|
|
|
|
protected override bool Statement() |
|
|
|
{ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
private void OnLineDisplayed(LocalizedString line, ActorSO actor) |
|
|
|
{ |
|
|
|
//why is it not possible to do this from here?
|
|
|
|
SetTheLineToNotSaidYet(); |
|
|
|
if (actor.ActorName == _protagonistActor.ActorName) |
|
|
|
{ |
|
|
|
_isNPCSayingTheLine = false; |
|
|
|
|
|
|
_isNPCSayingTheLine = true; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void SetTheLineToNotSaidYet() |
|
|
|
{ |
|
|
|
_npcScript.hasSaidLine = false; |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |