Пример #1
0
    public void IterationChild(NodeCombiner parentNode, NodeValue nodeValue)
    {
        for (int i = 0; i < nodeValue.childNodeList.Count; ++i)
        {
            NodeValue childNode = nodeValue.childNodeList[i];
            NodeRoot  node      = GetNodeRoot(childNode);
            parentNode.AddNode(node);

            if (node.GetType().IsSubclassOf(typeof(NodeCombiner)))
            {
                IterationChild((NodeCombiner)node, childNode);
            }
        }
    }
Пример #2
0
    public NodeRoot GetNode(NodeAsset nodeAsset)
    {
        NodeValue nodeValue = nodeAsset.nodeValue;

        if (nodeValue == null)
        {
            Debug.LogError("RootNode is null");
            return(null);
        }

        NodeRoot rootNode = GetNodeRoot(nodeValue);

        if (rootNode.GetType().IsSubclassOf(typeof(NodeCombiner)))
        {
            IterationChild((NodeCombiner)rootNode, nodeValue);
        }

        return(rootNode);
    }