Skip to main content

engage/generated/unity_engine/events/
invokablecall.rs

1// @generated by il2cpp-bindgen — do not edit by hand.
2
3#[cfg(feature = "unity_engine-events-invokablecall-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::events::baseinvokablecall::{BaseInvokableCall, IBaseInvokableCall},
11    };
12
13    #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/unity_engine/events/invokablecall/InvokableCall.md"))]
14    #[::unity::class(namespace = "UnityEngine.Events", name = "InvokableCall")]
15    #[parent(crate::unity_engine::events::baseinvokablecall::BaseInvokableCall)]
16    pub struct InvokableCall {
17        #[offset(16)]
18        #[rename(name = "Delegate")]
19        pub delegate: crate::unity_engine::events::unityaction::UnityAction,
20    }
21}
22
23#[cfg(feature = "unity_engine-events-invokablecall-types")]
24pub use __types::*;
25
26#[cfg(feature = "unity_engine-events-invokablecall")]
27pub trait IInvokableCallMethods: IInvokableCall {
28    #[doc = "`add_Delegate(crate::unity_engine::events::unityaction::UnityAction)` overload"]
29    fn add_delegate(self, value: impl ::core::convert::Into<crate::unity_engine::events::unityaction::UnityAction>) -> () {
30        unsafe {
31            let __receiver = <InvokableCall as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
32            ::unity::il2cpp_call!((::unity::module_base()+0x2c515b0usize)as*mut u8,();
33(InvokableCall)__receiver,(crate::unity_engine::events::unityaction::UnityAction)::core::convert::Into::into(value))
34        }
35    }
36    #[doc = "`remove_Delegate(crate::unity_engine::events::unityaction::UnityAction)` overload"]
37    fn remove_delegate(self, value: impl ::core::convert::Into<crate::unity_engine::events::unityaction::UnityAction>) -> () {
38        unsafe {
39            let __receiver = <InvokableCall as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
40            ::unity::il2cpp_call!((::unity::module_base()+0x2c51660usize)as*mut u8,();
41(InvokableCall)__receiver,(crate::unity_engine::events::unityaction::UnityAction)::core::convert::Into::into(value))
42        }
43    }
44    #[doc = "`.ctor(crate::system::object::Object, crate::system::reflection::methodinfo::MethodInfo)` overload"]
45    fn ctor(
46        self,
47        target: impl ::core::convert::Into<crate::system::object::Object>,
48        the_function: impl ::core::convert::Into<crate::system::reflection::methodinfo::MethodInfo>,
49    ) -> () {
50        unsafe {
51            let __receiver = <InvokableCall as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
52            ::unity::il2cpp_call!((::unity::module_base()+0x2c51710usize)as*mut u8,();
53(InvokableCall)__receiver,(crate::system::object::Object)::core::convert::Into::into(target),(crate::system::reflection::methodinfo::MethodInfo)::core::convert::Into::into(the_function))
54        }
55    }
56    #[doc = "`.ctor(crate::unity_engine::events::unityaction::UnityAction)` overload"]
57    fn ctor_2(self, action: impl ::core::convert::Into<crate::unity_engine::events::unityaction::UnityAction>) -> () {
58        unsafe {
59            let __receiver = <InvokableCall as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
60            ::unity::il2cpp_call!((::unity::module_base()+0x2c51870usize)as*mut u8,();
61(InvokableCall)__receiver,(crate::unity_engine::events::unityaction::UnityAction)::core::convert::Into::into(action))
62        }
63    }
64    #[doc = "`Invoke(::unity::Array<crate::system::object::Object>)` overload"]
65    fn invoke(self, args: impl ::core::convert::Into<::unity::Array<crate::system::object::Object>>) -> () {
66        unsafe {
67            let __receiver = <InvokableCall as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
68            {
69                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
70                let __vi = *__vt.get(4usize).unwrap_or_else(|| {
71                    panic!(
72                        "unity: virtual slot {}
73 out of range (vtable len {}
74) on the runtime class behind {}
75 (method `{}
76`)",
77                        4usize,
78                        __vt.len(),
79                        <InvokableCall as ::unity::ClassIdentity>::NAME,
80                        "Invoke",
81                    )
82                });
83                let __inner: extern "C" fn(InvokableCall, ::unity::Array<crate::system::object::Object>, ::unity::OptionalMethod) -> () =
84                    ::core::mem::transmute(__vi.method_ptr);
85                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
86                __inner(__receiver, ::core::convert::Into::into(args), __mi)
87            }
88        }
89    }
90    #[doc = "`Invoke()` overload"]
91    fn invoke_2(self) -> () {
92        unsafe {
93            let __receiver = <InvokableCall as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
94            ::unity::il2cpp_call!((::unity::module_base()+0x2c519f0usize)as*mut u8,();
95(InvokableCall)__receiver)
96        }
97    }
98    #[doc = "`Find(crate::system::object::Object, crate::system::reflection::methodinfo::MethodInfo)` overload"]
99    fn find(
100        self,
101        target_obj: impl ::core::convert::Into<crate::system::object::Object>,
102        method: impl ::core::convert::Into<crate::system::reflection::methodinfo::MethodInfo>,
103    ) -> bool {
104        unsafe {
105            let __receiver = <InvokableCall as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
106            {
107                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
108                let __vi = *__vt.get(5usize).unwrap_or_else(|| {
109                    panic!(
110                        "unity: virtual slot {}
111 out of range (vtable len {}
112) on the runtime class behind {}
113 (method `{}
114`)",
115                        5usize,
116                        __vt.len(),
117                        <InvokableCall as ::unity::ClassIdentity>::NAME,
118                        "Find",
119                    )
120                });
121                let __inner: extern "C" fn(
122                    InvokableCall,
123                    crate::system::object::Object,
124                    crate::system::reflection::methodinfo::MethodInfo,
125                    ::unity::OptionalMethod,
126                ) -> bool = ::core::mem::transmute(__vi.method_ptr);
127                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
128                __inner(
129                    __receiver,
130                    ::core::convert::Into::into(target_obj),
131                    ::core::convert::Into::into(method),
132                    __mi,
133                )
134            }
135        }
136    }
137}
138
139#[cfg(feature = "unity_engine-events-invokablecall")]
140impl<__T: IInvokableCall> IInvokableCallMethods for __T {}
141
142#[cfg(feature = "unity_engine-events-invokablecall")]
143impl InvokableCall {
144    pub fn add_delegate_method_info() -> &'static ::unity::il2cpp::MethodInfo {
145        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
146    }
147
148    pub fn remove_delegate_method_info() -> &'static ::unity::il2cpp::MethodInfo {
149        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
150    }
151
152    pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
153        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
154    }
155
156    pub fn ctor_2_method_info() -> &'static ::unity::il2cpp::MethodInfo {
157        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
158    }
159
160    pub fn invoke_method_info() -> &'static ::unity::il2cpp::MethodInfo {
161        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[4]
162    }
163
164    pub fn invoke_2_method_info() -> &'static ::unity::il2cpp::MethodInfo {
165        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[5]
166    }
167
168    pub fn find_method_info() -> &'static ::unity::il2cpp::MethodInfo {
169        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[6]
170    }
171}
172
173#[cfg(feature = "unity_engine-events-invokablecall")]
174impl InvokableCall {
175    #[doc = "Direct (non-virtual) call to `InvokableCall`'s own `Invoke`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
176    pub unsafe fn invoke(this: impl ::core::convert::Into<::unity::IlInstance>, args: ::unity::Array<crate::system::object::Object>) -> () {
177        let __mi = Self::invoke_method_info();
178        let __inner: extern "C" fn(::unity::IlInstance, ::unity::Array<crate::system::object::Object>, ::unity::OptionalMethod) -> () =
179            ::core::mem::transmute(__mi.method_ptr);
180        __inner(this.into(), args, ::core::option::Option::None)
181    }
182
183    #[doc = "Direct (non-virtual) call to `InvokableCall`'s own `Find`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
184    pub unsafe fn find(
185        this: impl ::core::convert::Into<::unity::IlInstance>,
186        target_obj: crate::system::object::Object,
187        method: crate::system::reflection::methodinfo::MethodInfo,
188    ) -> bool {
189        let __mi = Self::find_method_info();
190        let __inner: extern "C" fn(
191            ::unity::IlInstance,
192            crate::system::object::Object,
193            crate::system::reflection::methodinfo::MethodInfo,
194            ::unity::OptionalMethod,
195        ) -> bool = ::core::mem::transmute(__mi.method_ptr);
196        __inner(this.into(), target_obj, method, ::core::option::Option::None)
197    }
198}
199
200#[cfg(feature = "unity_engine-events-invokablecall")]
201impl InvokableCall {
202    #[doc = "`.ctor(crate::system::object::Object, crate::system::reflection::methodinfo::MethodInfo)` — overload selector"]
203    pub fn new(target: crate::system::object::Object, the_function: crate::system::reflection::methodinfo::MethodInfo) -> Self {
204        let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
205            panic!(
206                "{}
207::{}
208 failed to instantiate",
209                ::core::stringify!(InvokableCall),
210                ::core::stringify!(new),
211            )
212        });
213        <Self as IInvokableCallMethods>::ctor(this, target, the_function);
214        this
215    }
216
217    #[doc = "`.ctor(crate::unity_engine::events::unityaction::UnityAction)` — overload selector"]
218    pub fn new_2(action: crate::unity_engine::events::unityaction::UnityAction) -> Self {
219        let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
220            panic!(
221                "{}
222::{}
223 failed to instantiate",
224                ::core::stringify!(InvokableCall),
225                ::core::stringify!(new_2),
226            )
227        });
228        <Self as IInvokableCallMethods>::ctor_2(this, action);
229        this
230    }
231}
232
233#[cfg(feature = "unity_engine-events-invokablecall")]
234#[doc(hidden)]
235pub mod prelude {
236    pub use super::{IInvokableCall, IInvokableCallMethods, InvokableCall};
237    #[cfg(feature = "system-object")]
238    pub use crate::system::object::IObjectMethods;
239    #[cfg(feature = "unity_engine-events-baseinvokablecall")]
240    pub use crate::unity_engine::events::baseinvokablecall::IBaseInvokableCallMethods;
241    pub use crate::{system::object::IObject, unity_engine::events::baseinvokablecall::IBaseInvokableCall};
242}