コード例 #1
0
        protected override bool CouldLinkMyInputTo(VFXDataAnchorController myInput, VFXDataAnchorController otherOutput, VFXDataAnchorController.CanLinkCache cache)
        {
            if (otherOutput.direction == myInput.direction)
            {
                return(false);
            }

            if (!myInput.CanLinkToNode(otherOutput.sourceNode, cache))
            {
                return(false);
            }
            return(model.GetBestAffinityType(otherOutput.portType) != null);
        }
コード例 #2
0
        protected override bool CouldLinkMyInputTo(VFXDataAnchorController myInput, VFXDataAnchorController otherOutput, VFXDataAnchorController.CanLinkCache cache)
        {
            if (!myInput.model.IsMasterSlot())
            {
                return(false);
            }
            if (otherOutput.direction == myInput.direction)
            {
                return(false);
            }

            if (!myInput.CanLinkToNode(otherOutput.sourceNode, cache))
            {
                return(false);
            }

            int inputIndex = model.GetSlotIndex(myInput.model);
            IVFXOperatorNumericUnifiedConstrained constraintInterface = model as IVFXOperatorNumericUnifiedConstrained;


            var bestAffinityType = model.GetBestAffinityType(otherOutput.portType);

            if (bestAffinityType == null)
            {
                return(false);
            }
            if (constraintInterface.slotIndicesThatCanBeScalar.Contains(inputIndex))
            {
                if (VFXTypeUtility.GetComponentCount(otherOutput.model) != 0)  // If it is a vector or float type, then conversion to float exists
                {
                    return(true);
                }
            }

            return(model.GetBestAffinityType(otherOutput.portType) != null);
        }