engage/generated/unity_engine/events/
persistentcall.rs1#[cfg(feature = "unity_engine-events-persistentcall-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/events/persistentcall/PersistentCall.md"))]
11 #[::unity::class(namespace = "UnityEngine.Events", name = "PersistentCall")]
12 #[parent(crate::system::object::Object)]
13 pub struct PersistentCall {
14 #[offset(16)]
15 #[rename(name = "m_Target")]
16 pub m_target: crate::unity_engine::object_2::Object_2,
17 #[offset(24)]
18 #[rename(name = "m_TargetAssemblyTypeName")]
19 pub m_target_assembly_type_name: ::unity::Il2CppString,
20 #[offset(32)]
21 #[rename(name = "m_MethodName")]
22 pub m_method_name: ::unity::Il2CppString,
23 #[offset(40)]
24 #[rename(name = "m_Mode")]
25 pub m_mode: crate::unity_engine::events::persistentlistenermode::PersistentListenerMode,
26 #[offset(48)]
27 #[rename(name = "m_Arguments")]
28 pub m_arguments: crate::unity_engine::events::argumentcache::ArgumentCache,
29 #[offset(56)]
30 #[rename(name = "m_CallState")]
31 pub m_call_state: crate::unity_engine::events::unityeventcallstate::UnityEventCallState,
32 }
33}
34
35#[cfg(feature = "unity_engine-events-persistentcall-types")]
36pub use __types::*;
37
38#[cfg(feature = "unity_engine-events-persistentcall")]
39impl PersistentCall {
40 #[doc = "`GetObjectCall(crate::unity_engine::object_2::Object_2, crate::system::reflection::methodinfo::MethodInfo, crate::unity_engine::events::argumentcache::ArgumentCache)` overload"]
41 pub fn get_object_call(
42 target: impl ::core::convert::Into<crate::unity_engine::object_2::Object_2>,
43 method: impl ::core::convert::Into<crate::system::reflection::methodinfo::MethodInfo>,
44 arguments: impl ::core::convert::Into<crate::unity_engine::events::argumentcache::ArgumentCache>,
45 ) -> crate::unity_engine::events::baseinvokablecall::BaseInvokableCall {
46 unsafe {
47 ::unity::il2cpp_call!((::unity::module_base()+0x32f0900usize)as*mut u8,crate::unity_engine::events::baseinvokablecall::BaseInvokableCall;
48(crate::unity_engine::object_2::Object_2)::core::convert::Into::into(target),(crate::system::reflection::methodinfo::MethodInfo)::core::convert::Into::into(method),(crate::unity_engine::events::argumentcache::ArgumentCache)::core::convert::Into::into(arguments))
49 }
50 }
51}
52
53#[cfg(feature = "unity_engine-events-persistentcall")]
54pub trait IPersistentCallMethods: IPersistentCall {
55 #[doc = "`get_target()` overload"]
56 fn get_target(self) -> crate::unity_engine::object_2::Object_2 {
57 unsafe {
58 let __receiver = <PersistentCall as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
59 ::unity::il2cpp_call!((::unity::module_base()+0x32f0330usize)as*mut u8,crate::unity_engine::object_2::Object_2;
60(PersistentCall)__receiver)
61 }
62 }
63 #[doc = "`get_targetAssemblyTypeName()` overload"]
64 fn get_target_assembly_type_name(self) -> ::unity::Il2CppString {
65 unsafe {
66 let __receiver = <PersistentCall as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
67 ::unity::il2cpp_call!((::unity::module_base()+0x32f0340usize)as*mut u8, ::unity::Il2CppString;
68(PersistentCall)__receiver)
69 }
70 }
71 #[doc = "`get_methodName()` overload"]
72 fn get_method_name(self) -> ::unity::Il2CppString {
73 unsafe {
74 let __receiver = <PersistentCall as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
75 ::unity::il2cpp_call!((::unity::module_base()+0x32f04d0usize)as*mut u8, ::unity::Il2CppString;
76(PersistentCall)__receiver)
77 }
78 }
79 #[doc = "`get_mode()` overload"]
80 fn get_mode(self) -> crate::unity_engine::events::persistentlistenermode::PersistentListenerMode {
81 unsafe {
82 let __receiver = <PersistentCall as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
83 ::unity::il2cpp_call!((::unity::module_base()+0x32f04e0usize)as*mut u8,crate::unity_engine::events::persistentlistenermode::PersistentListenerMode;
84(PersistentCall)__receiver)
85 }
86 }
87 #[doc = "`get_arguments()` overload"]
88 fn get_arguments(self) -> crate::unity_engine::events::argumentcache::ArgumentCache {
89 unsafe {
90 let __receiver = <PersistentCall as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
91 ::unity::il2cpp_call!((::unity::module_base()+0x32f04f0usize)as*mut u8,crate::unity_engine::events::argumentcache::ArgumentCache;
92(PersistentCall)__receiver)
93 }
94 }
95 #[doc = "`IsValid()` overload"]
96 fn is_valid(self) -> bool {
97 unsafe {
98 let __receiver = <PersistentCall as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
99 ::unity::il2cpp_call!((::unity::module_base()+0x32f0500usize)as*mut u8,bool;
100(PersistentCall)__receiver)
101 }
102 }
103 #[doc = "`GetRuntimeCall(crate::unity_engine::events::unityeventbase::UnityEventBase)` overload"]
104 fn get_runtime_call(
105 self,
106 the_event: impl ::core::convert::Into<crate::unity_engine::events::unityeventbase::UnityEventBase>,
107 ) -> crate::unity_engine::events::baseinvokablecall::BaseInvokableCall {
108 unsafe {
109 let __receiver = <PersistentCall as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
110 ::unity::il2cpp_call!((::unity::module_base()+0x32f0560usize)as*mut u8,crate::unity_engine::events::baseinvokablecall::BaseInvokableCall;
111(PersistentCall)__receiver,(crate::unity_engine::events::unityeventbase::UnityEventBase)::core::convert::Into::into(the_event))
112 }
113 }
114 #[doc = "`OnBeforeSerialize()` overload"]
115 fn on_before_serialize(self) -> () {
116 unsafe {
117 let __receiver = <PersistentCall as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
118 {
119 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
120 let __vi = *__vt.get(4usize).unwrap_or_else(|| {
121 panic!(
122 "unity: virtual slot {}
123 out of range (vtable len {}
124) on the runtime class behind {}
125 (method `{}
126`)",
127 4usize,
128 __vt.len(),
129 <PersistentCall as ::unity::ClassIdentity>::NAME,
130 "OnBeforeSerialize",
131 )
132 });
133 let __inner: extern "C" fn(PersistentCall, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__vi.method_ptr);
134 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
135 __inner(__receiver, __mi)
136 }
137 }
138 }
139 #[doc = "`OnAfterDeserialize()` overload"]
140 fn on_after_deserialize(self) -> () {
141 unsafe {
142 let __receiver = <PersistentCall as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
143 {
144 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
145 let __vi = *__vt.get(5usize).unwrap_or_else(|| {
146 panic!(
147 "unity: virtual slot {}
148 out of range (vtable len {}
149) on the runtime class behind {}
150 (method `{}
151`)",
152 5usize,
153 __vt.len(),
154 <PersistentCall as ::unity::ClassIdentity>::NAME,
155 "OnAfterDeserialize",
156 )
157 });
158 let __inner: extern "C" fn(PersistentCall, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__vi.method_ptr);
159 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
160 __inner(__receiver, __mi)
161 }
162 }
163 }
164 #[doc = "`.ctor()` overload"]
165 fn ctor(self) -> () {
166 unsafe {
167 let __receiver = <PersistentCall as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
168 ::unity::il2cpp_call!((::unity::module_base()+0x32f0ee0usize)as*mut u8,();
169(PersistentCall)__receiver)
170 }
171 }
172}
173
174#[cfg(feature = "unity_engine-events-persistentcall")]
175impl<__T: IPersistentCall> IPersistentCallMethods for __T {}
176
177#[cfg(feature = "unity_engine-events-persistentcall")]
178impl PersistentCall {
179 pub fn get_target_method_info() -> &'static ::unity::il2cpp::MethodInfo {
180 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
181 }
182
183 pub fn get_target_assembly_type_name_method_info() -> &'static ::unity::il2cpp::MethodInfo {
184 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
185 }
186
187 pub fn get_method_name_method_info() -> &'static ::unity::il2cpp::MethodInfo {
188 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
189 }
190
191 pub fn get_mode_method_info() -> &'static ::unity::il2cpp::MethodInfo {
192 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
193 }
194
195 pub fn get_arguments_method_info() -> &'static ::unity::il2cpp::MethodInfo {
196 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[4]
197 }
198
199 pub fn is_valid_method_info() -> &'static ::unity::il2cpp::MethodInfo {
200 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[5]
201 }
202
203 pub fn get_runtime_call_method_info() -> &'static ::unity::il2cpp::MethodInfo {
204 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[6]
205 }
206
207 pub fn get_object_call_method_info() -> &'static ::unity::il2cpp::MethodInfo {
208 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[7]
209 }
210
211 pub fn on_before_serialize_method_info() -> &'static ::unity::il2cpp::MethodInfo {
212 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[8]
213 }
214
215 pub fn on_after_deserialize_method_info() -> &'static ::unity::il2cpp::MethodInfo {
216 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[9]
217 }
218
219 pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
220 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[10]
221 }
222}
223
224#[cfg(feature = "unity_engine-events-persistentcall")]
225impl PersistentCall {
226 #[doc = "Direct (non-virtual) call to `PersistentCall`'s own `OnBeforeSerialize`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
227 pub unsafe fn on_before_serialize(this: impl ::core::convert::Into<::unity::IlInstance>) -> () {
228 let __mi = Self::on_before_serialize_method_info();
229 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__mi.method_ptr);
230 __inner(this.into(), ::core::option::Option::None)
231 }
232
233 #[doc = "Direct (non-virtual) call to `PersistentCall`'s own `OnAfterDeserialize`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
234 pub unsafe fn on_after_deserialize(this: impl ::core::convert::Into<::unity::IlInstance>) -> () {
235 let __mi = Self::on_after_deserialize_method_info();
236 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__mi.method_ptr);
237 __inner(this.into(), ::core::option::Option::None)
238 }
239}
240
241#[cfg(feature = "unity_engine-events-persistentcall")]
242impl PersistentCall {
243 #[doc = "`.ctor()` — no args"]
244 pub fn new() -> Self {
245 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
246 panic!(
247 "{}
248::{}
249 failed to instantiate",
250 ::core::stringify!(PersistentCall),
251 ::core::stringify!(new),
252 )
253 });
254 <Self as IPersistentCallMethods>::ctor(this);
255 this
256 }
257}
258
259#[cfg(feature = "unity_engine-events-persistentcall")]
260#[doc(hidden)]
261pub mod prelude {
262 pub use super::{IPersistentCall, IPersistentCallMethods, PersistentCall};
263 pub use crate::system::object::IObject;
264 #[cfg(feature = "system-object")]
265 pub use crate::system::object::IObjectMethods;
266}