Пример #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())
                        {
                            GPUAnimationsRef animationTexture = SerializedPropertyUtils.GetSerializedPropertyValue <GPUAnimationsRef>(property);
                            animationTexture.UnloadTexture();
                            SerializedPropertyUtils.SetSerializedPropertyValue(property, animationTexture);
                        }

                        EditorGUI.EndProperty();
                    }