engage/generated/unity_engine/events/
unityeventbase.rs1#[cfg(feature = "unity_engine-events-unityeventbase-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/unityeventbase/UnityEventBase.md"))]
11 #[::unity::class(namespace = "UnityEngine.Events", name = "UnityEventBase")]
12 #[parent(crate::system::object::Object)]
13 pub struct UnityEventBase {
14 #[offset(16)]
15 #[rename(name = "m_Calls")]
16 pub m_calls: crate::unity_engine::events::invokablecalllist::InvokableCallList,
17 #[offset(24)]
18 #[rename(name = "m_PersistentCalls")]
19 pub m_persistent_calls: crate::unity_engine::events::persistentcallgroup::PersistentCallGroup,
20 #[offset(32)]
21 #[rename(name = "m_CallsDirty")]
22 pub m_calls_dirty: bool,
23 }
24}
25
26#[cfg(feature = "unity_engine-events-unityeventbase-types")]
27pub use __types::*;
28
29#[cfg(feature = "unity_engine-events-unityeventbase")]
30impl UnityEventBase {
31 #[doc = "`GetValidMethodInfo(::unity::SystemType, ::unity::Il2CppString, ::unity::Array<::unity::SystemType>)` overload"]
32 pub fn get_valid_method_info(
33 object_type: impl ::core::convert::Into<::unity::SystemType>,
34 function_name: impl ::core::convert::Into<::unity::Il2CppString>,
35 argument_types: impl ::core::convert::Into<::unity::Array<::unity::SystemType>>,
36 ) -> crate::system::reflection::methodinfo::MethodInfo {
37 unsafe {
38 ::unity::il2cpp_call!((::unity::module_base()+0x3793d30usize)as*mut u8,crate::system::reflection::methodinfo::MethodInfo;
39(::unity::SystemType)::core::convert::Into::into(object_type),(::unity::Il2CppString)::core::convert::Into::into(function_name),(::unity::Array< ::unity::SystemType>)::core::convert::Into::into(argument_types))
40 }
41 }
42}
43
44#[cfg(feature = "unity_engine-events-unityeventbase")]
45pub trait IUnityEventBaseMethods: IUnityEventBase {
46 #[doc = "`.ctor()` overload"]
47 fn ctor(self) -> () {
48 unsafe {
49 let __receiver = <UnityEventBase as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
50 ::unity::il2cpp_call!((::unity::module_base()+0x3793ab0usize)as*mut u8,();
51(UnityEventBase)__receiver)
52 }
53 }
54 #[doc = "`UnityEngine.ISerializationCallbackReceiver.OnBeforeSerialize()` overload"]
55 fn unity_engine_i_serialization_callback_receiver_on_before_serialize(self) -> () {
56 unsafe {
57 let __receiver = <UnityEventBase as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
58 {
59 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
60 let __vi = *__vt.get(4usize).unwrap_or_else(|| {
61 panic!(
62 "unity: virtual slot {}
63 out of range (vtable len {}
64) on the runtime class behind {}
65 (method `{}
66`)",
67 4usize,
68 __vt.len(),
69 <UnityEventBase as ::unity::ClassIdentity>::NAME,
70 "UnityEngine.ISerializationCallbackReceiver.OnBeforeSerialize",
71 )
72 });
73 let __inner: extern "C" fn(UnityEventBase, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__vi.method_ptr);
74 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
75 __inner(__receiver, __mi)
76 }
77 }
78 }
79 #[doc = "`UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize()` overload"]
80 fn unity_engine_i_serialization_callback_receiver_on_after_deserialize(self) -> () {
81 unsafe {
82 let __receiver = <UnityEventBase as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
83 {
84 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
85 let __vi = *__vt.get(5usize).unwrap_or_else(|| {
86 panic!(
87 "unity: virtual slot {}
88 out of range (vtable len {}
89) on the runtime class behind {}
90 (method `{}
91`)",
92 5usize,
93 __vt.len(),
94 <UnityEventBase as ::unity::ClassIdentity>::NAME,
95 "UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize",
96 )
97 });
98 let __inner: extern "C" fn(UnityEventBase, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__vi.method_ptr);
99 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
100 __inner(__receiver, __mi)
101 }
102 }
103 }
104 #[doc = "`FindMethod_Impl(::unity::Il2CppString, ::unity::SystemType)` overload"]
105 fn find_method_impl(
106 self,
107 name: impl ::core::convert::Into<::unity::Il2CppString>,
108 target_obj_type: impl ::core::convert::Into<::unity::SystemType>,
109 ) -> crate::system::reflection::methodinfo::MethodInfo {
110 unsafe {
111 let __receiver = <UnityEventBase as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
112 {
113 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
114 let __vi = *__vt.get(6usize).unwrap_or_else(|| {
115 panic!(
116 "unity: virtual slot {}
117 out of range (vtable len {}
118) on the runtime class behind {}
119 (method `{}
120`)",
121 6usize,
122 __vt.len(),
123 <UnityEventBase as ::unity::ClassIdentity>::NAME,
124 "FindMethod_Impl",
125 )
126 });
127 let __inner: extern "C" fn(
128 UnityEventBase,
129 ::unity::Il2CppString,
130 ::unity::SystemType,
131 ::unity::OptionalMethod,
132 ) -> crate::system::reflection::methodinfo::MethodInfo = ::core::mem::transmute(__vi.method_ptr);
133 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
134 __inner(
135 __receiver,
136 ::core::convert::Into::into(name),
137 ::core::convert::Into::into(target_obj_type),
138 __mi,
139 )
140 }
141 }
142 }
143 #[doc = "`GetDelegate(crate::system::object::Object, crate::system::reflection::methodinfo::MethodInfo)` overload"]
144 fn get_delegate(
145 self,
146 target: impl ::core::convert::Into<crate::system::object::Object>,
147 the_function: impl ::core::convert::Into<crate::system::reflection::methodinfo::MethodInfo>,
148 ) -> crate::unity_engine::events::baseinvokablecall::BaseInvokableCall {
149 unsafe {
150 let __receiver = <UnityEventBase as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
151 {
152 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
153 let __vi = *__vt.get(7usize).unwrap_or_else(|| {
154 panic!(
155 "unity: virtual slot {}
156 out of range (vtable len {}
157) on the runtime class behind {}
158 (method `{}
159`)",
160 7usize,
161 __vt.len(),
162 <UnityEventBase as ::unity::ClassIdentity>::NAME,
163 "GetDelegate",
164 )
165 });
166 let __inner: extern "C" fn(
167 UnityEventBase,
168 crate::system::object::Object,
169 crate::system::reflection::methodinfo::MethodInfo,
170 ::unity::OptionalMethod,
171 ) -> crate::unity_engine::events::baseinvokablecall::BaseInvokableCall = ::core::mem::transmute(__vi.method_ptr);
172 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
173 __inner(
174 __receiver,
175 ::core::convert::Into::into(target),
176 ::core::convert::Into::into(the_function),
177 __mi,
178 )
179 }
180 }
181 }
182 #[doc = "`FindMethod(crate::unity_engine::events::persistentcall::PersistentCall)` overload"]
183 fn find_method(
184 self,
185 call: impl ::core::convert::Into<crate::unity_engine::events::persistentcall::PersistentCall>,
186 ) -> crate::system::reflection::methodinfo::MethodInfo {
187 unsafe {
188 let __receiver = <UnityEventBase as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
189 ::unity::il2cpp_call!((::unity::module_base()+0x37941e0usize)as*mut u8,crate::system::reflection::methodinfo::MethodInfo;
190(UnityEventBase)__receiver,(crate::unity_engine::events::persistentcall::PersistentCall)::core::convert::Into::into(call))
191 }
192 }
193 #[doc = "`FindMethod(::unity::Il2CppString, ::unity::SystemType, crate::unity_engine::events::persistentlistenermode::PersistentListenerMode, ::unity::SystemType)` overload"]
194 fn find_method_2(
195 self,
196 name: impl ::core::convert::Into<::unity::Il2CppString>,
197 listener_type: impl ::core::convert::Into<::unity::SystemType>,
198 mode: impl ::core::convert::Into<crate::unity_engine::events::persistentlistenermode::PersistentListenerMode>,
199 argument_type: impl ::core::convert::Into<::unity::SystemType>,
200 ) -> crate::system::reflection::methodinfo::MethodInfo {
201 unsafe {
202 let __receiver = <UnityEventBase as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
203 ::unity::il2cpp_call!((::unity::module_base()+0x3794420usize)as*mut u8,crate::system::reflection::methodinfo::MethodInfo;
204(UnityEventBase)__receiver,(::unity::Il2CppString)::core::convert::Into::into(name),(::unity::SystemType)::core::convert::Into::into(listener_type),(crate::unity_engine::events::persistentlistenermode::PersistentListenerMode)::core::convert::Into::into(mode),(::unity::SystemType)::core::convert::Into::into(argument_type))
205 }
206 }
207 #[doc = "`DirtyPersistentCalls()` overload"]
208 fn dirty_persistent_calls(self) -> () {
209 unsafe {
210 let __receiver = <UnityEventBase as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
211 ::unity::il2cpp_call!((::unity::module_base()+0x37941b0usize)as*mut u8,();
212(UnityEventBase)__receiver)
213 }
214 }
215 #[doc = "`RebuildPersistentCallsIfNeeded()` overload"]
216 fn rebuild_persistent_calls_if_needed(self) -> () {
217 unsafe {
218 let __receiver = <UnityEventBase as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
219 ::unity::il2cpp_call!((::unity::module_base()+0x3794700usize)as*mut u8,();
220(UnityEventBase)__receiver)
221 }
222 }
223 #[doc = "`AddCall(crate::unity_engine::events::baseinvokablecall::BaseInvokableCall)` overload"]
224 fn add_call(self, call: impl ::core::convert::Into<crate::unity_engine::events::baseinvokablecall::BaseInvokableCall>) -> () {
225 unsafe {
226 let __receiver = <UnityEventBase as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
227 ::unity::il2cpp_call!((::unity::module_base()+0x3793c60usize)as*mut u8,();
228(UnityEventBase)__receiver,(crate::unity_engine::events::baseinvokablecall::BaseInvokableCall)::core::convert::Into::into(call))
229 }
230 }
231 #[doc = "`RemoveListener(crate::system::object::Object, crate::system::reflection::methodinfo::MethodInfo)` overload"]
232 fn remove_listener(
233 self,
234 target_obj: impl ::core::convert::Into<crate::system::object::Object>,
235 method: impl ::core::convert::Into<crate::system::reflection::methodinfo::MethodInfo>,
236 ) -> () {
237 unsafe {
238 let __receiver = <UnityEventBase as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
239 ::unity::il2cpp_call!((::unity::module_base()+0x3793cb0usize)as*mut u8,();
240(UnityEventBase)__receiver,(crate::system::object::Object)::core::convert::Into::into(target_obj),(crate::system::reflection::methodinfo::MethodInfo)::core::convert::Into::into(method))
241 }
242 }
243 #[doc = "`PrepareInvoke()` overload"]
244 fn prepare_invoke(
245 self,
246 ) -> crate::system::collections::generic::list_1::List_1<crate::unity_engine::events::baseinvokablecall::BaseInvokableCall> {
247 unsafe {
248 let __receiver = <UnityEventBase as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
249 ::unity::il2cpp_call!((::unity::module_base()+0x3794130usize)as*mut u8,crate::system::collections::generic::list_1::List_1<crate::unity_engine::events::baseinvokablecall::BaseInvokableCall> ;
250(UnityEventBase)__receiver)
251 }
252 }
253 #[doc = "`ToString()` overload"]
254 fn to_string(self) -> ::unity::Il2CppString {
255 unsafe {
256 let __receiver = <UnityEventBase as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
257 {
258 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
259 let __vi = *__vt.get(3usize).unwrap_or_else(|| {
260 panic!(
261 "unity: virtual slot {}
262 out of range (vtable len {}
263) on the runtime class behind {}
264 (method `{}
265`)",
266 3usize,
267 __vt.len(),
268 <UnityEventBase as ::unity::ClassIdentity>::NAME,
269 "ToString",
270 )
271 });
272 let __inner: extern "C" fn(UnityEventBase, ::unity::OptionalMethod) -> ::unity::Il2CppString =
273 ::core::mem::transmute(__vi.method_ptr);
274 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
275 __inner(__receiver, __mi)
276 }
277 }
278 }
279}
280
281#[cfg(feature = "unity_engine-events-unityeventbase")]
282impl<__T: IUnityEventBase> IUnityEventBaseMethods for __T {}
283
284#[cfg(feature = "unity_engine-events-unityeventbase")]
285impl UnityEventBase {
286 pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
287 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
288 }
289
290 pub fn unity_engine_i_serialization_callback_receiver_on_before_serialize_method_info() -> &'static ::unity::il2cpp::MethodInfo {
291 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
292 }
293
294 pub fn unity_engine_i_serialization_callback_receiver_on_after_deserialize_method_info() -> &'static ::unity::il2cpp::MethodInfo {
295 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
296 }
297
298 pub fn find_method_impl_method_info() -> &'static ::unity::il2cpp::MethodInfo {
299 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
300 }
301
302 pub fn get_delegate_method_info() -> &'static ::unity::il2cpp::MethodInfo {
303 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[4]
304 }
305
306 pub fn find_method_method_info() -> &'static ::unity::il2cpp::MethodInfo {
307 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[5]
308 }
309
310 pub fn find_method_2_method_info() -> &'static ::unity::il2cpp::MethodInfo {
311 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[6]
312 }
313
314 pub fn dirty_persistent_calls_method_info() -> &'static ::unity::il2cpp::MethodInfo {
315 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[7]
316 }
317
318 pub fn rebuild_persistent_calls_if_needed_method_info() -> &'static ::unity::il2cpp::MethodInfo {
319 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[8]
320 }
321
322 pub fn add_call_method_info() -> &'static ::unity::il2cpp::MethodInfo {
323 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[9]
324 }
325
326 pub fn remove_listener_method_info() -> &'static ::unity::il2cpp::MethodInfo {
327 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[10]
328 }
329
330 pub fn prepare_invoke_method_info() -> &'static ::unity::il2cpp::MethodInfo {
331 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[11]
332 }
333
334 pub fn to_string_method_info() -> &'static ::unity::il2cpp::MethodInfo {
335 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[12]
336 }
337
338 pub fn get_valid_method_info_method_info() -> &'static ::unity::il2cpp::MethodInfo {
339 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[13]
340 }
341}
342
343#[cfg(feature = "unity_engine-events-unityeventbase")]
344impl UnityEventBase {
345 #[doc = "Direct (non-virtual) call to `UnityEventBase`'s own `UnityEngine.ISerializationCallbackReceiver.OnBeforeSerialize`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
346 pub unsafe fn unity_engine_i_serialization_callback_receiver_on_before_serialize(this: impl ::core::convert::Into<::unity::IlInstance>) -> () {
347 let __mi = Self::unity_engine_i_serialization_callback_receiver_on_before_serialize_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 #[doc = "Direct (non-virtual) call to `UnityEventBase`'s own `UnityEngine.ISerializationCallbackReceiver.OnAfterDeserialize`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
353 pub unsafe fn unity_engine_i_serialization_callback_receiver_on_after_deserialize(this: impl ::core::convert::Into<::unity::IlInstance>) -> () {
354 let __mi = Self::unity_engine_i_serialization_callback_receiver_on_after_deserialize_method_info();
355 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__mi.method_ptr);
356 __inner(this.into(), ::core::option::Option::None)
357 }
358
359 #[doc = "Direct (non-virtual) call to `UnityEventBase`'s own `FindMethod_Impl`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
360 pub unsafe fn find_method_impl(
361 this: impl ::core::convert::Into<::unity::IlInstance>,
362 name: ::unity::Il2CppString,
363 target_obj_type: ::unity::SystemType,
364 ) -> crate::system::reflection::methodinfo::MethodInfo {
365 let __mi = Self::find_method_impl_method_info();
366 let __inner: extern "C" fn(
367 ::unity::IlInstance,
368 ::unity::Il2CppString,
369 ::unity::SystemType,
370 ::unity::OptionalMethod,
371 ) -> crate::system::reflection::methodinfo::MethodInfo = ::core::mem::transmute(__mi.method_ptr);
372 __inner(this.into(), name, target_obj_type, ::core::option::Option::None)
373 }
374
375 #[doc = "Direct (non-virtual) call to `UnityEventBase`'s own `GetDelegate`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
376 pub unsafe fn get_delegate(
377 this: impl ::core::convert::Into<::unity::IlInstance>,
378 target: crate::system::object::Object,
379 the_function: crate::system::reflection::methodinfo::MethodInfo,
380 ) -> crate::unity_engine::events::baseinvokablecall::BaseInvokableCall {
381 let __mi = Self::get_delegate_method_info();
382 let __inner: extern "C" fn(
383 ::unity::IlInstance,
384 crate::system::object::Object,
385 crate::system::reflection::methodinfo::MethodInfo,
386 ::unity::OptionalMethod,
387 ) -> crate::unity_engine::events::baseinvokablecall::BaseInvokableCall = ::core::mem::transmute(__mi.method_ptr);
388 __inner(this.into(), target, the_function, ::core::option::Option::None)
389 }
390
391 #[doc = "Direct (non-virtual) call to `UnityEventBase`'s own `ToString`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
392 pub unsafe fn to_string(this: impl ::core::convert::Into<::unity::IlInstance>) -> ::unity::Il2CppString {
393 let __mi = Self::to_string_method_info();
394 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> ::unity::Il2CppString = ::core::mem::transmute(__mi.method_ptr);
395 __inner(this.into(), ::core::option::Option::None)
396 }
397}
398
399#[cfg(feature = "unity_engine-events-unityeventbase")]
400impl UnityEventBase {
401 #[doc = "`.ctor()` — no args"]
402 pub fn new() -> Self {
403 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
404 panic!(
405 "{}
406::{}
407 failed to instantiate",
408 ::core::stringify!(UnityEventBase),
409 ::core::stringify!(new),
410 )
411 });
412 <Self as IUnityEventBaseMethods>::ctor(this);
413 this
414 }
415}
416
417#[cfg(feature = "unity_engine-events-unityeventbase")]
418#[doc(hidden)]
419pub mod prelude {
420 pub use super::{IUnityEventBase, IUnityEventBaseMethods, UnityEventBase};
421 pub use crate::system::object::IObject;
422 #[cfg(feature = "system-object")]
423 pub use crate::system::object::IObjectMethods;
424}