How to modify the value of task through the code of unityEditor, such as MenuItem, etc.

It looks like you are trying to modify the value at edit time? You will need to reserialize the tree after it has been modified. The editor is going to reload the tree when it is in focus and Unity isn't playing.

 
Yes,I am trying to modify the value at edit time.I Try to use "behaviorTree.CheckForSerialization(true);",But it doesn't work.
It looks like you are trying to modify the value at edit time? You will need to reserialize the tree after it has been modified. The editor is going to reload the tree when it is in focus and Unity isn't playing.

 
CheckForSerialization won't help here - use the Save method that is mentioned in the post that I linked to.
 
Top