Skip to main content

engage/generated/unity_engine/addressable_assets/
assetreferencesprite.rs

1// @generated by il2cpp-bindgen — do not edit by hand.
2
3#[cfg(feature = "unity_engine-addressable_assets-assetreferencesprite-types")]
4mod __types {
5    #[allow(unused_imports)] use ::unity::prelude::*;
6
7    use super::*;
8    use crate::{
9        system::object::{IObject, Object},
10        unity_engine::addressable_assets::{
11            assetreference::{AssetReference, IAssetReference},
12            assetreferencet_1::{AssetReferenceT_1, IAssetReferenceT_1},
13        },
14    };
15
16    #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/unity_engine/addressable_assets/assetreferencesprite/AssetReferenceSprite.md"))]
17    #[::unity::class(namespace = "UnityEngine.AddressableAssets", name = "AssetReferenceSprite")]
18    #[parent(crate::unity_engine::addressable_assets::assetreferencet_1::AssetReferenceT_1<crate::unity_engine::sprite::Sprite>)]
19    pub struct AssetReferenceSprite {}
20}
21
22#[cfg(feature = "unity_engine-addressable_assets-assetreferencesprite-types")]
23pub use __types::*;
24
25#[cfg(feature = "unity_engine-addressable_assets-assetreferencesprite")]
26pub trait IAssetReferenceSpriteMethods: IAssetReferenceSprite {
27    #[doc = "`.ctor(::unity::Il2CppString)` overload"]
28    fn ctor(self, guid: impl ::core::convert::Into<::unity::Il2CppString>) -> () {
29        unsafe {
30            let __receiver = <AssetReferenceSprite as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
31            ::unity::il2cpp_call!((::unity::module_base()+0x2db2fa0usize)as*mut u8,();
32(AssetReferenceSprite)__receiver,(::unity::Il2CppString)::core::convert::Into::into(guid))
33        }
34    }
35    #[doc = "`ValidateAsset(::unity::Il2CppString)` overload"]
36    fn validate_asset(self, path: impl ::core::convert::Into<::unity::Il2CppString>) -> bool {
37        unsafe {
38            let __receiver = <AssetReferenceSprite as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
39            {
40                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
41                let __vi = *__vt.get(21usize).unwrap_or_else(|| {
42                    panic!(
43                        "unity: virtual slot {}
44 out of range (vtable len {}
45) on the runtime class behind {}
46 (method `{}
47`)",
48                        21usize,
49                        __vt.len(),
50                        <AssetReferenceSprite as ::unity::ClassIdentity>::NAME,
51                        "ValidateAsset",
52                    )
53                });
54                let __inner: extern "C" fn(AssetReferenceSprite, ::unity::Il2CppString, ::unity::OptionalMethod) -> bool =
55                    ::core::mem::transmute(__vi.method_ptr);
56                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
57                __inner(__receiver, ::core::convert::Into::into(path), __mi)
58            }
59        }
60    }
61}
62
63#[cfg(feature = "unity_engine-addressable_assets-assetreferencesprite")]
64impl<__T: IAssetReferenceSprite> IAssetReferenceSpriteMethods for __T {}
65
66#[cfg(feature = "unity_engine-addressable_assets-assetreferencesprite")]
67impl AssetReferenceSprite {
68    pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
69        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
70    }
71
72    pub fn validate_asset_method_info() -> &'static ::unity::il2cpp::MethodInfo {
73        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
74    }
75}
76
77#[cfg(feature = "unity_engine-addressable_assets-assetreferencesprite")]
78impl AssetReferenceSprite {
79    #[doc = "Direct (non-virtual) call to `AssetReferenceSprite`'s own `ValidateAsset`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
80    pub unsafe fn validate_asset(this: impl ::core::convert::Into<::unity::IlInstance>, path: ::unity::Il2CppString) -> bool {
81        let __mi = Self::validate_asset_method_info();
82        let __inner: extern "C" fn(::unity::IlInstance, ::unity::Il2CppString, ::unity::OptionalMethod) -> bool =
83            ::core::mem::transmute(__mi.method_ptr);
84        __inner(this.into(), path, ::core::option::Option::None)
85    }
86}
87
88#[cfg(feature = "unity_engine-addressable_assets-assetreferencesprite")]
89impl AssetReferenceSprite {
90    #[doc = "`.ctor(::unity::Il2CppString)` — overload selector"]
91    pub fn new(guid: ::unity::Il2CppString) -> Self {
92        let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
93            panic!(
94                "{}
95::{}
96 failed to instantiate",
97                ::core::stringify!(AssetReferenceSprite),
98                ::core::stringify!(new),
99            )
100        });
101        <Self as IAssetReferenceSpriteMethods>::ctor(this, guid);
102        this
103    }
104}
105
106#[cfg(feature = "unity_engine-addressable_assets-assetreferencesprite")]
107#[doc(hidden)]
108pub mod prelude {
109    pub use super::{AssetReferenceSprite, IAssetReferenceSprite, IAssetReferenceSpriteMethods};
110    #[cfg(feature = "system-object")]
111    pub use crate::system::object::IObjectMethods;
112    #[cfg(feature = "unity_engine-addressable_assets-assetreference")]
113    pub use crate::unity_engine::addressable_assets::assetreference::IAssetReferenceMethods;
114    #[cfg(feature = "unity_engine-addressable_assets-assetreferencet_1")]
115    pub use crate::unity_engine::addressable_assets::assetreferencet_1::IAssetReferenceT_1Methods;
116    pub use crate::{
117        system::object::IObject,
118        unity_engine::addressable_assets::{assetreference::IAssetReference, assetreferencet_1::IAssetReferenceT_1},
119    };
120}