예제 #1
0
    private void GenerateNodes(LevelMapSO _levelFlowSO)
    {
        //Start Data
        foreach (StartNodeData _data in _levelFlowSO.startNodeDatas)
        {
            StartNode _startNode = graphView.CreateStartNode(_data.position);
            _startNode.NodeGuid  = _data.guid;
            _startNode.startName = _data.startName;
            _startNode.portSet   = _data.portSet;
            _startNode.LoadValueIntoField();

            graphView.AddElement(_startNode);
        }
        //Level Node
        foreach (LevelNodeData _data in _levelFlowSO.levelNodeDatas)
        {
            LevelNode _lvNode = graphView.CreateLevelNode(_data.position);
            _lvNode.NodeGuid = _data.guid;
            //_lvNode.scene = _data.scene;
            //_lvNode.scenePath = _data.scenePath;
            _lvNode.scenAssetGuid = _data.sceneAssestGuid;
            _lvNode.asyncType     = _data.asyncType;
            _lvNode.loadType      = _data.loadType;
            _lvNode.portSets      = _data.portSets;
            _lvNode.scenePath     = _data.scenePath;
            Debug.Log("1. GenerateNodes  port count" + _data.portSets.Count);
            _lvNode.LoadValueIntoField();

            graphView.AddElement(_lvNode);
        }
    }
예제 #2
0
    private bool CheckForNodeType(SearchTreeEntry _searchTreeEntry, Vector2 _pos)
    {
        switch (_searchTreeEntry.userData)
        {
        case LevelNode node:
            graphView.AddElement(graphView.CreateLevelNode(_pos));
            return(true);

        case StartNode node:
            graphView.AddElement(graphView.CreateStartNode(_pos));
            return(true);

        default:
            break;
        }

        return(false);
    }