Skip to main content

engage/generated/unity_engine/
resourcesapi.rs

1// @generated by il2cpp-bindgen — do not edit by hand.
2
3#[cfg(feature = "unity_engine-resourcesapi-types")]
4mod __types {
5    #[allow(unused_imports)] use ::unity::prelude::*;
6
7    use super::*;
8    use crate::system::object::{IObject, Object};
9
10    #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/unity_engine/resourcesapi/ResourcesAPI.md"))]
11    #[::unity::class(namespace = "UnityEngine", name = "ResourcesAPI")]
12    #[parent(crate::system::object::Object)]
13    pub struct ResourcesAPI {
14        #[static_field]
15        #[rename(name = "s_DefaultAPI")]
16        pub s_default_api: crate::unity_engine::resourcesapi::ResourcesAPI,
17    }
18}
19
20#[cfg(feature = "unity_engine-resourcesapi-types")]
21pub use __types::*;
22
23#[cfg(feature = "unity_engine-resourcesapi")]
24impl ResourcesAPI {
25    #[doc = "`get_ActiveAPI()` overload"]
26    pub fn get_active_api() -> crate::unity_engine::resourcesapi::ResourcesAPI {
27        unsafe {
28            ::unity::il2cpp_call!((::unity::module_base()+0x2f890f0usize)as*mut u8,crate::unity_engine::resourcesapi::ResourcesAPI;
29            )
30        }
31    }
32
33    #[doc = "`get_overrideAPI()` overload"]
34    pub fn get_override_api() -> crate::unity_engine::resourcesapi::ResourcesAPI {
35        unsafe {
36            ::unity::il2cpp_call!((::unity::module_base()+0x2f89410usize)as*mut u8,crate::unity_engine::resourcesapi::ResourcesAPI;
37            )
38        }
39    }
40
41    #[doc = "`.cctor()` overload"]
42    pub fn cctor() -> () {
43        unsafe {
44            ::unity::il2cpp_call!((::unity::module_base()+0x2f89880usize)as*mut u8,();
45            )
46        }
47    }
48}
49
50#[cfg(feature = "unity_engine-resourcesapi")]
51pub trait IResourcesAPIMethods: IResourcesAPI {
52    #[doc = "`.ctor()` overload"]
53    fn ctor(self) -> () {
54        unsafe {
55            let __receiver = <ResourcesAPI as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
56            ::unity::il2cpp_call!((::unity::module_base()+0x2f89480usize)as*mut u8,();
57(ResourcesAPI)__receiver)
58        }
59    }
60    #[doc = "`FindObjectsOfTypeAll(::unity::SystemType)` overload"]
61    fn find_objects_of_type_all(
62        self,
63        system_type_instance: impl ::core::convert::Into<::unity::SystemType>,
64    ) -> ::unity::Array<crate::unity_engine::object_2::Object_2> {
65        unsafe {
66            let __receiver = <ResourcesAPI as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
67            {
68                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
69                let __vi = *__vt.get(4usize).unwrap_or_else(|| {
70                    panic!(
71                        "unity: virtual slot {}
72 out of range (vtable len {}
73) on the runtime class behind {}
74 (method `{}
75`)",
76                        4usize,
77                        __vt.len(),
78                        <ResourcesAPI as ::unity::ClassIdentity>::NAME,
79                        "FindObjectsOfTypeAll",
80                    )
81                });
82                let __inner: extern "C" fn(
83                    ResourcesAPI,
84                    ::unity::SystemType,
85                    ::unity::OptionalMethod,
86                ) -> ::unity::Array<crate::unity_engine::object_2::Object_2> = ::core::mem::transmute(__vi.method_ptr);
87                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
88                __inner(__receiver, ::core::convert::Into::into(system_type_instance), __mi)
89            }
90        }
91    }
92    #[doc = "`FindShaderByName(::unity::Il2CppString)` overload"]
93    fn find_shader_by_name(self, name: impl ::core::convert::Into<::unity::Il2CppString>) -> crate::unity_engine::shader::Shader {
94        unsafe {
95            let __receiver = <ResourcesAPI as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
96            {
97                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
98                let __vi = *__vt.get(5usize).unwrap_or_else(|| {
99                    panic!(
100                        "unity: virtual slot {}
101 out of range (vtable len {}
102) on the runtime class behind {}
103 (method `{}
104`)",
105                        5usize,
106                        __vt.len(),
107                        <ResourcesAPI as ::unity::ClassIdentity>::NAME,
108                        "FindShaderByName",
109                    )
110                });
111                let __inner: extern "C" fn(ResourcesAPI, ::unity::Il2CppString, ::unity::OptionalMethod) -> crate::unity_engine::shader::Shader =
112                    ::core::mem::transmute(__vi.method_ptr);
113                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
114                __inner(__receiver, ::core::convert::Into::into(name), __mi)
115            }
116        }
117    }
118    #[doc = "`Load(::unity::Il2CppString, ::unity::SystemType)` overload"]
119    fn load(
120        self,
121        path: impl ::core::convert::Into<::unity::Il2CppString>,
122        system_type_instance: impl ::core::convert::Into<::unity::SystemType>,
123    ) -> crate::unity_engine::object_2::Object_2 {
124        unsafe {
125            let __receiver = <ResourcesAPI as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
126            {
127                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
128                let __vi = *__vt.get(6usize).unwrap_or_else(|| {
129                    panic!(
130                        "unity: virtual slot {}
131 out of range (vtable len {}
132) on the runtime class behind {}
133 (method `{}
134`)",
135                        6usize,
136                        __vt.len(),
137                        <ResourcesAPI as ::unity::ClassIdentity>::NAME,
138                        "Load",
139                    )
140                });
141                let __inner: extern "C" fn(
142                    ResourcesAPI,
143                    ::unity::Il2CppString,
144                    ::unity::SystemType,
145                    ::unity::OptionalMethod,
146                ) -> crate::unity_engine::object_2::Object_2 = ::core::mem::transmute(__vi.method_ptr);
147                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
148                __inner(
149                    __receiver,
150                    ::core::convert::Into::into(path),
151                    ::core::convert::Into::into(system_type_instance),
152                    __mi,
153                )
154            }
155        }
156    }
157    #[doc = "`LoadAll(::unity::Il2CppString, ::unity::SystemType)` overload"]
158    fn load_all(
159        self,
160        path: impl ::core::convert::Into<::unity::Il2CppString>,
161        system_type_instance: impl ::core::convert::Into<::unity::SystemType>,
162    ) -> ::unity::Array<crate::unity_engine::object_2::Object_2> {
163        unsafe {
164            let __receiver = <ResourcesAPI as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
165            {
166                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
167                let __vi = *__vt.get(7usize).unwrap_or_else(|| {
168                    panic!(
169                        "unity: virtual slot {}
170 out of range (vtable len {}
171) on the runtime class behind {}
172 (method `{}
173`)",
174                        7usize,
175                        __vt.len(),
176                        <ResourcesAPI as ::unity::ClassIdentity>::NAME,
177                        "LoadAll",
178                    )
179                });
180                let __inner: extern "C" fn(
181                    ResourcesAPI,
182                    ::unity::Il2CppString,
183                    ::unity::SystemType,
184                    ::unity::OptionalMethod,
185                ) -> ::unity::Array<crate::unity_engine::object_2::Object_2> = ::core::mem::transmute(__vi.method_ptr);
186                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
187                __inner(
188                    __receiver,
189                    ::core::convert::Into::into(path),
190                    ::core::convert::Into::into(system_type_instance),
191                    __mi,
192                )
193            }
194        }
195    }
196    #[doc = "`LoadAsync(::unity::Il2CppString, ::unity::SystemType)` overload"]
197    fn load_async(
198        self,
199        path: impl ::core::convert::Into<::unity::Il2CppString>,
200        system_type_instance: impl ::core::convert::Into<::unity::SystemType>,
201    ) -> crate::unity_engine::resourcerequest::ResourceRequest {
202        unsafe {
203            let __receiver = <ResourcesAPI as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
204            {
205                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
206                let __vi = *__vt.get(8usize).unwrap_or_else(|| {
207                    panic!(
208                        "unity: virtual slot {}
209 out of range (vtable len {}
210) on the runtime class behind {}
211 (method `{}
212`)",
213                        8usize,
214                        __vt.len(),
215                        <ResourcesAPI as ::unity::ClassIdentity>::NAME,
216                        "LoadAsync",
217                    )
218                });
219                let __inner: extern "C" fn(
220                    ResourcesAPI,
221                    ::unity::Il2CppString,
222                    ::unity::SystemType,
223                    ::unity::OptionalMethod,
224                ) -> crate::unity_engine::resourcerequest::ResourceRequest = ::core::mem::transmute(__vi.method_ptr);
225                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
226                __inner(
227                    __receiver,
228                    ::core::convert::Into::into(path),
229                    ::core::convert::Into::into(system_type_instance),
230                    __mi,
231                )
232            }
233        }
234    }
235    #[doc = "`UnloadAsset(crate::unity_engine::object_2::Object_2)` overload"]
236    fn unload_asset(self, asset_to_unload: impl ::core::convert::Into<crate::unity_engine::object_2::Object_2>) -> () {
237        unsafe {
238            let __receiver = <ResourcesAPI as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
239            {
240                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
241                let __vi = *__vt.get(9usize).unwrap_or_else(|| {
242                    panic!(
243                        "unity: virtual slot {}
244 out of range (vtable len {}
245) on the runtime class behind {}
246 (method `{}
247`)",
248                        9usize,
249                        __vt.len(),
250                        <ResourcesAPI as ::unity::ClassIdentity>::NAME,
251                        "UnloadAsset",
252                    )
253                });
254                let __inner: extern "C" fn(ResourcesAPI, crate::unity_engine::object_2::Object_2, ::unity::OptionalMethod) -> () =
255                    ::core::mem::transmute(__vi.method_ptr);
256                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
257                __inner(__receiver, ::core::convert::Into::into(asset_to_unload), __mi)
258            }
259        }
260    }
261}
262
263#[cfg(feature = "unity_engine-resourcesapi")]
264impl<__T: IResourcesAPI> IResourcesAPIMethods for __T {}
265
266#[cfg(feature = "unity_engine-resourcesapi")]
267impl ResourcesAPI {
268    pub fn get_active_api_method_info() -> &'static ::unity::il2cpp::MethodInfo {
269        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
270    }
271
272    pub fn get_override_api_method_info() -> &'static ::unity::il2cpp::MethodInfo {
273        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
274    }
275
276    pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
277        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
278    }
279
280    pub fn find_objects_of_type_all_method_info() -> &'static ::unity::il2cpp::MethodInfo {
281        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
282    }
283
284    pub fn find_shader_by_name_method_info() -> &'static ::unity::il2cpp::MethodInfo {
285        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[4]
286    }
287
288    pub fn load_method_info() -> &'static ::unity::il2cpp::MethodInfo {
289        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[5]
290    }
291
292    pub fn load_all_method_info() -> &'static ::unity::il2cpp::MethodInfo {
293        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[6]
294    }
295
296    pub fn load_async_method_info() -> &'static ::unity::il2cpp::MethodInfo {
297        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[7]
298    }
299
300    pub fn unload_asset_method_info() -> &'static ::unity::il2cpp::MethodInfo {
301        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[8]
302    }
303
304    pub fn cctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
305        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[9]
306    }
307}
308
309#[cfg(feature = "unity_engine-resourcesapi")]
310impl ResourcesAPI {
311    #[doc = "Direct (non-virtual) call to `ResourcesAPI`'s own `FindObjectsOfTypeAll`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
312    pub unsafe fn find_objects_of_type_all(
313        this: impl ::core::convert::Into<::unity::IlInstance>,
314        system_type_instance: ::unity::SystemType,
315    ) -> ::unity::Array<crate::unity_engine::object_2::Object_2> {
316        let __mi = Self::find_objects_of_type_all_method_info();
317        let __inner: extern "C" fn(
318            ::unity::IlInstance,
319            ::unity::SystemType,
320            ::unity::OptionalMethod,
321        ) -> ::unity::Array<crate::unity_engine::object_2::Object_2> = ::core::mem::transmute(__mi.method_ptr);
322        __inner(this.into(), system_type_instance, ::core::option::Option::None)
323    }
324
325    #[doc = "Direct (non-virtual) call to `ResourcesAPI`'s own `FindShaderByName`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
326    pub unsafe fn find_shader_by_name(
327        this: impl ::core::convert::Into<::unity::IlInstance>,
328        name: ::unity::Il2CppString,
329    ) -> crate::unity_engine::shader::Shader {
330        let __mi = Self::find_shader_by_name_method_info();
331        let __inner: extern "C" fn(::unity::IlInstance, ::unity::Il2CppString, ::unity::OptionalMethod) -> crate::unity_engine::shader::Shader =
332            ::core::mem::transmute(__mi.method_ptr);
333        __inner(this.into(), name, ::core::option::Option::None)
334    }
335
336    #[doc = "Direct (non-virtual) call to `ResourcesAPI`'s own `Load`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
337    pub unsafe fn load(
338        this: impl ::core::convert::Into<::unity::IlInstance>,
339        path: ::unity::Il2CppString,
340        system_type_instance: ::unity::SystemType,
341    ) -> crate::unity_engine::object_2::Object_2 {
342        let __mi = Self::load_method_info();
343        let __inner: extern "C" fn(
344            ::unity::IlInstance,
345            ::unity::Il2CppString,
346            ::unity::SystemType,
347            ::unity::OptionalMethod,
348        ) -> crate::unity_engine::object_2::Object_2 = ::core::mem::transmute(__mi.method_ptr);
349        __inner(this.into(), path, system_type_instance, ::core::option::Option::None)
350    }
351
352    #[doc = "Direct (non-virtual) call to `ResourcesAPI`'s own `LoadAll`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
353    pub unsafe fn load_all(
354        this: impl ::core::convert::Into<::unity::IlInstance>,
355        path: ::unity::Il2CppString,
356        system_type_instance: ::unity::SystemType,
357    ) -> ::unity::Array<crate::unity_engine::object_2::Object_2> {
358        let __mi = Self::load_all_method_info();
359        let __inner: extern "C" fn(
360            ::unity::IlInstance,
361            ::unity::Il2CppString,
362            ::unity::SystemType,
363            ::unity::OptionalMethod,
364        ) -> ::unity::Array<crate::unity_engine::object_2::Object_2> = ::core::mem::transmute(__mi.method_ptr);
365        __inner(this.into(), path, system_type_instance, ::core::option::Option::None)
366    }
367
368    #[doc = "Direct (non-virtual) call to `ResourcesAPI`'s own `LoadAsync`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
369    pub unsafe fn load_async(
370        this: impl ::core::convert::Into<::unity::IlInstance>,
371        path: ::unity::Il2CppString,
372        system_type_instance: ::unity::SystemType,
373    ) -> crate::unity_engine::resourcerequest::ResourceRequest {
374        let __mi = Self::load_async_method_info();
375        let __inner: extern "C" fn(
376            ::unity::IlInstance,
377            ::unity::Il2CppString,
378            ::unity::SystemType,
379            ::unity::OptionalMethod,
380        ) -> crate::unity_engine::resourcerequest::ResourceRequest = ::core::mem::transmute(__mi.method_ptr);
381        __inner(this.into(), path, system_type_instance, ::core::option::Option::None)
382    }
383
384    #[doc = "Direct (non-virtual) call to `ResourcesAPI`'s own `UnloadAsset`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
385    pub unsafe fn unload_asset(
386        this: impl ::core::convert::Into<::unity::IlInstance>,
387        asset_to_unload: crate::unity_engine::object_2::Object_2,
388    ) -> () {
389        let __mi = Self::unload_asset_method_info();
390        let __inner: extern "C" fn(::unity::IlInstance, crate::unity_engine::object_2::Object_2, ::unity::OptionalMethod) -> () =
391            ::core::mem::transmute(__mi.method_ptr);
392        __inner(this.into(), asset_to_unload, ::core::option::Option::None)
393    }
394}
395
396#[cfg(feature = "unity_engine-resourcesapi")]
397impl ResourcesAPI {
398    #[doc = "`.ctor()` — no args"]
399    pub fn new() -> Self {
400        let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
401            panic!(
402                "{}
403::{}
404 failed to instantiate",
405                ::core::stringify!(ResourcesAPI),
406                ::core::stringify!(new),
407            )
408        });
409        <Self as IResourcesAPIMethods>::ctor(this);
410        this
411    }
412}
413
414#[cfg(feature = "unity_engine-resourcesapi")]
415#[doc(hidden)]
416pub mod prelude {
417    pub use super::{IResourcesAPI, IResourcesAPIMethods, ResourcesAPI};
418    pub use crate::system::object::IObject;
419    #[cfg(feature = "system-object")]
420    pub use crate::system::object::IObjectMethods;
421}