Example #1
0
                public override void OnGUI(Rect position, SerializedProperty property, GUIContent label)
                {
                    EditorGUI.BeginProperty(position, label, property);

                    SerializedProperty assetProp = property.FindPropertyRelative("_asset");

                    EditorGUI.BeginChangeCheck();

                    EditorGUI.ObjectField(position, assetProp, label);

                    if (EditorGUI.EndChangeCheck())
                    {
                        AnimationTextureRef animationTexture = SerializedPropertyUtils.GetSerializedPropertyValue <AnimationTextureRef>(property);
                        animationTexture.UnloadTexture();
                    }

                    EditorGUI.EndProperty();
                }