engage/generated/unity_engine/
resources.rs1#[cfg(feature = "unity_engine-resources-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/resources/Resources.md"))]
11 #[::unity::class(namespace = "UnityEngine", name = "Resources")]
12 #[parent(crate::system::object::Object)]
13 pub struct Resources {}
14}
15
16#[cfg(feature = "unity_engine-resources-types")]
17pub use __types::*;
18
19#[cfg(feature = "unity_engine-resources")]
20impl Resources {
21 pub fn convert_objects<M0: ::unity::IlType + ::core::marker::Copy + ::unity::ClassIdentity>(
22 raw_objects: impl ::core::convert::Into<::unity::Array<crate::unity_engine::object_2::Object_2>>,
23 ) -> ::unity::Array<M0> {
24 static OPEN: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> =
25 ::std::sync::LazyLock::new(|| ::unity::lookup::method_info_on_class(<Resources as ::unity::ClassIdentity>::class(), "ConvertObjects", 1));
26 #[allow(clippy::type_complexity)]
27 static CACHE: ::std::sync::OnceLock<::std::sync::Mutex<::std::collections::HashMap<usize, &'static ::unity::il2cpp::MethodInfo>>> =
28 ::std::sync::OnceLock::new();
29 let _ = true;
30 let __open: &'static ::unity::il2cpp::MethodInfo = match &*OPEN {
31 ::core::result::Result::Ok(mi) => *mi,
32 ::core::result::Result::Err(e) => {
33 panic!(
34 "method lookup failed: {}
35::{}
36: {}
37",
38 <Resources as ::unity::ClassIdentity>::NAME,
39 "ConvertObjects",
40 e
41 )
42 },
43 };
44 let __cache = CACHE.get_or_init(|| ::std::sync::Mutex::new(::std::collections::HashMap::new()));
45 let __key: usize = <M0 as ::unity::IlType>::il_type() as *const _ as usize;
46 let __inflated: &'static ::unity::il2cpp::MethodInfo = {
47 let mut __guard = __cache.lock().unwrap();
48 *__guard
49 .entry(__key)
50 .or_insert_with(|| ::unity::il2cpp::generic::create_generic_method_info(__open, &[<M0 as ::unity::IlType>::il_type()]))
51 };
52 unsafe {
53 let __f: extern "C" fn(::unity::Array<crate::unity_engine::object_2::Object_2>, ::unity::OptionalMethod) -> ::unity::Array<M0> =
54 ::core::mem::transmute(__inflated.method_ptr);
55 let __mi_opaque: &'static () = &*(__inflated as *const _ as *const ());
56 __f(::core::convert::Into::into(raw_objects), ::core::option::Option::Some(__mi_opaque))
57 }
58 }
59
60 #[doc = "`FindObjectsOfTypeAll(::unity::SystemType)` overload"]
61 pub fn find_objects_of_type_all(
62 r#type: impl ::core::convert::Into<::unity::SystemType>,
63 ) -> ::unity::Array<crate::unity_engine::object_2::Object_2> {
64 unsafe {
65 ::unity::il2cpp_call!((::unity::module_base()+0x2f89070usize)as*mut u8, ::unity::Array<crate::unity_engine::object_2::Object_2> ;
66(::unity::SystemType)::core::convert::Into::into(r#type))
67 }
68 }
69
70 pub fn load<M0: ::unity::IlType + ::core::marker::Copy + ::unity::ClassIdentity>(path: impl ::core::convert::Into<::unity::Il2CppString>) -> M0 {
71 static OPEN: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> =
72 ::std::sync::LazyLock::new(|| ::unity::lookup::method_info_on_class(<Resources as ::unity::ClassIdentity>::class(), "Load", 1));
73 #[allow(clippy::type_complexity)]
74 static CACHE: ::std::sync::OnceLock<::std::sync::Mutex<::std::collections::HashMap<usize, &'static ::unity::il2cpp::MethodInfo>>> =
75 ::std::sync::OnceLock::new();
76 let _ = true;
77 let __open: &'static ::unity::il2cpp::MethodInfo = match &*OPEN {
78 ::core::result::Result::Ok(mi) => *mi,
79 ::core::result::Result::Err(e) => {
80 panic!(
81 "method lookup failed: {}
82::{}
83: {}
84",
85 <Resources as ::unity::ClassIdentity>::NAME,
86 "Load",
87 e
88 )
89 },
90 };
91 let __cache = CACHE.get_or_init(|| ::std::sync::Mutex::new(::std::collections::HashMap::new()));
92 let __key: usize = <M0 as ::unity::IlType>::il_type() as *const _ as usize;
93 let __inflated: &'static ::unity::il2cpp::MethodInfo = {
94 let mut __guard = __cache.lock().unwrap();
95 *__guard
96 .entry(__key)
97 .or_insert_with(|| ::unity::il2cpp::generic::create_generic_method_info(__open, &[<M0 as ::unity::IlType>::il_type()]))
98 };
99 unsafe {
100 let __f: extern "C" fn(::unity::Il2CppString, ::unity::OptionalMethod) -> M0 = ::core::mem::transmute(__inflated.method_ptr);
101 let __mi_opaque: &'static () = &*(__inflated as *const _ as *const ());
102 __f(::core::convert::Into::into(path), ::core::option::Option::Some(__mi_opaque))
103 }
104 }
105
106 #[doc = "`Load(::unity::Il2CppString, ::unity::SystemType)` overload"]
107 pub fn load_2(
108 path: impl ::core::convert::Into<::unity::Il2CppString>,
109 system_type_instance: impl ::core::convert::Into<::unity::SystemType>,
110 ) -> crate::unity_engine::object_2::Object_2 {
111 unsafe {
112 ::unity::il2cpp_call!((::unity::module_base()+0x2f88fd0usize)as*mut u8,crate::unity_engine::object_2::Object_2;
113(::unity::Il2CppString)::core::convert::Into::into(path),(::unity::SystemType)::core::convert::Into::into(system_type_instance))
114 }
115 }
116
117 #[doc = "`LoadAsync(::unity::Il2CppString, ::unity::SystemType)` overload"]
118 pub fn load_async(
119 path: impl ::core::convert::Into<::unity::Il2CppString>,
120 r#type: impl ::core::convert::Into<::unity::SystemType>,
121 ) -> crate::unity_engine::resourcerequest::ResourceRequest {
122 unsafe {
123 ::unity::il2cpp_call!((::unity::module_base()+0x2f89200usize)as*mut u8,crate::unity_engine::resourcerequest::ResourceRequest;
124(::unity::Il2CppString)::core::convert::Into::into(path),(::unity::SystemType)::core::convert::Into::into(r#type))
125 }
126 }
127
128 #[doc = "`LoadAll(::unity::Il2CppString, ::unity::SystemType)` overload"]
129 pub fn load_all(
130 path: impl ::core::convert::Into<::unity::Il2CppString>,
131 system_type_instance: impl ::core::convert::Into<::unity::SystemType>,
132 ) -> ::unity::Array<crate::unity_engine::object_2::Object_2> {
133 unsafe {
134 ::unity::il2cpp_call!((::unity::module_base()+0x2f89280usize)as*mut u8, ::unity::Array<crate::unity_engine::object_2::Object_2> ;
135(::unity::Il2CppString)::core::convert::Into::into(path),(::unity::SystemType)::core::convert::Into::into(system_type_instance))
136 }
137 }
138
139 pub fn load_all_2<M0: ::unity::IlType + ::core::marker::Copy + ::unity::ClassIdentity>(
140 path: impl ::core::convert::Into<::unity::Il2CppString>,
141 ) -> ::unity::Array<M0> {
142 static OPEN: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> =
143 ::std::sync::LazyLock::new(|| ::unity::lookup::method_info_on_class(<Resources as ::unity::ClassIdentity>::class(), "LoadAll", 1));
144 #[allow(clippy::type_complexity)]
145 static CACHE: ::std::sync::OnceLock<::std::sync::Mutex<::std::collections::HashMap<usize, &'static ::unity::il2cpp::MethodInfo>>> =
146 ::std::sync::OnceLock::new();
147 let _ = true;
148 let __open: &'static ::unity::il2cpp::MethodInfo = match &*OPEN {
149 ::core::result::Result::Ok(mi) => *mi,
150 ::core::result::Result::Err(e) => {
151 panic!(
152 "method lookup failed: {}
153::{}
154: {}
155",
156 <Resources as ::unity::ClassIdentity>::NAME,
157 "LoadAll",
158 e
159 )
160 },
161 };
162 let __cache = CACHE.get_or_init(|| ::std::sync::Mutex::new(::std::collections::HashMap::new()));
163 let __key: usize = <M0 as ::unity::IlType>::il_type() as *const _ as usize;
164 let __inflated: &'static ::unity::il2cpp::MethodInfo = {
165 let mut __guard = __cache.lock().unwrap();
166 *__guard
167 .entry(__key)
168 .or_insert_with(|| ::unity::il2cpp::generic::create_generic_method_info(__open, &[<M0 as ::unity::IlType>::il_type()]))
169 };
170 unsafe {
171 let __f: extern "C" fn(::unity::Il2CppString, ::unity::OptionalMethod) -> ::unity::Array<M0> =
172 ::core::mem::transmute(__inflated.method_ptr);
173 let __mi_opaque: &'static () = &*(__inflated as *const _ as *const ());
174 __f(::core::convert::Into::into(path), ::core::option::Option::Some(__mi_opaque))
175 }
176 }
177
178 #[doc = "`GetBuiltinResource(::unity::SystemType, ::unity::Il2CppString)` overload"]
179 pub fn get_builtin_resource(
180 r#type: impl ::core::convert::Into<::unity::SystemType>,
181 path: impl ::core::convert::Into<::unity::Il2CppString>,
182 ) -> crate::unity_engine::object_2::Object_2 {
183 unsafe {
184 ::unity::il2cpp_call!((::unity::module_base()+0x2f89300usize)as*mut u8,crate::unity_engine::object_2::Object_2;
185(::unity::SystemType)::core::convert::Into::into(r#type),(::unity::Il2CppString)::core::convert::Into::into(path))
186 }
187 }
188
189 pub fn get_builtin_resource_2<M0: ::unity::IlType + ::core::marker::Copy + ::unity::ClassIdentity>(
190 path: impl ::core::convert::Into<::unity::Il2CppString>,
191 ) -> M0 {
192 static OPEN: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
193 ::unity::lookup::method_info_on_class(<Resources as ::unity::ClassIdentity>::class(), "GetBuiltinResource", 1)
194 });
195 #[allow(clippy::type_complexity)]
196 static CACHE: ::std::sync::OnceLock<::std::sync::Mutex<::std::collections::HashMap<usize, &'static ::unity::il2cpp::MethodInfo>>> =
197 ::std::sync::OnceLock::new();
198 let _ = true;
199 let __open: &'static ::unity::il2cpp::MethodInfo = match &*OPEN {
200 ::core::result::Result::Ok(mi) => *mi,
201 ::core::result::Result::Err(e) => {
202 panic!(
203 "method lookup failed: {}
204::{}
205: {}
206",
207 <Resources as ::unity::ClassIdentity>::NAME,
208 "GetBuiltinResource",
209 e
210 )
211 },
212 };
213 let __cache = CACHE.get_or_init(|| ::std::sync::Mutex::new(::std::collections::HashMap::new()));
214 let __key: usize = <M0 as ::unity::IlType>::il_type() as *const _ as usize;
215 let __inflated: &'static ::unity::il2cpp::MethodInfo = {
216 let mut __guard = __cache.lock().unwrap();
217 *__guard
218 .entry(__key)
219 .or_insert_with(|| ::unity::il2cpp::generic::create_generic_method_info(__open, &[<M0 as ::unity::IlType>::il_type()]))
220 };
221 unsafe {
222 let __f: extern "C" fn(::unity::Il2CppString, ::unity::OptionalMethod) -> M0 = ::core::mem::transmute(__inflated.method_ptr);
223 let __mi_opaque: &'static () = &*(__inflated as *const _ as *const ());
224 __f(::core::convert::Into::into(path), ::core::option::Option::Some(__mi_opaque))
225 }
226 }
227
228 #[doc = "`UnloadAsset(crate::unity_engine::object_2::Object_2)` overload"]
229 pub fn unload_asset(asset_to_unload: impl ::core::convert::Into<crate::unity_engine::object_2::Object_2>) -> () {
230 unsafe {
231 ::unity::il2cpp_call!((::unity::module_base()+0x2f89350usize)as*mut u8,();
232(crate::unity_engine::object_2::Object_2)::core::convert::Into::into(asset_to_unload))
233 }
234 }
235
236 #[doc = "`UnloadUnusedAssets()` overload"]
237 pub fn unload_unused_assets() -> crate::unity_engine::asyncoperation::AsyncOperation {
238 unsafe {
239 ::unity::il2cpp_call!((::unity::module_base()+0x2f893d0usize)as*mut u8,crate::unity_engine::asyncoperation::AsyncOperation;
240 )
241 }
242 }
243}
244
245#[cfg(feature = "unity_engine-resources")]
246impl Resources {
247 pub fn find_objects_of_type_all_method_info() -> &'static ::unity::il2cpp::MethodInfo {
248 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
249 }
250
251 pub fn load_2_method_info() -> &'static ::unity::il2cpp::MethodInfo {
252 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
253 }
254
255 pub fn load_async_method_info() -> &'static ::unity::il2cpp::MethodInfo {
256 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[4]
257 }
258
259 pub fn load_all_method_info() -> &'static ::unity::il2cpp::MethodInfo {
260 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[5]
261 }
262
263 pub fn get_builtin_resource_method_info() -> &'static ::unity::il2cpp::MethodInfo {
264 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[7]
265 }
266
267 pub fn unload_asset_method_info() -> &'static ::unity::il2cpp::MethodInfo {
268 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[9]
269 }
270
271 pub fn unload_unused_assets_method_info() -> &'static ::unity::il2cpp::MethodInfo {
272 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[10]
273 }
274}
275
276#[cfg(feature = "unity_engine-resources")]
277#[doc(hidden)]
278pub mod prelude {
279 pub use super::{IResources, Resources};
280 pub use crate::system::object::IObject;
281 #[cfg(feature = "system-object")]
282 pub use crate::system::object::IObjectMethods;
283}