예제 #1
0
파일: XLander.cs 프로젝트: swipswaps/XLand
        public DataFlowGraph GetGraph(string paramName)
        {
            DataFlowGraph graph;

            if (!m_DataFlowGraphs.TryGetValue(paramName, out graph))
            {
                graph = new DataFlowGraph();
                m_DataFlowGraphs.Add(paramName, graph);
            }

            // Ensure there is a param output node
            if (graph.nodes.All(n => n.GetType() != typeof(ParamHandlerNode)))
            {
                var nn = Node.Create(this, typeof(ParamHandlerNode), node =>
                {
                    var n       = node as ParamHandlerNode;
                    n.paramName = paramName;
                });
                if (nn != null)
                {
                    graph.nodes.Add(nn);
                }
            }

            return(graph);
        }
예제 #2
0
파일: XLander.cs 프로젝트: swipswaps/XLand
 private void LoadData(XLanderData data)
 {
     m_DataFlowGraphs.Clear();
     foreach (var pair in data.graphs)
     {
         if (!HaveParam(pair.Key))
         {
             continue;
         }
         var graph = new DataFlowGraph();
         graph.LoadData(pair.Value, this);
         m_DataFlowGraphs.Add(pair.Key, graph);
     }
 }
예제 #3
0
        private void LoadNewGraph()
        {
            if (CurrentParamHandler == null)
            {
                m_CurrentDataFlowGraph = null;
                return;
            }

            // fetch new DataFlowGraph
            var model = ModelManager.Instance.CurrentActiveModel;

            if (model == null)
            {
                m_CurrentDataFlowGraph = null;
                return;
            }

            var xLander = model.GetComponent <XLander>();

            Assert.IsNotNull(xLander);
            m_CurrentDataFlowGraph = xLander.GetGraph(CurrentParamHandler.Name);
        }