I’m working on a conversation system for my game and it works like a node based system at the moment, w/ GameObjects as the nodes.
But I need certain steps of the conversation to have script access, for changing variables and such.
But the scripted content will be different depending on what variables the current conversation needs adjusted. So I cant do a straight reference to a script as I would need many scripts with 1 name.
Is it possible to make a prefab that will let you refer to a script in the inspector?
Or is there any other way I could solve this problem?
you can add and remove scripts at runtime and modify the variables, the inspector is not available in builds. Search in the reference guide for addcomponent.
you can add the same script for a number of different objects and drag different things into same script depending which object it is attached too, if that is what you mean?
I know I can put the same script on to multiple game objects, but the problem is, each NPC will need seperate information contained in the script.
So I cant, for example, have my Conversation script find a component attatched to every NPC named “NPCScript”, becuase that would use the same script in every single NPC, and as mentioned they will need seperate scripted information. As far as I know you cant have multiple scripts with the same name.
So more specifically, I was asking if there was a way to get a configurable setting for my Conversation script in the Inspector for a “script” variable, where I can drag the desired script in to it for a reference to it.