예제 #1
0
 public static void SetInstanceValue(EntryUnit entry, Flow flow, ValueInput returns)
 {
     if (entry.targets.Count > 0)
     {
         entry.targets[entry.targets.Count - 1].returnObject = flow.GetValue(returns);
     }
 }
예제 #2
0
 public FlowGraph InitializeGraph(ref EntryUnit unit)
 {
     graph             = new FlowGraph();
     graph.controlAxis = Axis2.Vertical;
     graph.units.Add(entry);
     entry.macro = owner;
     ((ConstructorUnit)entry).declaration = this;
     return(graph);
 }
예제 #3
0
        protected override void Definition()
        {
            base.Definition();

            if (graph != null)
            {
                if (entry == null)
                {
                    entry = entry ?? graph?.units?.OfType <EntryUnit>().ToListPooled()[0];
                }
            }
        }
예제 #4
0
        public FlowGraph InitializeGraph()
        {
            var entry = new ConstructorUnit();

            graph             = new FlowGraph();
            graph.controlAxis = Axis2.Vertical;
            graph.units.Add(entry);
            this.entry        = entry;
            entry.macro       = owner;
            entry.declaration = this;
            return(graph);
        }
예제 #5
0
        public override void AfterAdd()
        {
            base.AfterAdd();

            for (int i = 0; i < graph.units.Count; i++)
            {
                if (graph.units[i].GetType() == typeof(EntryUnit))
                {
                    entry = (EntryUnit)graph.units[i];
                    entry.AddReturn(this);
                    returnType = entry.returnType;
                    break;
                }
            }
        }
예제 #6
0
        protected sealed override void Definition()
        {
            if (canDefine)
            {
                if (graph != null)
                {
                    if (entry == null || entry.graph != null && entry.graph != graph)
                    {
                        entry = entry ?? graph?.units?.OfType <EntryUnit>().First();
                    }
                }

                DefinePorts();
            }
        }
예제 #7
0
 public void Awake()
 {
     if (graph == null)
     {
         graph = new FlowGraph();
     }
     if (entry == null)
     {
         entry = new EntryUnit();
     }
     if (entry.macro == null)
     {
         entry.macro = this;
     }
     if (!graph.units.Contains(entry))
     {
         graph.units.Add(entry);
     }
 }
예제 #8
0
        protected override void OnEnable()
        {
            base.OnEnable();

            if (graph == null)
            {
                graph = new FlowGraph();
            }
            if (entry == null)
            {
                entry = new EntryUnit();
            }
            if (entry.macro == null)
            {
                entry.macro = this;
            }
            if (!graph.units.Contains(entry))
            {
                graph.units.Add(entry);
            }
        }