コード例 #1
0
        void AddJointIfAcceptOneWay()
        {
            OneWayAttribute oneWay = (OneWayAttribute)Attribute.GetCustomAttribute(scriptableObject.GetType(), typeof(OneWayAttribute));

            if (oneWay != null)
            {
                Joint jData = Joint.GetInstance(scriptableObject, windowRect, JointType.OneWay_IN, scriptableObject.EditorWindowRect.position, this);
                if (!Joints.Contains(jData))
                {
                    Joints.Add(jData);
                }
                currentJoints.Add(jData);
            }
        }
コード例 #2
0
        JointType GetPropertyJointType(SerializedProperty property)
        {
            if (property.propertyType != SerializedPropertyType.ObjectReference)
            {
                return(JointType.Nan);
            }

            //Handle OneWay connections

            OneWayAttribute oneWay = (OneWayAttribute)Attribute.GetCustomAttribute
                                         (property.serializedObject.targetObject.GetType().GetField(property.name), typeof(OneWayAttribute));

            if (oneWay == null)
            {
                return(JointType.Nan);
            }
            else
            {
                return(JointType.OneWay_OUT);
            }
        }