How to open an ExternalBehaviour asset in BehaviourEditor via script

Coder

New member
I'm working on an Inspector that lists ExternalBehaviour assets. Next to each entry in that list, I'd like to have a button that opens the corresponding BehaviourTree inside BehaviourEditor.

How would I go about that?
 
Thanks for answering.

When using that code

Code:
BehaviorDesignerWindow.ShowWindow();
BehaviorDesignerWindow.instance.LoadBehavior(behavior.GetBehaviorSource(), false, true);

the Editor keeps opening the Tree, which belongs to the Behaviour component, that lives on the same GameObject, as my custom Inspector.

So I had to do this...

Code:
Behaviour.ExternalBehavior = behavior;
BehaviorDesignerWindow.ShowWindow();
BehaviorDesignerWindow.instance.LoadBehavior(behavior.GetBehaviorSource(), false, true);
 
Top