Assuming we have one first person character and several NPC AIs.
The first person character should be able to talk to the NPC AI’s (via dialog service).
My problem is: How should I “connect” the two game objects (FPC and NPC) to each other?
So he can basically walk around and talk to them, then they answer something, and the first person character may choose an option.
I see several options here:
- add a public variable to ‘first person character’. this public variable will hold the NPC AI. So the NPC AI and first person character can talk to each other via functions on both classes.
- Add a class ‘DialogService’ which implements the observer pattern. So there will be several publishers and subscribers. My problem here is how to hook up the NPCs and first person character to each other
- Maybe you have a better alternative?