Texture2D

Struct Texture2D 

Source
pub struct Texture2D {
Show 27 fields pub m_CompleteImageSize: i64, pub m_Height: i32, pub m_ImageCount: i32, pub m_IsReadable: bool, pub m_LightmapFormat: i32, pub m_Name: String, pub m_TextureDimension: i32, pub m_TextureFormat: i32, pub m_TextureSettings: GLTextureSettings, pub m_Width: i32, pub image_data: Option<Vec<u8>>, pub m_ColorSpace: Option<i32>, pub m_DownscaleFallback: Option<bool>, pub m_ForcedFallbackFormat: Option<i32>, pub m_IgnoreMasterTextureLimit: Option<bool>, pub m_IgnoreMipmapLimit: Option<bool>, pub m_IsAlphaChannelOptional: Option<bool>, pub m_IsPreProcessed: Option<bool>, pub m_MipCount: Option<i32>, pub m_MipMap: Option<bool>, pub m_MipmapLimitGroupName: Option<String>, pub m_MipsStripped: Option<i32>, pub m_PlatformBlob: Option<Vec<u8>>, pub m_ReadAllowed: Option<bool>, pub m_StreamData: Option<StreamingInfo>, pub m_StreamingMipmaps: Option<bool>, pub m_StreamingMipmapsPriority: Option<i32>,
}
Expand description

Texture2D is a class of the Unity engine since version 3.4.0. Exert from Unity’s scripting documentation: Class that represents textures in C# code. Use this class to create textures, or to modify existing texture assets.The ImageConversion class provides extension methods to this class that handle image encoding functionality. For details on those methods, see the ImageConversion documentation.Do not assume that the texture will be created and available in Awake. All texture uploads are synchronized on the Main thread at Start. Perform texture operations in Start.

Fields§

§m_CompleteImageSize: i64§m_Height: i32

Height of the Texture in pixels (Read Only).

§m_ImageCount: i32§m_IsReadable: bool

Whether Unity stores an additional copy of this texture’s pixel data in CPU-addressable memory.

§m_LightmapFormat: i32§m_Name: String

The name of the object.

§m_TextureDimension: i32§m_TextureFormat: i32§m_TextureSettings: GLTextureSettings§m_Width: i32

Width of the Texture in pixels (Read Only).

§image_data: Option<Vec<u8>>

Vec: (3.4.0 - 2022.3.2f1)

§m_ColorSpace: Option<i32>

i32: (3.5.0 - 2022.3.2f1)

§m_DownscaleFallback: Option<bool>

bool: (2017.3.0b1 - 2022.3.2f1)

§m_ForcedFallbackFormat: Option<i32>

i32: (2017.3.0b1 - 2022.3.2f1)

§m_IgnoreMasterTextureLimit: Option<bool>

bool: (2019.3.0f6 - 2022.2.0a18)

§m_IgnoreMipmapLimit: Option<bool>

This property causes a texture to ignore all texture mipmap limit settings. bool: (2022.2.0f1 - 2022.3.2f1)

§m_IsAlphaChannelOptional: Option<bool>

bool: (2020.2.0b1 - 2022.3.2f1)

§m_IsPreProcessed: Option<bool>

bool: (2019.4.9f1 - 2022.3.2f1)

§m_MipCount: Option<i32>

i32: (5.2.0f2 - 2022.3.2f1)

§m_MipMap: Option<bool>

bool: (3.4.0 - 5.1.5f1)

§m_MipmapLimitGroupName: Option<String>

String: (2022.2.0f1 - 2022.3.2f1)

§m_MipsStripped: Option<i32>

i32: (2020.1.0b1 - 2022.3.2f1)

§m_PlatformBlob: Option<Vec<u8>>

Vec: (2020.2.0b1 - 2022.3.2f1)

§m_ReadAllowed: Option<bool>

bool: (3.4.0 - 5.4.6f3)

§m_StreamData: Option<StreamingInfo>

StreamingInfo: (5.3.0f1 - 2022.3.2f1)

§m_StreamingMipmaps: Option<bool>

Determines whether mipmap streaming is enabled for this Texture. bool: (2018.2.0b1 - 2022.3.2f1)

§m_StreamingMipmapsPriority: Option<i32>

Sets the relative priority for this Texture when reducing memory size to fit within the memory budget. i32: (2018.2.0b1 - 2022.3.2f1)

Trait Implementations§

Source§

impl Debug for Texture2D

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Texture2D

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for Texture2D

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,