Skip to main content

Shader

Struct Shader 

Source
#[repr(C)]
pub struct Shader { pub object: Object, }

Fields§

§object: Object

Implementations§

Source§

impl Shader

Source

pub fn from_ptr(ptr: *mut c_void) -> Self

Source§

impl Shader

Source

pub fn get_class() -> Option<Class>

Gets the Shader class definition

§Returns
  • Option<Class> - The UnityEngine.Shader class
Source

pub fn find(name: &str) -> Option<Self>

Finds a shader with the given name.

§Arguments
  • name - The name of the shader to find
§Returns
  • Option<Shader> - The shader if found, None otherwise
Source

pub fn property_to_id(name: &str) -> i32

Gets the unique identifier for a shader property name.

§Arguments
  • name - The property name
§Returns
  • i32 - The ID of the property

Methods from Deref<Target = Object>§

Source

pub fn as_ptr(&self) -> *mut c_void

Returns the raw pointer to the object

§Returns
  • *mut c_void - The raw pointer
Source

pub fn field(&self, name: &str) -> Option<Field>

Returns an instance-bound field lookup.

The returned Field carries this object’s instance pointer so Field::get_value and Field::set_value can operate on it.

Source

pub fn method<S: MethodSelector>(&self, selector: S) -> Option<Method>

Returns an instance-bound method lookup.

This is the preferred way to prepare instance method calls because the returned Method already carries the correct this pointer.

Source

pub fn property(&self, name: &str) -> Option<Property>

Returns an instance-bound property lookup.

Source

pub fn il2cpp_to_string(&self) -> String

Calls ToString on the object

§Returns
  • String - The string representation, or “null” if failed
Source

pub fn get_game_object(&self) -> Result<GameObject, String>

Gets the GameObject associated with this object (if Is a Component)

§Returns
  • Result<GameObject, String> - The GameObject, or an error if null/not found
Source

pub fn get_class(&self) -> Option<Class>

Gets the class of this object

§Returns
  • Option<Class> - The class definition, or None if failed
Source

pub fn get_virtual_method(&self, method: &Method) -> *mut c_void

Gets the virtual method implementation for this object

§Arguments
  • method - The method definition to resolve
§Returns
  • *mut c_void - Pointer to the implementation
Source

pub fn init_exception(&self, exc: &mut c_void)

Initializes an exception object

§Arguments
  • exc - Pointer to the exception object
Source

pub fn get_size(&self) -> u32

Gets the size of the object

§Returns
  • u32 - Size in bytes
Source

pub fn unbox(&self) -> *mut c_void

Unboxes a value type object

§Returns
  • *mut c_void - Pointer to the unboxed value

Trait Implementations§

Source§

impl Clone for Shader

Source§

fn clone(&self) -> Shader

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Shader

Source§

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

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

impl Deref for Shader

Source§

type Target = Object

The resulting type after dereferencing.
Source§

fn deref(&self) -> &Self::Target

Dereferences the value.
Source§

impl Copy for Shader

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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<P, T> Receiver for P
where P: Deref<Target = T> + ?Sized, T: ?Sized,

Source§

type Target = T

🔬This is a nightly-only experimental API. (arbitrary_self_types)
The target type on which the method may be called.
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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.