engage/generated/unity_engine/
assetbundle.rs1#[cfg(feature = "unity_engine-assetbundle-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::object_2::{IObject_2, Object_2},
11 };
12
13 #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/unity_engine/assetbundle/AssetBundle.md"))]
14 #[::unity::class(namespace = "UnityEngine", name = "AssetBundle")]
15 #[parent(crate::unity_engine::object_2::Object_2)]
16 pub struct AssetBundle {}
17}
18
19#[cfg(feature = "unity_engine-assetbundle-types")]
20pub use __types::*;
21
22#[cfg(feature = "unity_engine-assetbundle")]
23impl AssetBundle {
24 #[doc = "`LoadFromFileAsync_Internal(::unity::Il2CppString, u32, u64)` overload"]
25 pub fn load_from_file_async_internal(
26 path: impl ::core::convert::Into<::unity::Il2CppString>,
27 crc: impl ::core::convert::Into<u32>,
28 offset: impl ::core::convert::Into<u64>,
29 ) -> crate::unity_engine::assetbundlecreaterequest::AssetBundleCreateRequest {
30 unsafe {
31 ::unity::il2cpp_call!((::unity::module_base()+0x3f41f90usize)as*mut u8,crate::unity_engine::assetbundlecreaterequest::AssetBundleCreateRequest;
32(::unity::Il2CppString)::core::convert::Into::into(path),(u32)::core::convert::Into::into(crc),(u64)::core::convert::Into::into(offset))
33 }
34 }
35
36 #[doc = "`LoadFromFileAsync(::unity::Il2CppString)` overload"]
37 pub fn load_from_file_async(
38 path: impl ::core::convert::Into<::unity::Il2CppString>,
39 ) -> crate::unity_engine::assetbundlecreaterequest::AssetBundleCreateRequest {
40 unsafe {
41 ::unity::il2cpp_call!((::unity::module_base()+0x3f41ff0usize)as*mut u8,crate::unity_engine::assetbundlecreaterequest::AssetBundleCreateRequest;
42(::unity::Il2CppString)::core::convert::Into::into(path))
43 }
44 }
45
46 #[doc = "`LoadFromFileAsync(::unity::Il2CppString, u32)` overload"]
47 pub fn load_from_file_async_2(
48 path: impl ::core::convert::Into<::unity::Il2CppString>,
49 crc: impl ::core::convert::Into<u32>,
50 ) -> crate::unity_engine::assetbundlecreaterequest::AssetBundleCreateRequest {
51 unsafe {
52 ::unity::il2cpp_call!((::unity::module_base()+0x3f42040usize)as*mut u8,crate::unity_engine::assetbundlecreaterequest::AssetBundleCreateRequest;
53(::unity::Il2CppString)::core::convert::Into::into(path),(u32)::core::convert::Into::into(crc))
54 }
55 }
56
57 #[doc = "`LoadFromFile_Internal(::unity::Il2CppString, u32, u64)` overload"]
58 pub fn load_from_file_internal(
59 path: impl ::core::convert::Into<::unity::Il2CppString>,
60 crc: impl ::core::convert::Into<u32>,
61 offset: impl ::core::convert::Into<u64>,
62 ) -> crate::unity_engine::assetbundle::AssetBundle {
63 unsafe {
64 ::unity::il2cpp_call!((::unity::module_base()+0x3f420a0usize)as*mut u8,crate::unity_engine::assetbundle::AssetBundle;
65(::unity::Il2CppString)::core::convert::Into::into(path),(u32)::core::convert::Into::into(crc),(u64)::core::convert::Into::into(offset))
66 }
67 }
68
69 #[doc = "`LoadFromFile(::unity::Il2CppString, u32)` overload"]
70 pub fn load_from_file(
71 path: impl ::core::convert::Into<::unity::Il2CppString>,
72 crc: impl ::core::convert::Into<u32>,
73 ) -> crate::unity_engine::assetbundle::AssetBundle {
74 unsafe {
75 ::unity::il2cpp_call!((::unity::module_base()+0x3f42100usize)as*mut u8,crate::unity_engine::assetbundle::AssetBundle;
76(::unity::Il2CppString)::core::convert::Into::into(path),(u32)::core::convert::Into::into(crc))
77 }
78 }
79
80 #[doc = "`LoadFromMemory_Internal(::unity::Array<u8>, u32)` overload"]
81 pub fn load_from_memory_internal(
82 binary: impl ::core::convert::Into<::unity::Array<u8>>,
83 crc: impl ::core::convert::Into<u32>,
84 ) -> crate::unity_engine::assetbundle::AssetBundle {
85 unsafe {
86 ::unity::il2cpp_call!((::unity::module_base()+0x3f42160usize)as*mut u8,crate::unity_engine::assetbundle::AssetBundle;
87(::unity::Array<u8>)::core::convert::Into::into(binary),(u32)::core::convert::Into::into(crc))
88 }
89 }
90
91 #[doc = "`LoadFromMemory(::unity::Array<u8>)` overload"]
92 pub fn load_from_memory(binary: impl ::core::convert::Into<::unity::Array<u8>>) -> crate::unity_engine::assetbundle::AssetBundle {
93 unsafe {
94 ::unity::il2cpp_call!((::unity::module_base()+0x3f421b0usize)as*mut u8,crate::unity_engine::assetbundle::AssetBundle;
95(::unity::Array<u8>)::core::convert::Into::into(binary))
96 }
97 }
98}
99
100#[cfg(feature = "unity_engine-assetbundle")]
101pub trait IAssetBundleMethods: IAssetBundle {
102 #[doc = "`.ctor()` overload"]
103 fn ctor(self) -> () {
104 unsafe {
105 let __receiver = <AssetBundle as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
106 ::unity::il2cpp_call!((::unity::module_base()+0x3f41f20usize)as*mut u8,();
107(AssetBundle)__receiver)
108 }
109 }
110 #[doc = "`LoadAsset(::unity::Il2CppString, ::unity::SystemType)` overload"]
111 fn load_asset(
112 self,
113 name: impl ::core::convert::Into<::unity::Il2CppString>,
114 r#type: impl ::core::convert::Into<::unity::SystemType>,
115 ) -> crate::unity_engine::object_2::Object_2 {
116 unsafe {
117 let __receiver = <AssetBundle as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
118 ::unity::il2cpp_call!((::unity::module_base()+0x3f42200usize)as*mut u8,crate::unity_engine::object_2::Object_2;
119(AssetBundle)__receiver,(::unity::Il2CppString)::core::convert::Into::into(name),(::unity::SystemType)::core::convert::Into::into(r#type))
120 }
121 }
122 #[doc = "`LoadAsset_Internal(::unity::Il2CppString, ::unity::SystemType)` overload"]
123 fn load_asset_internal(
124 self,
125 name: impl ::core::convert::Into<::unity::Il2CppString>,
126 r#type: impl ::core::convert::Into<::unity::SystemType>,
127 ) -> crate::unity_engine::object_2::Object_2 {
128 unsafe {
129 let __receiver = <AssetBundle as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
130 ::unity::il2cpp_call!((::unity::module_base()+0x3f42310usize)as*mut u8,crate::unity_engine::object_2::Object_2;
131(AssetBundle)__receiver,(::unity::Il2CppString)::core::convert::Into::into(name),(::unity::SystemType)::core::convert::Into::into(r#type))
132 }
133 }
134 #[doc = "`LoadAssetAsync(::unity::Il2CppString, ::unity::SystemType)` overload"]
135 fn load_asset_async(
136 self,
137 name: impl ::core::convert::Into<::unity::Il2CppString>,
138 r#type: impl ::core::convert::Into<::unity::SystemType>,
139 ) -> crate::unity_engine::assetbundlerequest::AssetBundleRequest {
140 unsafe {
141 let __receiver = <AssetBundle as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
142 ::unity::il2cpp_call!((::unity::module_base()+0x3f42370usize)as*mut u8,crate::unity_engine::assetbundlerequest::AssetBundleRequest;
143(AssetBundle)__receiver,(::unity::Il2CppString)::core::convert::Into::into(name),(::unity::SystemType)::core::convert::Into::into(r#type))
144 }
145 }
146 #[doc = "`LoadAssetWithSubAssets(::unity::Il2CppString, ::unity::SystemType)` overload"]
147 fn load_asset_with_sub_assets(
148 self,
149 name: impl ::core::convert::Into<::unity::Il2CppString>,
150 r#type: impl ::core::convert::Into<::unity::SystemType>,
151 ) -> ::unity::Array<crate::unity_engine::object_2::Object_2> {
152 unsafe {
153 let __receiver = <AssetBundle as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
154 ::unity::il2cpp_call!((::unity::module_base()+0x3f424e0usize)as*mut u8, ::unity::Array<crate::unity_engine::object_2::Object_2> ;
155(AssetBundle)__receiver,(::unity::Il2CppString)::core::convert::Into::into(name),(::unity::SystemType)::core::convert::Into::into(r#type))
156 }
157 }
158 #[doc = "`LoadAssetWithSubAssetsAsync(::unity::Il2CppString, ::unity::SystemType)` overload"]
159 fn load_asset_with_sub_assets_async(
160 self,
161 name: impl ::core::convert::Into<::unity::Il2CppString>,
162 r#type: impl ::core::convert::Into<::unity::SystemType>,
163 ) -> crate::unity_engine::assetbundlerequest::AssetBundleRequest {
164 unsafe {
165 let __receiver = <AssetBundle as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
166 ::unity::il2cpp_call!((::unity::module_base()+0x3f42650usize)as*mut u8,crate::unity_engine::assetbundlerequest::AssetBundleRequest;
167(AssetBundle)__receiver,(::unity::Il2CppString)::core::convert::Into::into(name),(::unity::SystemType)::core::convert::Into::into(r#type))
168 }
169 }
170 fn load_all_assets_async<M0: ::unity::IlType + ::core::marker::Copy + ::unity::ClassIdentity>(
171 self,
172 ) -> crate::unity_engine::assetbundlerequest::AssetBundleRequest {
173 static OPEN: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
174 ::unity::lookup::method_info_on_class(<AssetBundle as ::unity::ClassIdentity>::class(), "LoadAllAssetsAsync", 0)
175 });
176 #[allow(clippy::type_complexity)]
177 static CACHE: ::std::sync::OnceLock<::std::sync::Mutex<::std::collections::HashMap<usize, &'static ::unity::il2cpp::MethodInfo>>> =
178 ::std::sync::OnceLock::new();
179 let _ = false;
180 let __open: &'static ::unity::il2cpp::MethodInfo = match &*OPEN {
181 ::core::result::Result::Ok(mi) => *mi,
182 ::core::result::Result::Err(e) => {
183 panic!(
184 "method lookup failed: {}
185::{}
186: {}
187",
188 <AssetBundle as ::unity::ClassIdentity>::NAME,
189 "LoadAllAssetsAsync",
190 e
191 )
192 },
193 };
194 let __cache = CACHE.get_or_init(|| ::std::sync::Mutex::new(::std::collections::HashMap::new()));
195 let __key: usize = <M0 as ::unity::IlType>::il_type() as *const _ as usize;
196 let __inflated: &'static ::unity::il2cpp::MethodInfo = {
197 let mut __guard = __cache.lock().unwrap();
198 *__guard
199 .entry(__key)
200 .or_insert_with(|| ::unity::il2cpp::generic::create_generic_method_info(__open, &[<M0 as ::unity::IlType>::il_type()]))
201 };
202 unsafe {
203 let __receiver = <AssetBundle as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
204 let __f: extern "C" fn(AssetBundle, ::unity::OptionalMethod) -> crate::unity_engine::assetbundlerequest::AssetBundleRequest =
205 ::core::mem::transmute(__inflated.method_ptr);
206 let __mi_opaque: &'static () = &*(__inflated as *const _ as *const ());
207 __f(__receiver, ::core::option::Option::Some(__mi_opaque))
208 }
209 }
210 #[doc = "`LoadAllAssetsAsync(::unity::SystemType)` overload"]
211 fn load_all_assets_async_2(
212 self,
213 r#type: impl ::core::convert::Into<::unity::SystemType>,
214 ) -> crate::unity_engine::assetbundlerequest::AssetBundleRequest {
215 unsafe {
216 let __receiver = <AssetBundle as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
217 ::unity::il2cpp_call!((::unity::module_base()+0x3f427c0usize)as*mut u8,crate::unity_engine::assetbundlerequest::AssetBundleRequest;
218(AssetBundle)__receiver,(::unity::SystemType)::core::convert::Into::into(r#type))
219 }
220 }
221 #[doc = "`LoadAssetAsync_Internal(::unity::Il2CppString, ::unity::SystemType)` overload"]
222 fn load_asset_async_internal(
223 self,
224 name: impl ::core::convert::Into<::unity::Il2CppString>,
225 r#type: impl ::core::convert::Into<::unity::SystemType>,
226 ) -> crate::unity_engine::assetbundlerequest::AssetBundleRequest {
227 unsafe {
228 let __receiver = <AssetBundle as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
229 ::unity::il2cpp_call!((::unity::module_base()+0x3f42480usize)as*mut u8,crate::unity_engine::assetbundlerequest::AssetBundleRequest;
230(AssetBundle)__receiver,(::unity::Il2CppString)::core::convert::Into::into(name),(::unity::SystemType)::core::convert::Into::into(r#type))
231 }
232 }
233 #[doc = "`Unload(bool)` overload"]
234 fn unload(self, unload_all_loaded_objects: impl ::core::convert::Into<bool>) -> () {
235 unsafe {
236 let __receiver = <AssetBundle as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
237 ::unity::il2cpp_call!((::unity::module_base()+0x3f42890usize)as*mut u8,();
238(AssetBundle)__receiver,(bool)::core::convert::Into::into(unload_all_loaded_objects))
239 }
240 }
241 #[doc = "`LoadAssetWithSubAssets_Internal(::unity::Il2CppString, ::unity::SystemType)` overload"]
242 fn load_asset_with_sub_assets_internal(
243 self,
244 name: impl ::core::convert::Into<::unity::Il2CppString>,
245 r#type: impl ::core::convert::Into<::unity::SystemType>,
246 ) -> ::unity::Array<crate::unity_engine::object_2::Object_2> {
247 unsafe {
248 let __receiver = <AssetBundle as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
249 ::unity::il2cpp_call!((::unity::module_base()+0x3f425f0usize)as*mut u8, ::unity::Array<crate::unity_engine::object_2::Object_2> ;
250(AssetBundle)__receiver,(::unity::Il2CppString)::core::convert::Into::into(name),(::unity::SystemType)::core::convert::Into::into(r#type))
251 }
252 }
253 #[doc = "`LoadAssetWithSubAssetsAsync_Internal(::unity::Il2CppString, ::unity::SystemType)` overload"]
254 fn load_asset_with_sub_assets_async_internal(
255 self,
256 name: impl ::core::convert::Into<::unity::Il2CppString>,
257 r#type: impl ::core::convert::Into<::unity::SystemType>,
258 ) -> crate::unity_engine::assetbundlerequest::AssetBundleRequest {
259 unsafe {
260 let __receiver = <AssetBundle as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
261 ::unity::il2cpp_call!((::unity::module_base()+0x3f42760usize)as*mut u8,crate::unity_engine::assetbundlerequest::AssetBundleRequest;
262(AssetBundle)__receiver,(::unity::Il2CppString)::core::convert::Into::into(name),(::unity::SystemType)::core::convert::Into::into(r#type))
263 }
264 }
265}
266
267#[cfg(feature = "unity_engine-assetbundle")]
268impl<__T: IAssetBundle> IAssetBundleMethods for __T {}
269
270#[cfg(feature = "unity_engine-assetbundle")]
271impl AssetBundle {
272 pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
273 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
274 }
275
276 pub fn load_from_file_async_internal_method_info() -> &'static ::unity::il2cpp::MethodInfo {
277 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
278 }
279
280 pub fn load_from_file_async_method_info() -> &'static ::unity::il2cpp::MethodInfo {
281 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
282 }
283
284 pub fn load_from_file_async_2_method_info() -> &'static ::unity::il2cpp::MethodInfo {
285 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
286 }
287
288 pub fn load_from_file_internal_method_info() -> &'static ::unity::il2cpp::MethodInfo {
289 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[4]
290 }
291
292 pub fn load_from_file_method_info() -> &'static ::unity::il2cpp::MethodInfo {
293 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[5]
294 }
295
296 pub fn load_from_memory_internal_method_info() -> &'static ::unity::il2cpp::MethodInfo {
297 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[6]
298 }
299
300 pub fn load_from_memory_method_info() -> &'static ::unity::il2cpp::MethodInfo {
301 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[7]
302 }
303
304 pub fn load_asset_method_info() -> &'static ::unity::il2cpp::MethodInfo {
305 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[8]
306 }
307
308 pub fn load_asset_internal_method_info() -> &'static ::unity::il2cpp::MethodInfo {
309 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[9]
310 }
311
312 pub fn load_asset_async_method_info() -> &'static ::unity::il2cpp::MethodInfo {
313 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[10]
314 }
315
316 pub fn load_asset_with_sub_assets_method_info() -> &'static ::unity::il2cpp::MethodInfo {
317 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[11]
318 }
319
320 pub fn load_asset_with_sub_assets_async_method_info() -> &'static ::unity::il2cpp::MethodInfo {
321 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[12]
322 }
323
324 pub fn load_all_assets_async_2_method_info() -> &'static ::unity::il2cpp::MethodInfo {
325 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[14]
326 }
327
328 pub fn load_asset_async_internal_method_info() -> &'static ::unity::il2cpp::MethodInfo {
329 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[15]
330 }
331
332 pub fn unload_method_info() -> &'static ::unity::il2cpp::MethodInfo {
333 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[16]
334 }
335
336 pub fn load_asset_with_sub_assets_internal_method_info() -> &'static ::unity::il2cpp::MethodInfo {
337 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[17]
338 }
339
340 pub fn load_asset_with_sub_assets_async_internal_method_info() -> &'static ::unity::il2cpp::MethodInfo {
341 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[18]
342 }
343}
344
345#[cfg(feature = "unity_engine-assetbundle")]
346impl AssetBundle {
347 #[doc = "`.ctor()` — no args"]
348 pub fn new() -> Self {
349 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
350 panic!(
351 "{}
352::{}
353 failed to instantiate",
354 ::core::stringify!(AssetBundle),
355 ::core::stringify!(new),
356 )
357 });
358 <Self as IAssetBundleMethods>::ctor(this);
359 this
360 }
361}
362
363#[cfg(feature = "unity_engine-assetbundle")]
364#[doc(hidden)]
365pub mod prelude {
366 pub use super::{AssetBundle, IAssetBundle, IAssetBundleMethods};
367 #[cfg(feature = "system-object")]
368 pub use crate::system::object::IObjectMethods;
369 #[cfg(feature = "unity_engine-object_2")]
370 pub use crate::unity_engine::object_2::IObject_2Methods;
371 pub use crate::{system::object::IObject, unity_engine::object_2::IObject_2};
372}