예제 #1
0
    void setConnection()
    {
        selectedParentNode.addChild(selectedChildNode);
        selectedChildNode.setParent(selectedParentNode);

        selectedChildNode  = null;
        selectedParentNode = null;

        fillBHTreeComponent(script.GetClass());
    }
예제 #2
0
    int readBHTreeComponent(int index, out BHEditorNode bhEditorNode)
    {
        BHNodeSerializable serializableNode = behaviourTreeComponent.bhNodesSerializable[index];

        bhEditorNode = new BHEditorNode((NodeType)serializableNode.nodeType,
                                        serializableNode.editorPos,
                                        nodeBoxStyle, childButtonStyle, parentButtonStyle);

        bhEditorNode.setFunctionName(serializableNode.functionName);
        bhEditorNode.removeNode = removeNode;
        bhEditorNode.setScriptType(script.GetClass());

        _nodes.Add(bhEditorNode);

        for (int i = 0; i < serializableNode.childCount; i++)
        {
            BHEditorNode childEditorNode;
            index = readBHTreeComponent(++index, out childEditorNode);
            childEditorNode.setParent(bhEditorNode);
            bhEditorNode.addChild(childEditorNode);
        }

        return(index);
    }