|
Window Framework for UI Toolkit v2.0.x
|
Editor-only bindable Texture2D picker with an image preview. More...


Public Member Functions | |
| TexturePreviewElement () | |
| Builds an editor object picker and preview using the packaged resource stylesheet. | |
| void | SetValueWithoutNotify (Object newValue) |
| Updates picker and preview without emitting this control's value-change event. | |
Static Public Attributes | |
| static readonly string | ussClassName = "texture-preview-element" |
| Root class used by the supplied editor preview stylesheet. | |
Properties | |
| Object | value [get, set] |
| Gets selected borrowed texture; assignment validates and sends ChangeEvent when changed. | |
Private Member Functions | |
| void | OnObjectFieldValueChanged (ChangeEvent< Object > evt) |
Private Attributes | |
| ObjectField | m_ObjectField |
| Image | m_Preview |
| Texture2D | m_Value |
Editor-only bindable Texture2D picker with an image preview.
Uses UnityEditor.UIElements.ObjectField and the texture_preview_element editor resource sheet. This is not a runtime player-image importer or a VectorImage picker. Selected project textures are borrowed and never destroyed by this control. Bind the value property or subscribe to ChangeEvent<UnityEngine.Object> in its owning inspector.
|
inline |
Builds an editor object picker and preview using the packaged resource stylesheet.


|
inlineprivate |

|
inline |
Updates picker and preview without emitting this control's value-change event.
| newValue | Borrowed Texture2D reference or null to clear. |
| ArgumentException | A nonnull value is not Texture2D. |
|
private |
|
private |
|
private |
|
static |
Root class used by the supplied editor preview stylesheet.
|
getset |
Gets selected borrowed texture; assignment validates and sends ChangeEvent when changed.
Same-value assignment is inert. Does not save a ScriptableObject or acquire/release imported textures. Use SetValueWithoutNotify for inspector synchronization to avoid feedback.