Skip to main content

engage/generated/unity_engine/
globaljavaobjectref.rs

1// @generated by il2cpp-bindgen — do not edit by hand.
2
3#[cfg(feature = "unity_engine-globaljavaobjectref-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/globaljavaobjectref/GlobalJavaObjectRef.md"))]
11    #[::unity::class(namespace = "UnityEngine", name = "GlobalJavaObjectRef")]
12    #[parent(crate::system::object::Object)]
13    pub struct GlobalJavaObjectRef {
14        #[offset(16)]
15        #[rename(name = "m_disposed")]
16        pub m_disposed: bool,
17        #[offset(24)]
18        #[rename(name = "m_jobject")]
19        pub m_jobject: ::unity::IntPtr,
20    }
21}
22
23#[cfg(feature = "unity_engine-globaljavaobjectref-types")]
24pub use __types::*;
25
26#[cfg(feature = "unity_engine-globaljavaobjectref")]
27impl GlobalJavaObjectRef {
28    #[doc = "`op_Implicit(crate::unity_engine::globaljavaobjectref::GlobalJavaObjectRef)` overload"]
29    pub fn op_implicit(obj: impl ::core::convert::Into<crate::unity_engine::globaljavaobjectref::GlobalJavaObjectRef>) -> ::unity::IntPtr {
30        unsafe {
31            ::unity::il2cpp_call!((::unity::module_base()+0x3f122a0usize)as*mut u8, ::unity::IntPtr;
32(crate::unity_engine::globaljavaobjectref::GlobalJavaObjectRef)::core::convert::Into::into(obj))
33        }
34    }
35}
36
37#[cfg(feature = "unity_engine-globaljavaobjectref")]
38pub trait IGlobalJavaObjectRefMethods: IGlobalJavaObjectRef {
39    #[doc = "`.ctor(::unity::IntPtr)` overload"]
40    fn ctor(self, jobject: impl ::core::convert::Into<::unity::IntPtr>) -> () {
41        unsafe {
42            let __receiver = <GlobalJavaObjectRef as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
43            ::unity::il2cpp_call!((::unity::module_base()+0x3f11b60usize)as*mut u8,();
44(GlobalJavaObjectRef)__receiver,(::unity::IntPtr)::core::convert::Into::into(jobject))
45        }
46    }
47    #[doc = "`Finalize()` overload"]
48    fn finalize(self) -> () {
49        unsafe {
50            let __receiver = <GlobalJavaObjectRef as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
51            {
52                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
53                let __vi = *__vt.get(1usize).unwrap_or_else(|| {
54                    panic!(
55                        "unity: virtual slot {}
56 out of range (vtable len {}
57) on the runtime class behind {}
58 (method `{}
59`)",
60                        1usize,
61                        __vt.len(),
62                        <GlobalJavaObjectRef as ::unity::ClassIdentity>::NAME,
63                        "Finalize",
64                    )
65                });
66                let __inner: extern "C" fn(GlobalJavaObjectRef, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__vi.method_ptr);
67                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
68                __inner(__receiver, __mi)
69            }
70        }
71    }
72    #[doc = "`Dispose()` overload"]
73    fn dispose(self) -> () {
74        unsafe {
75            let __receiver = <GlobalJavaObjectRef as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
76            ::unity::il2cpp_call!((::unity::module_base()+0x3f12600usize)as*mut u8,();
77(GlobalJavaObjectRef)__receiver)
78        }
79    }
80}
81
82#[cfg(feature = "unity_engine-globaljavaobjectref")]
83impl<__T: IGlobalJavaObjectRef> IGlobalJavaObjectRefMethods for __T {}
84
85#[cfg(feature = "unity_engine-globaljavaobjectref")]
86impl GlobalJavaObjectRef {
87    pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
88        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
89    }
90
91    pub fn finalize_method_info() -> &'static ::unity::il2cpp::MethodInfo {
92        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
93    }
94
95    pub fn op_implicit_method_info() -> &'static ::unity::il2cpp::MethodInfo {
96        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
97    }
98
99    pub fn dispose_method_info() -> &'static ::unity::il2cpp::MethodInfo {
100        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
101    }
102}
103
104#[cfg(feature = "unity_engine-globaljavaobjectref")]
105impl GlobalJavaObjectRef {
106    #[doc = "Direct (non-virtual) call to `GlobalJavaObjectRef`'s own `Finalize`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
107    pub unsafe fn finalize(this: impl ::core::convert::Into<::unity::IlInstance>) -> () {
108        let __mi = Self::finalize_method_info();
109        let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__mi.method_ptr);
110        __inner(this.into(), ::core::option::Option::None)
111    }
112}
113
114#[cfg(feature = "unity_engine-globaljavaobjectref")]
115impl GlobalJavaObjectRef {
116    #[doc = "`.ctor(::unity::IntPtr)` — overload selector"]
117    pub fn new(jobject: ::unity::IntPtr) -> Self {
118        let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
119            panic!(
120                "{}
121::{}
122 failed to instantiate",
123                ::core::stringify!(GlobalJavaObjectRef),
124                ::core::stringify!(new),
125            )
126        });
127        <Self as IGlobalJavaObjectRefMethods>::ctor(this, jobject);
128        this
129    }
130}
131
132#[cfg(feature = "unity_engine-globaljavaobjectref")]
133#[doc(hidden)]
134pub mod prelude {
135    pub use super::{GlobalJavaObjectRef, IGlobalJavaObjectRef, IGlobalJavaObjectRefMethods};
136    pub use crate::system::object::IObject;
137    #[cfg(feature = "system-object")]
138    pub use crate::system::object::IObjectMethods;
139}