I have a dynamic list of strings that are the name of valid Prefabs to have the FlowScript create. Is there a simple way to setup a Blackboard to pick an item from a list, rather than requiring the string to be manually assigned?
Can you please clarify your questions a bit more and what you want to achieve? Is this relevant to editor UI popup?
I am sorry but I’m not sure I understand 🙁
If you mean how to pick an item with index from a list, you could do it like the following image, but I presume that is not what you mean?
I am specifically trying to create a popup in the unity inspector driven by a dynamic list of strings to select a string to be used as an input for the blackboard.
E.g. The flowscript is called ‘spawn and act’
And I have inputs:
String MonsterName
String MonsterAction
Which I want to source from a list of monsters specific to that level:
Public Ilist<string> LevelMonsterList
{
Get {
return ScenePrefabList.Select ( c => c.MonsterUniqueName );
}
}
And I want to map that list (defined on the spawned object that has the blackboard) onto a popup that drives the “MonsterToSpawn” string
The blackboard GUI is not very customizable in this regards at least right now. There are some solutions I can think of like creating a custom class with custom object drawer, but I think this could become an overkill 🙂
What I’d like to suggest instead is simply create a string variable and bind it to a property or field of a monobehaviour on the gameobject. This way, you can inspect and edit the property/field however you like, but still have it be bound to the variable 🙂
For example:
1
2
3
4
5
6
7
publicclassBindings:MonoBehaviour{
[FactionPopup]
publicstringfaction;
}
And then in the Blackboard:
Let me know if this solution works for you.
Thanks.