Inspector Editor & Task Draw

Hiyukisenya

New member
Hi I'm a novice programmer who just bought
Since my main language is not English, the following uses Googl translation:

Currently writing a visual BehaviorTree of the tool class, but found the following problems:
1.declare variable shows that the structure is not Unity Editor as shown in Figure 1
2. I can't find Task's Inspector has Editor script
3. The same Task code of the Invoke Method cannot have the same Inspector display as shown in Figure 2
4. OnDrawGizmos() cannot work on any screen other than Scene Window as shown in Figure 3

Since I'm writing a tool, I can make it as user-friendly as possible, doing the following ideas such as:
1. Task Draw dynamically changes [ TaskIcon ( "" )] at runtime, so as to know what image to load, or state diagram
2. The color of the Task connection line at runtime, change color to know the more accurate operation route
3. At runtime, the color graphic in the running Task changes size + color to let OnUpdate() wait for Animator or TimeLine's Play to know the remaining time of the run
4. Use the NaughtyAttributes plugin to optimize the display on the Inspector

Above, I tried my best to find references and teachings. Maybe there are answers, but I can't find them, so I came here for help. The main questions are:
1. Customize the Inspector Editor
2. Customize the Task Draw Editor
thanks
Unity 2022.1.17f1
Behavior Designer Expansion 1.7.3
 

Attachments

  • 1.png
    1.png
    76.7 KB · Views: 6
  • 2.png
    2.png
    45.6 KB · Views: 6
  • 3.png
    3.png
    293.1 KB · Views: 6
1.declare variable shows that the structure is not Unity Editor as shown in Figure 1
Unity Events drawing requires a SerializedProperty in order to draw and tasks are not SerializedObjects so they don't have a SerializedProperty. Unfortunately I haven't found a workaround for this.

2. I can't find Task's Inspector has Editor script
Can you give more details for this question?

3. The same Task code of the Invoke Method cannot have the same Inspector display as shown in Figure 2
That looks like a custom invoke method? The reflection tasks are drawn using a custom editor so that's why the first task looks different from a new task. You can use object drawers to create your own editor:


4. OnDrawGizmos() cannot work on any screen other than Scene Window as shown in Figure 3
If I'm understanding correctly gizmos are drawn to the scene and not to the game window.

Since I'm writing a tool, I can make it as user-friendly as possible, doing the following ideas such as:
1. Task Draw dynamically changes [ TaskIcon ( "" )] at runtime, so as to know what image to load, or state diagram
2. The color of the Task connection line at runtime, change color to know the more accurate operation route
3. At runtime, the color graphic in the running Task changes size + color to let OnUpdate() wait for Animator or TimeLine's Play to know the remaining time of the run
4. Use the NaughtyAttributes plugin to optimize the display on the Inspector
Thanks for the suggestions. I will try to think of a way to make these possible :)
 
Top