Skip to main content

engage/generated/unity_engine/
www.rs

1// @generated by il2cpp-bindgen — do not edit by hand.
2
3#[cfg(feature = "unity_engine-www-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::customyieldinstruction::{CustomYieldInstruction, ICustomYieldInstruction},
11    };
12
13    #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/unity_engine/www/WWW.md"))]
14    #[::unity::class(namespace = "UnityEngine", name = "WWW")]
15    #[parent(crate::unity_engine::customyieldinstruction::CustomYieldInstruction)]
16    pub struct WWW {
17        #[offset(16)]
18        #[rename(name = "_uwr")]
19        pub uwr: crate::unity_engine::networking::unitywebrequest::UnityWebRequest,
20        #[offset(24)]
21        #[rename(name = "_assetBundle")]
22        pub asset_bundle: crate::unity_engine::assetbundle::AssetBundle,
23        #[offset(32)]
24        #[rename(name = "_responseHeaders")]
25        pub response_headers: crate::system::collections::generic::dictionary_2::Dictionary_2<::unity::Il2CppString, ::unity::Il2CppString>,
26    }
27}
28
29#[cfg(feature = "unity_engine-www-types")]
30pub use __types::*;
31
32#[cfg(feature = "unity_engine-www")]
33impl WWW {
34    #[doc = "`LoadFromCacheOrDownload(::unity::Il2CppString, i32)` overload"]
35    pub fn load_from_cache_or_download(
36        url: impl ::core::convert::Into<::unity::Il2CppString>,
37        version: impl ::core::convert::Into<i32>,
38    ) -> crate::unity_engine::www::WWW {
39        unsafe {
40            ::unity::il2cpp_call!((::unity::module_base()+0x3f3b660usize)as*mut u8,crate::unity_engine::www::WWW;
41(::unity::Il2CppString)::core::convert::Into::into(url),(i32)::core::convert::Into::into(version))
42        }
43    }
44
45    #[doc = "`LoadFromCacheOrDownload(::unity::Il2CppString, i32, u32)` overload"]
46    pub fn load_from_cache_or_download_2(
47        url: impl ::core::convert::Into<::unity::Il2CppString>,
48        version: impl ::core::convert::Into<i32>,
49        crc: impl ::core::convert::Into<u32>,
50    ) -> crate::unity_engine::www::WWW {
51        unsafe {
52            ::unity::il2cpp_call!((::unity::module_base()+0x3f3b6c0usize)as*mut u8,crate::unity_engine::www::WWW;
53(::unity::Il2CppString)::core::convert::Into::into(url),(i32)::core::convert::Into::into(version),(u32)::core::convert::Into::into(crc))
54        }
55    }
56
57    #[doc = "`LoadFromCacheOrDownload(::unity::Il2CppString, crate::unity_engine::hash128::Hash128)` overload"]
58    pub fn load_from_cache_or_download_3(
59        url: impl ::core::convert::Into<::unity::Il2CppString>,
60        hash: impl ::core::convert::Into<crate::unity_engine::hash128::Hash128>,
61    ) -> crate::unity_engine::www::WWW {
62        unsafe {
63            ::unity::il2cpp_call!((::unity::module_base()+0x3f3b830usize)as*mut u8,crate::unity_engine::www::WWW;
64(::unity::Il2CppString)::core::convert::Into::into(url),(crate::unity_engine::hash128::Hash128)::core::convert::Into::into(hash))
65        }
66    }
67
68    #[doc = "`LoadFromCacheOrDownload(::unity::Il2CppString, crate::unity_engine::hash128::Hash128, u32)` overload"]
69    pub fn load_from_cache_or_download_4(
70        url: impl ::core::convert::Into<::unity::Il2CppString>,
71        hash: impl ::core::convert::Into<crate::unity_engine::hash128::Hash128>,
72        crc: impl ::core::convert::Into<u32>,
73    ) -> crate::unity_engine::www::WWW {
74        unsafe {
75            ::unity::il2cpp_call!((::unity::module_base()+0x3f3b720usize)as*mut u8,crate::unity_engine::www::WWW;
76(::unity::Il2CppString)::core::convert::Into::into(url),(crate::unity_engine::hash128::Hash128)::core::convert::Into::into(hash),(u32)::core::convert::Into::into(crc))
77        }
78    }
79}
80
81#[cfg(feature = "unity_engine-www")]
82pub trait IWWWMethods: IWWW {
83    #[doc = "`.ctor(::unity::Il2CppString, crate::unity_engine::wwwform::WWWForm)` overload"]
84    fn ctor(
85        self,
86        url: impl ::core::convert::Into<::unity::Il2CppString>,
87        form: impl ::core::convert::Into<crate::unity_engine::wwwform::WWWForm>,
88    ) -> () {
89        unsafe {
90            let __receiver = <WWW as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
91            ::unity::il2cpp_call!((::unity::module_base()+0x3f3b8f0usize)as*mut u8,();
92(WWW)__receiver,(::unity::Il2CppString)::core::convert::Into::into(url),(crate::unity_engine::wwwform::WWWForm)::core::convert::Into::into(form))
93        }
94    }
95    #[doc = "`.ctor(::unity::Il2CppString, ::unity::Array<u8>)` overload"]
96    fn ctor_2(self, url: impl ::core::convert::Into<::unity::Il2CppString>, post_data: impl ::core::convert::Into<::unity::Array<u8>>) -> () {
97        unsafe {
98            let __receiver = <WWW as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
99            ::unity::il2cpp_call!((::unity::module_base()+0x3f3b960usize)as*mut u8,();
100(WWW)__receiver,(::unity::Il2CppString)::core::convert::Into::into(url),(::unity::Array<u8>)::core::convert::Into::into(post_data))
101        }
102    }
103    #[doc = "`.ctor(::unity::Il2CppString, ::unity::Array<u8>, crate::system::collections::generic::dictionary_2::Dictionary_2<::unity::Il2CppString,::unity::Il2CppString>)` overload"]
104    fn ctor_3(
105        self,
106        url: impl ::core::convert::Into<::unity::Il2CppString>,
107        post_data: impl ::core::convert::Into<::unity::Array<u8>>,
108        headers: impl ::core::convert::Into<crate::system::collections::generic::dictionary_2::Dictionary_2<::unity::Il2CppString, ::unity::Il2CppString>>,
109    ) -> () {
110        unsafe {
111            let __receiver = <WWW as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
112            ::unity::il2cpp_call!((::unity::module_base()+0x3f3bad0usize)as*mut u8,();
113(WWW)__receiver,(::unity::Il2CppString)::core::convert::Into::into(url),(::unity::Array<u8>)::core::convert::Into::into(post_data),(crate::system::collections::generic::dictionary_2::Dictionary_2< ::unity::Il2CppString, ::unity::Il2CppString>)::core::convert::Into::into(headers))
114        }
115    }
116    #[doc = "`.ctor(::unity::Il2CppString, ::unity::Il2CppString, crate::unity_engine::hash128::Hash128, u32)` overload"]
117    fn ctor_4(
118        self,
119        url: impl ::core::convert::Into<::unity::Il2CppString>,
120        name: impl ::core::convert::Into<::unity::Il2CppString>,
121        hash: impl ::core::convert::Into<crate::unity_engine::hash128::Hash128>,
122        crc: impl ::core::convert::Into<u32>,
123    ) -> () {
124        unsafe {
125            let __receiver = <WWW as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
126            ::unity::il2cpp_call!((::unity::module_base()+0x3f3b840usize)as*mut u8,();
127(WWW)__receiver,(::unity::Il2CppString)::core::convert::Into::into(url),(::unity::Il2CppString)::core::convert::Into::into(name),(crate::unity_engine::hash128::Hash128)::core::convert::Into::into(hash),(u32)::core::convert::Into::into(crc))
128        }
129    }
130    #[doc = "`get_assetBundle()` overload"]
131    fn get_asset_bundle(self) -> crate::unity_engine::assetbundle::AssetBundle {
132        unsafe {
133            let __receiver = <WWW as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
134            ::unity::il2cpp_call!((::unity::module_base()+0x3f3bd60usize)as*mut u8,crate::unity_engine::assetbundle::AssetBundle;
135(WWW)__receiver)
136        }
137    }
138    #[doc = "`get_bytes()` overload"]
139    fn get_bytes(self) -> ::unity::Array<u8> {
140        unsafe {
141            let __receiver = <WWW as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
142            ::unity::il2cpp_call!((::unity::module_base()+0x3f3bf90usize)as*mut u8, ::unity::Array<u8> ;
143(WWW)__receiver)
144        }
145    }
146    #[doc = "`get_error()` overload"]
147    fn get_error(self) -> ::unity::Il2CppString {
148        unsafe {
149            let __receiver = <WWW as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
150            ::unity::il2cpp_call!((::unity::module_base()+0x3f3c020usize)as*mut u8, ::unity::Il2CppString;
151(WWW)__receiver)
152        }
153    }
154    #[doc = "`get_isDone()` overload"]
155    fn get_is_done(self) -> bool {
156        unsafe {
157            let __receiver = <WWW as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
158            ::unity::il2cpp_call!((::unity::module_base()+0x3f3c130usize)as*mut u8,bool;
159(WWW)__receiver)
160        }
161    }
162    #[doc = "`get_progress()` overload"]
163    fn get_progress(self) -> f32 {
164        unsafe {
165            let __receiver = <WWW as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
166            ::unity::il2cpp_call!((::unity::module_base()+0x3f3c140usize)as*mut u8,f32;
167(WWW)__receiver)
168        }
169    }
170    #[doc = "`get_responseHeaders()` overload"]
171    fn get_response_headers(self) -> crate::system::collections::generic::dictionary_2::Dictionary_2<::unity::Il2CppString, ::unity::Il2CppString> {
172        unsafe {
173            let __receiver = <WWW as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
174            ::unity::il2cpp_call!((::unity::module_base()+0x3f3c170usize)as*mut u8,crate::system::collections::generic::dictionary_2::Dictionary_2< ::unity::Il2CppString, ::unity::Il2CppString> ;
175(WWW)__receiver)
176        }
177    }
178    #[doc = "`get_text()` overload"]
179    fn get_text(self) -> ::unity::Il2CppString {
180        unsafe {
181            let __receiver = <WWW as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
182            ::unity::il2cpp_call!((::unity::module_base()+0x3f3c320usize)as*mut u8, ::unity::Il2CppString;
183(WWW)__receiver)
184        }
185    }
186    #[doc = "`get_url()` overload"]
187    fn get_url(self) -> ::unity::Il2CppString {
188        unsafe {
189            let __receiver = <WWW as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
190            ::unity::il2cpp_call!((::unity::module_base()+0x3f3c3b0usize)as*mut u8, ::unity::Il2CppString;
191(WWW)__receiver)
192        }
193    }
194    #[doc = "`get_keepWaiting()` overload"]
195    fn get_keep_waiting(self) -> bool {
196        unsafe {
197            let __receiver = <WWW as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
198            {
199                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
200                let __vi = *__vt.get(7usize).unwrap_or_else(|| {
201                    panic!(
202                        "unity: virtual slot {}
203 out of range (vtable len {}
204) on the runtime class behind {}
205 (method `{}
206`)",
207                        7usize,
208                        __vt.len(),
209                        <WWW as ::unity::ClassIdentity>::NAME,
210                        "get_keepWaiting",
211                    )
212                });
213                let __inner: extern "C" fn(WWW, ::unity::OptionalMethod) -> bool = ::core::mem::transmute(__vi.method_ptr);
214                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
215                __inner(__receiver, __mi)
216            }
217        }
218    }
219    #[doc = "`Dispose()` overload"]
220    fn dispose(self) -> () {
221        unsafe {
222            let __receiver = <WWW as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
223            {
224                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
225                let __vi = *__vt.get(9usize).unwrap_or_else(|| {
226                    panic!(
227                        "unity: virtual slot {}
228 out of range (vtable len {}
229) on the runtime class behind {}
230 (method `{}
231`)",
232                        9usize,
233                        __vt.len(),
234                        <WWW as ::unity::ClassIdentity>::NAME,
235                        "Dispose",
236                    )
237                });
238                let __inner: extern "C" fn(WWW, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__vi.method_ptr);
239                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
240                __inner(__receiver, __mi)
241            }
242        }
243    }
244    #[doc = "`WaitUntilDoneIfPossible()` overload"]
245    fn wait_until_done_if_possible(self) -> bool {
246        unsafe {
247            let __receiver = <WWW as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
248            ::unity::il2cpp_call!((::unity::module_base()+0x3f3be90usize)as*mut u8,bool;
249(WWW)__receiver)
250        }
251    }
252}
253
254#[cfg(feature = "unity_engine-www")]
255impl<__T: IWWW> IWWWMethods for __T {}
256
257#[cfg(feature = "unity_engine-www")]
258impl WWW {
259    pub fn load_from_cache_or_download_method_info() -> &'static ::unity::il2cpp::MethodInfo {
260        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
261    }
262
263    pub fn load_from_cache_or_download_2_method_info() -> &'static ::unity::il2cpp::MethodInfo {
264        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
265    }
266
267    pub fn load_from_cache_or_download_3_method_info() -> &'static ::unity::il2cpp::MethodInfo {
268        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
269    }
270
271    pub fn load_from_cache_or_download_4_method_info() -> &'static ::unity::il2cpp::MethodInfo {
272        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
273    }
274
275    pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
276        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[4]
277    }
278
279    pub fn ctor_2_method_info() -> &'static ::unity::il2cpp::MethodInfo {
280        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[5]
281    }
282
283    pub fn ctor_3_method_info() -> &'static ::unity::il2cpp::MethodInfo {
284        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[6]
285    }
286
287    pub fn ctor_4_method_info() -> &'static ::unity::il2cpp::MethodInfo {
288        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[7]
289    }
290
291    pub fn get_asset_bundle_method_info() -> &'static ::unity::il2cpp::MethodInfo {
292        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[8]
293    }
294
295    pub fn get_bytes_method_info() -> &'static ::unity::il2cpp::MethodInfo {
296        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[9]
297    }
298
299    pub fn get_error_method_info() -> &'static ::unity::il2cpp::MethodInfo {
300        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[10]
301    }
302
303    pub fn get_is_done_method_info() -> &'static ::unity::il2cpp::MethodInfo {
304        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[11]
305    }
306
307    pub fn get_progress_method_info() -> &'static ::unity::il2cpp::MethodInfo {
308        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[12]
309    }
310
311    pub fn get_response_headers_method_info() -> &'static ::unity::il2cpp::MethodInfo {
312        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[13]
313    }
314
315    pub fn get_text_method_info() -> &'static ::unity::il2cpp::MethodInfo {
316        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[14]
317    }
318
319    pub fn get_url_method_info() -> &'static ::unity::il2cpp::MethodInfo {
320        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[15]
321    }
322
323    pub fn get_keep_waiting_method_info() -> &'static ::unity::il2cpp::MethodInfo {
324        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[16]
325    }
326
327    pub fn dispose_method_info() -> &'static ::unity::il2cpp::MethodInfo {
328        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[17]
329    }
330
331    pub fn wait_until_done_if_possible_method_info() -> &'static ::unity::il2cpp::MethodInfo {
332        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[18]
333    }
334}
335
336#[cfg(feature = "unity_engine-www")]
337impl WWW {
338    #[doc = "Direct (non-virtual) call to `WWW`'s own `get_keepWaiting`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
339    pub unsafe fn get_keep_waiting(this: impl ::core::convert::Into<::unity::IlInstance>) -> bool {
340        let __mi = Self::get_keep_waiting_method_info();
341        let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> bool = ::core::mem::transmute(__mi.method_ptr);
342        __inner(this.into(), ::core::option::Option::None)
343    }
344
345    #[doc = "Direct (non-virtual) call to `WWW`'s own `Dispose`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
346    pub unsafe fn dispose(this: impl ::core::convert::Into<::unity::IlInstance>) -> () {
347        let __mi = Self::dispose_method_info();
348        let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__mi.method_ptr);
349        __inner(this.into(), ::core::option::Option::None)
350    }
351}
352
353#[cfg(feature = "unity_engine-www")]
354impl WWW {
355    #[doc = "`.ctor(::unity::Il2CppString, crate::unity_engine::wwwform::WWWForm)` — overload selector"]
356    pub fn new(url: ::unity::Il2CppString, form: crate::unity_engine::wwwform::WWWForm) -> Self {
357        let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
358            panic!(
359                "{}
360::{}
361 failed to instantiate",
362                ::core::stringify!(WWW),
363                ::core::stringify!(new),
364            )
365        });
366        <Self as IWWWMethods>::ctor(this, url, form);
367        this
368    }
369
370    #[doc = "`.ctor(::unity::Il2CppString, ::unity::Array<u8>)` — overload selector"]
371    pub fn new_2(url: ::unity::Il2CppString, post_data: ::unity::Array<u8>) -> Self {
372        let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
373            panic!(
374                "{}
375::{}
376 failed to instantiate",
377                ::core::stringify!(WWW),
378                ::core::stringify!(new_2),
379            )
380        });
381        <Self as IWWWMethods>::ctor_2(this, url, post_data);
382        this
383    }
384
385    #[doc = "`.ctor(::unity::Il2CppString, ::unity::Array<u8>, crate::system::collections::generic::dictionary_2::Dictionary_2<::unity::Il2CppString,::unity::Il2CppString>)` — overload selector"]
386    pub fn new_3(
387        url: ::unity::Il2CppString,
388        post_data: ::unity::Array<u8>,
389        headers: crate::system::collections::generic::dictionary_2::Dictionary_2<::unity::Il2CppString, ::unity::Il2CppString>,
390    ) -> Self {
391        let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
392            panic!(
393                "{}
394::{}
395 failed to instantiate",
396                ::core::stringify!(WWW),
397                ::core::stringify!(new_3),
398            )
399        });
400        <Self as IWWWMethods>::ctor_3(this, url, post_data, headers);
401        this
402    }
403
404    #[doc = "`.ctor(::unity::Il2CppString, ::unity::Il2CppString, crate::unity_engine::hash128::Hash128, u32)` — overload selector"]
405    pub fn new_4(url: ::unity::Il2CppString, name: ::unity::Il2CppString, hash: crate::unity_engine::hash128::Hash128, crc: u32) -> Self {
406        let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
407            panic!(
408                "{}
409::{}
410 failed to instantiate",
411                ::core::stringify!(WWW),
412                ::core::stringify!(new_4),
413            )
414        });
415        <Self as IWWWMethods>::ctor_4(this, url, name, hash, crc);
416        this
417    }
418}
419
420#[cfg(feature = "unity_engine-www")]
421#[doc(hidden)]
422pub mod prelude {
423    pub use super::{IWWWMethods, IWWW, WWW};
424    #[cfg(feature = "system-object")]
425    pub use crate::system::object::IObjectMethods;
426    #[cfg(feature = "unity_engine-customyieldinstruction")]
427    pub use crate::unity_engine::customyieldinstruction::ICustomYieldInstructionMethods;
428    pub use crate::{system::object::IObject, unity_engine::customyieldinstruction::ICustomYieldInstruction};
429}