Good morning.
I try to expose some ScriptableObject field and other custom serializable classes to the Inspector inside Behavior Node Editor. Not as a Blackboard variable but Locally to the node.
In my example screenshot :
- “AiTagSO” (used by the node to choose inside a list of possible game actions inside another component)
- “AiComputeData” (to prioritize one action when different game actions are found).
But the only way I found is to make a blackboard variable field and set it to private.
I am really afraid of the quickly escalating blackboard with tens or hundred of variables.
So I was wondering if I can just expose a field the “regular way” ?
Or maybe it’s possible to sort the blackboard variable into folders ?
- I tried to override OnInspectorGUI(), but the node editor seems to have it’s own editor gui.
Here is what I understand of variable exposure inside the graph :
///What I understand :
//Expose the field in graph inspector as some sort of polymorphic type for generic types
//Most of the values can be set localy or by a blackboard
variable, but some only by blackboard variable :(
[SerializeReference] public BlackboardVariable<Type> Name;
//Private to the node
private Type m_name;
//Doesn't do anything in that context (what I want to expose locally to my node)
[SerializeField] private Type m_name;
//Private to the whole graph
[CreateProperty]
private Type m_name;
My custom serializable class
/// <summary>
/// Data to help AI decide if and how it should use a Game Action
/// </summary>
[Serializable]
public class ActionAiComputeData
{
[SerializeField] private float weight = 1f;
[SerializeField] private bool requireGetInRange = true;
[SerializeField] private float minDistanceFromtarget = 0f;
[SerializeField] private float maxDistanceFromtarget = 1.5f;
//other properties to filter actions
//...
//...
}
My node
///
...
///
public partial class ChooseAction : Action
{
[SerializeField] public bool test;
[SerializeField] public ActionAiTagSO aiTag;
[SerializeReference] public BlackboardVariable<ActionAiTagSO> aiTagSO;
[SerializeField] public ActionAiComputeData aiData;
[SerializeReference] public BlackboardVariable<ActionAiComputeData> aiComputeData;
///
...
...
...
///
}
Thanks in advance for any guidance !


