Hello Behavior Designer Community,
I am currently working on enhancing the usability of the Behavior Designer editor for a project where I have a significant number of shared variables. To organize these better and streamline the process of assigning these variables within tasks, I am looking to implement a functionality similar to Unity's Project tab's right-click context menu—where you can navigate through nested menus (e.g., Create > Folder).
Here's the basic setup of my custom shared variables class:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using BehaviorDesigner.Runtime;
[System.Serializable]
public class CustomStats
{
public SharedFloat maxHealth;
public SharedFloat walkSpeed;
public SharedFloat runSpeed;
public SharedFloat angularSpeed;
public SharedFloat engageDistance;
public SharedFloat attackRange;
public SharedFloat attackDamage;
}
[System.Serializable]
public class SharedCustomStats : SharedVariable<CustomStats>
{
public static implicit operator SharedCustomStats(CustomStats value) {return new SharedCustomStats { Value = value };}
}
The current functionality allows me to create a CustomStats class which includes several shared variables like maxHealth, walkSpeed, etc. However, in the Behavior Designer tasks, I cannot directly set, for example, the walkSpeed without first setting the entire CustomStats object. This approach is somewhat cumbersome and does not provide the clean, easy-to-navigate interface I aim for.
Ideally, I would like to have a nested menu system in the inspector where I could select a SharedCustomStats variable and then have a submenu or similar mechanism to select individual properties like walkSpeed directly.
Does anyone have experience with customizing the inspector for Behavior Designer to this extent, or could anyone provide guidance or suggestions on how this could be implemented? Any help or pointers towards relevant documentation or examples would be greatly appreciated.
Thank you!
I am currently working on enhancing the usability of the Behavior Designer editor for a project where I have a significant number of shared variables. To organize these better and streamline the process of assigning these variables within tasks, I am looking to implement a functionality similar to Unity's Project tab's right-click context menu—where you can navigate through nested menus (e.g., Create > Folder).
Here's the basic setup of my custom shared variables class:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using BehaviorDesigner.Runtime;
[System.Serializable]
public class CustomStats
{
public SharedFloat maxHealth;
public SharedFloat walkSpeed;
public SharedFloat runSpeed;
public SharedFloat angularSpeed;
public SharedFloat engageDistance;
public SharedFloat attackRange;
public SharedFloat attackDamage;
}
[System.Serializable]
public class SharedCustomStats : SharedVariable<CustomStats>
{
public static implicit operator SharedCustomStats(CustomStats value) {return new SharedCustomStats { Value = value };}
}
The current functionality allows me to create a CustomStats class which includes several shared variables like maxHealth, walkSpeed, etc. However, in the Behavior Designer tasks, I cannot directly set, for example, the walkSpeed without first setting the entire CustomStats object. This approach is somewhat cumbersome and does not provide the clean, easy-to-navigate interface I aim for.
Ideally, I would like to have a nested menu system in the inspector where I could select a SharedCustomStats variable and then have a submenu or similar mechanism to select individual properties like walkSpeed directly.
Does anyone have experience with customizing the inspector for Behavior Designer to this extent, or could anyone provide guidance or suggestions on how this could be implemented? Any help or pointers towards relevant documentation or examples would be greatly appreciated.
Thank you!