Beispiel #1
0
        public override bool AcceptsConnection(MyNode fromNode, int fromIndex, int toIndex)
        {
            MyParentInput groupInput = GroupInputNodes[toIndex];

            // Find all nodes connected to the input and check that they all accept the connection.
            // If the input is not connected to anything, it'll accept all connections.
            return(Children.Union(GroupOutputNodes).All(child => child.InputConnections
                                                        .Where(connection => connection != null && connection.From == groupInput)
                                                        .WithIndex()
                                                        .All(connection => child.AcceptsConnection(fromNode, fromIndex, connection.Index))));
        }
Beispiel #2
0
        internal void InitInputNodes()
        {
            for (int i = 0; i < GroupInputNodes.Length; i++)
            {
                if (GroupInputNodes[i] == null)
                {
                    MyParentInput inputNode = Owner.CreateNode <MyParentInput>();
                    inputNode.Name             = "Input " + (i + 1);
                    inputNode.ParentInputIndex = i;
                    inputNode.Parent           = this;

                    GroupInputNodes[i] = inputNode;
                }
            }
        }