Hi,
What are the consequences of having multiple DialogueActor with same Actor type in the scene?
For example, if I have 2 separated objects - each has DialogueActor component on its top hierarchy. Actor type is same e.g John.
From the Conversation, if I set AnimatiorTrigger(Idle) while John is speaking, would both Animator get the trigger?
Following up question, if one of the gameObject is inactive, then would it prioritize the active one?
What are the consequences of having multiple DialogueActor with same Actor type in the scene?
Re: What are the consequences of having multiple DialogueActor with same Actor type in the scene?
It is usually best if your scene only has one Dialogue Actor assigned to an actor.
The Dialogue System maintains an internal dictionary of Dialogue Actors. When a Dialogue Actor's OnEnable() method runs, it is assigned to the dictionary entry for the actor name, overwriting the dictionary entry if it was already set by another Dialogue Actor. When a conversation starts, it checks this dictionary to associate GameObjects with actors.
For example, say you have GameObjects named GO1 and GO2. Both of the have a Dialogue Actor component set to "John".
When GO1's Dialogue Actor runs OnEnable(), it sets the dictionary[John] = GO1.
When GO2's Dialogue Actor runs OnEnable(), it overwrites the dictionary[John] = GO2.
If only one GameObject is active at a time, that's fine. Whenever you activate a GameObject, its OnEnable() method runs.
The Dialogue System maintains an internal dictionary of Dialogue Actors. When a Dialogue Actor's OnEnable() method runs, it is assigned to the dictionary entry for the actor name, overwriting the dictionary entry if it was already set by another Dialogue Actor. When a conversation starts, it checks this dictionary to associate GameObjects with actors.
For example, say you have GameObjects named GO1 and GO2. Both of the have a Dialogue Actor component set to "John".
When GO1's Dialogue Actor runs OnEnable(), it sets the dictionary[John] = GO1.
When GO2's Dialogue Actor runs OnEnable(), it overwrites the dictionary[John] = GO2.
If only one GameObject is active at a time, that's fine. Whenever you activate a GameObject, its OnEnable() method runs.
Re: What are the consequences of having multiple DialogueActor with same Actor type in the scene?
Only if you disable and re-enable GO1.