Skip to main content

set_image

Function set_image 

Source
pub fn set_image(
    object: &ObjectRef,
    source: &Source<'_>,
    target: Option<i32>,
    mipmap_count: i32,
) -> Result<Bytes, WriteError>
Expand description

Update and re-save a Texture2D, propagating changed state to its parents. None or target zero defaults to m_TextureFormat. Absent optional mip, stream and platform fields stay absent, and platform blobs stay unchanged. Failure preserves the object’s previous installed bytes and changed state. Like UnityPy’s ObjectReader, subsequent reads still see the original data. The returned bytes are the exact updated object serialization.