private static NodeProto BehaviorNodeConfigToNodeProto(BehaviorNodeConfig behaviorNodeConfig) { NodeProto nodeProto = new NodeProto { Id = behaviorNodeConfig.id, Name = behaviorNodeConfig.name, Desc = behaviorNodeConfig.describe, Args = behaviorNodeConfig.GetArgsDict(), children = new List <NodeProto>() }; foreach (Transform child in behaviorNodeConfig.gameObject.transform) { BehaviorNodeConfig nodeConfig = child.gameObject.GetComponent <BehaviorNodeConfig>(); NodeProto childData = BehaviorNodeConfigToNodeProto(nodeConfig); nodeProto.children.Add(childData); } return(nodeProto); }
public void Clear() { DestroyImmediate(RootNodeConfig, true); RootNodeConfig = null; }