114 ConditionalHideInInspector
attr = attribute as ConditionalHideInInspector;
117 SerializedProperty prop = property.serializedObject.FindProperty(attr.hideConditionPropertyName);
122 if(prop.type==
"bool") {
123 val = prop.boolValue;
125 else if(prop.type==
"float") {
127 attr.ctype == ct.BIGGEREQUAL && prop.floatValue >= attr.compareValue ||
128 attr.ctype == ct.BIGGER && prop.floatValue > attr.compareValue ||
129 attr.ctype == ct.SMALLEREQUAL && prop.floatValue <= attr.compareValue ||
130 attr.ctype == ct.SMALLER && prop.floatValue < attr.compareValue ||
131 attr.ctype == ct.EQUAL && prop.floatValue == attr.compareValue ||
132 attr.ctype == ct.UNEQUAL && prop.floatValue != attr.compareValue;
134 else if (prop.type ==
"int") {
136 attr.ctype == ct.BIGGEREQUAL && prop.intValue >= attr.compareValue ||
137 attr.ctype == ct.BIGGER && prop.intValue > attr.compareValue ||
138 attr.ctype == ct.SMALLEREQUAL && prop.intValue <= attr.compareValue ||
139 attr.ctype == ct.SMALLER && prop.intValue < attr.compareValue ||
140 attr.ctype == ct.EQUAL && prop.intValue == attr.compareValue ||
141 attr.ctype == ct.UNEQUAL && prop.intValue != attr.compareValue;
143 else if (prop.type ==
"double") {
145 attr.ctype == ct.BIGGEREQUAL && prop.doubleValue >= attr.compareValue ||
146 attr.ctype == ct.BIGGER && prop.doubleValue > attr.compareValue ||
147 attr.ctype == ct.SMALLEREQUAL && prop.doubleValue <= attr.compareValue ||
148 attr.ctype == ct.SMALLER && prop.doubleValue < attr.compareValue ||
149 attr.ctype == ct.EQUAL && prop.doubleValue == attr.compareValue ||
150 attr.ctype == ct.UNEQUAL && prop.doubleValue != attr.compareValue;
152 else if (prop.type ==
"long") {
154 attr.ctype == ct.BIGGEREQUAL && prop.longValue >= attr.compareValue ||
155 attr.ctype == ct.BIGGER && prop.longValue > attr.compareValue ||
156 attr.ctype == ct.SMALLEREQUAL && prop.longValue <= attr.compareValue ||
157 attr.ctype == ct.SMALLER && prop.longValue < attr.compareValue ||
158 attr.ctype == ct.EQUAL && prop.longValue == attr.compareValue ||
159 attr.ctype == ct.UNEQUAL && prop.longValue != attr.compareValue;
161 else if (prop.type ==
"Enum") {
163 attr.ctype == ct.BIGGEREQUAL && prop.enumValueIndex >= attr.compareValue ||
164 attr.ctype == ct.BIGGER && prop.enumValueIndex > attr.compareValue ||
165 attr.ctype == ct.SMALLEREQUAL && prop.enumValueIndex <= attr.compareValue ||
166 attr.ctype == ct.SMALLER && prop.enumValueIndex < attr.compareValue ||
167 attr.ctype == ct.EQUAL && prop.enumValueIndex == attr.compareValue ||
168 attr.ctype == ct.UNEQUAL && prop.enumValueIndex != attr.compareValue;
171 val = prop.objectReferenceValue != null;
174 val ^= attr.invertCondition;
186 EditorGUI.PropertyField(position, property,
new GUIContent(property.displayName));
ConditionalHideInInspector attr