protected override void DrawComponentAfterDependenceCheck(Rect position, SerializedProperty property, GUIContent label, System.Type p_type)
    {
        SerializableTypeAttribute v_attr    = (SerializableTypeAttribute)attribute;
        SerializableType          v_serType = GetSerializableType(property);
        SerializableType          v_newType = InspectorUtils.SerializableTypePopup(position, label.text, v_serType, v_attr.FilterType, v_attr.AcceptGenericDefinitions);

        if (v_newType == null)
        {
            v_newType = new SerializableType();
        }
        if (v_serType.CastedType != v_newType.CastedType || v_serType.StringType != v_newType.StringType)
        {
            SetSerializableType(property, v_newType);
            try
            {
                EditorUtility.SetDirty(property.serializedObject.targetObject);
            }
            catch {}
        }
    }
Ejemplo n.º 2
0
        protected override void DrawComponentAfterDependenceCheck(Rect position, SerializedProperty property, GUIContent label, System.Type p_type)
        {
            SerializableTypeAttribute v_attr    = (SerializableTypeAttribute)attribute;
            SerializableType          v_serType = GetSerializableTypeValue(property);
            SerializableType          v_newType = KiltEditor.InspectorUtils.SerializableTypePopup(position, label.text, v_serType, v_attr.FilterType, v_attr.AcceptGenericDefinitions, v_attr.AcceptAbstractDefinitions, v_attr.AcceptNulls, v_attr.FilterAssemblies);

            if (v_newType == null)
            {
                v_newType = new SerializableType();
            }
            if (v_serType.CastedType != v_newType.CastedType || v_serType.StringType != v_newType.StringType)
            {
                SetSerializableTypeValue(property, v_newType);
                try
                {
#if UNITY_5_3_OR_NEWER
                    property.serializedObject.ApplyModifiedPropertiesWithoutUndo();
#else
                    EditorUtility.SetDirty(property.serializedObject.targetObject);
#endif
                }
                catch { }
            }
        }