Exemplo n.º 1
0
        public bool Connect(NodeBase p_inputNode, int p_inputIndex, NodeBase p_outputNode, int p_outputIndex)
        {
            bool exists = Connections.Exists(c =>
                                             c.inputNode == p_inputNode && c.inputIndex == p_inputIndex && c.outputNode == p_outputNode &&
                                             c.outputIndex == p_outputIndex);

            if (exists || p_inputNode.InputCount <= p_inputIndex || p_outputNode.OutputCount <= p_outputIndex)
            {
                return(false);
            }

            NodeConnection connection = new NodeConnection(p_inputIndex, p_inputNode, p_outputIndex, p_outputNode);

            _connections.Add(connection);
            return(true);
        }
Exemplo n.º 2
0
        internal override Transform ResolveNodeRetarget(Transform p_transform, NodeConnection p_connection)
        {
            if (p_connection.outputIndex == 1)
            {
                return(p_transform);
            }

            Transform retarget = base.ResolveNodeRetarget(p_transform, null);

            if (retarget != null && retarget.childCount > 0)
            {
                return(retarget.GetChild(0));
            }

            return(null);
        }
Exemplo n.º 3
0
 public void Disconnect(NodeConnection p_connection)
 {
     _connections.Remove(p_connection);
     ((INodeAccess)p_connection.inputNode).OnConnectionRemoved?.Invoke(p_connection);
 }
Exemplo n.º 4
0
 internal virtual Transform ResolveNodeRetarget(Transform p_transform, NodeConnection p_connection)
 {
     return p_transform;
 }
Exemplo n.º 5
0
 internal override Transform ResolveNodeRetarget(Transform p_transform, NodeConnection p_connection)
 {
     // Hack where we resend null connection to may it think it is the last one
     return(base.ResolveNodeRetarget(p_transform, null));
 }