Dialog Controller

Dialog ControllerThe Dialog Controller has been designed to display dialog popups filled with textual data at the locations where a particular dialog is taking place.

Data is read in from text files within the Resources directory within the Unity project folder. The text files are sorted and separated based off the name of the desired game object given within it’s own script behavior. Also, within it’s own script behavior, this is where its initial dialog state is set, this determines the initial read in dialog. Resources InformationAs seen within this image, this shows how what I call the NPC (Non-Player Character) game objects dialog data is sorted to be picked when needed for the read in NPC’s particular dialog state.

This data is picked based off the attached Dialog Controller script attached to the NPC. The Resource Data Location is used to determine where the text files are located within the Resources folder. Also, and importantly, the Initial Dialog State locates the initial dialog text within the text files, I will explain this more in depth later on. Dialog Game Object InfoThe next image shows the inputs I gave the NPC Behavior script and Dialog Controller script based off my example for the individual NPC objects. Within my scene initializing script I dynamically create and change the Name attribute within the NPC Behavior script. Continue reading