1#[cfg(feature = "root-testsampledata-types")]
4mod __types {
5 #[allow(unused_imports)] use ::unity::prelude::*;
6
7 use super::*;
8 use crate::{
9 root::structscriptabledata_1::{IStructScriptableData_1, StructScriptableData_1},
10 system::{
11 object::{IObject, Object},
12 r#enum::{Enum, IEnum},
13 valuetype::{IValueType, ValueType},
14 },
15 };
16
17 #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/root/testsampledata/TestSampleData_Flags.md"))]
18 #[repr(C)]
19 #[derive(::core::clone::Clone, ::core::marker::Copy, ::core::fmt::Debug, ::core::cmp::PartialEq, ::core::cmp::Eq)]
20 pub struct TestSampleData_Flags {
21 pub value: i32,
22 }
23 impl ::unity::ClassIdentity for TestSampleData_Flags {
24 const NAME: &'static str = "TestSampleData.Flags";
25 const NAMESPACE: &'static str = "";
26
27 fn class() -> ::unity::Class {
28 static CACHE: ::std::sync::OnceLock<::unity::Class> = ::std::sync::OnceLock::new();
29 *CACHE.get_or_init(|| ::unity::Class::lookup(Self::NAMESPACE, Self::NAME))
30 }
31 }
32 impl ::unity::IlType for TestSampleData_Flags {
33 fn il_type() -> &'static ::unity::il2cpp::Il2CppType {
34 &<Self as ::unity::ClassIdentity>::class().raw()._1.byval_arg
35 }
36 }
37 impl TestSampleData_Flags {
38 pub fn flag_a() -> Self {
39 Self { value: 1 }
40 }
41
42 pub fn flag_b() -> Self {
43 Self { value: 2 }
44 }
45
46 pub fn flag_c() -> Self {
47 Self { value: 4 }
48 }
49
50 pub fn flag_d() -> Self {
51 Self { value: 8 }
52 }
53
54 pub fn flag_ac() -> Self {
55 Self { value: 5 }
56 }
57 }
58
59 #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/root/testsampledata/TestSampleData_Item.md"))]
60 #[::unity::class(namespace = "", name = "TestSampleData.Item")]
61 #[parent(crate::system::object::Object)]
62 pub struct TestSampleData_Item {
63 #[offset(16)]
64 #[rename(name = "Name")]
65 pub name: ::unity::Il2CppString,
66 #[offset(24)]
67 #[rename(name = "Value")]
68 pub value: i32,
69 }
70
71 #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/root/testsampledata/TestSampleData.md"))]
72 #[::unity::class(namespace = "", name = "TestSampleData")]
73 #[parent(crate::root::structscriptabledata_1::StructScriptableData_1<crate::root::testsampledata::TestSampleData>)]
74 pub struct TestSampleData {
75 #[offset(16)]
76 #[rename(name = "Pid")]
77 pub pid: ::unity::Il2CppString,
78 #[offset(24)]
79 #[rename(name = "Name")]
80 pub name: ::unity::Il2CppString,
81 #[offset(32)]
82 #[rename(name = "Level")]
83 pub level: i32,
84 #[offset(36)]
85 #[rename(name = "Hp")]
86 pub hp: i32,
87 #[offset(40)]
88 #[rename(name = "Flag")]
89 pub flag: crate::root::testsampledata::TestSampleData_Flags,
90 #[offset(48)]
91 #[rename(name = "Items")]
92 pub items: crate::system::collections::generic::list_1::List_1<crate::root::testsampledata::TestSampleData_Item>,
93 }
94}
95
96#[cfg(feature = "root-testsampledata-types")]
97pub use __types::*;
98
99#[cfg(feature = "root-testsampledata")]
100pub trait ITestSampleData_ItemMethods: ITestSampleData_Item {
101 #[doc = "`.ctor()` overload"]
102 fn ctor(self) -> () {
103 unsafe {
104 let __receiver = <TestSampleData_Item as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
105 ::unity::il2cpp_call!((::unity::module_base()+0x22044b0usize)as*mut u8,();
106(TestSampleData_Item)__receiver)
107 }
108 }
109}
110
111#[cfg(feature = "root-testsampledata")]
112impl<__T: ITestSampleData_Item> ITestSampleData_ItemMethods for __T {}
113
114#[cfg(feature = "root-testsampledata")]
115impl TestSampleData_Item {
116 pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
117 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
118 }
119}
120
121#[cfg(feature = "root-testsampledata")]
122impl TestSampleData_Item {
123 #[doc = "`.ctor()` — no args"]
124 pub fn new() -> Self {
125 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
126 panic!(
127 "{}
128::{}
129 failed to instantiate",
130 ::core::stringify!(TestSampleData_Item),
131 ::core::stringify!(new),
132 )
133 });
134 <Self as ITestSampleData_ItemMethods>::ctor(this);
135 this
136 }
137}
138
139#[cfg(feature = "root-testsampledata")]
140impl TestSampleData {
141 #[doc = "`Load()` overload"]
142 pub fn load() -> () {
143 unsafe {
144 ::unity::il2cpp_call!((::unity::module_base()+0x21e80f0usize)as*mut u8,();
145 )
146 }
147 }
148}
149
150#[cfg(feature = "root-testsampledata")]
151pub trait ITestSampleDataMethods: ITestSampleData {
152 #[doc = "`GetKey()` overload"]
153 fn get_key(self) -> ::unity::Il2CppString {
154 unsafe {
155 let __receiver = <TestSampleData as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
156 {
157 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
158 let __vi = *__vt.get(4usize).unwrap_or_else(|| {
159 panic!(
160 "unity: virtual slot {}
161 out of range (vtable len {}
162) on the runtime class behind {}
163 (method `{}
164`)",
165 4usize,
166 __vt.len(),
167 <TestSampleData as ::unity::ClassIdentity>::NAME,
168 "GetKey",
169 )
170 });
171 let __inner: extern "C" fn(TestSampleData, ::unity::OptionalMethod) -> ::unity::Il2CppString =
172 ::core::mem::transmute(__vi.method_ptr);
173 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
174 __inner(__receiver, __mi)
175 }
176 }
177 }
178 #[doc = "`OnBuild()` overload"]
179 fn on_build(self) -> () {
180 unsafe {
181 let __receiver = <TestSampleData as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
182 {
183 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
184 let __vi = *__vt.get(5usize).unwrap_or_else(|| {
185 panic!(
186 "unity: virtual slot {}
187 out of range (vtable len {}
188) on the runtime class behind {}
189 (method `{}
190`)",
191 5usize,
192 __vt.len(),
193 <TestSampleData as ::unity::ClassIdentity>::NAME,
194 "OnBuild",
195 )
196 });
197 let __inner: extern "C" fn(TestSampleData, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__vi.method_ptr);
198 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
199 __inner(__receiver, __mi)
200 }
201 }
202 }
203 #[doc = "`OnRelease()` overload"]
204 fn on_release(self) -> () {
205 unsafe {
206 let __receiver = <TestSampleData as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
207 {
208 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
209 let __vi = *__vt.get(6usize).unwrap_or_else(|| {
210 panic!(
211 "unity: virtual slot {}
212 out of range (vtable len {}
213) on the runtime class behind {}
214 (method `{}
215`)",
216 6usize,
217 __vt.len(),
218 <TestSampleData as ::unity::ClassIdentity>::NAME,
219 "OnRelease",
220 )
221 });
222 let __inner: extern "C" fn(TestSampleData, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__vi.method_ptr);
223 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
224 __inner(__receiver, __mi)
225 }
226 }
227 }
228 #[doc = "`GetDebugName()` overload"]
229 fn get_debug_name(self) -> ::unity::Il2CppString {
230 unsafe {
231 let __receiver = <TestSampleData as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
232 {
233 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
234 let __vi = *__vt.get(7usize).unwrap_or_else(|| {
235 panic!(
236 "unity: virtual slot {}
237 out of range (vtable len {}
238) on the runtime class behind {}
239 (method `{}
240`)",
241 7usize,
242 __vt.len(),
243 <TestSampleData as ::unity::ClassIdentity>::NAME,
244 "GetDebugName",
245 )
246 });
247 let __inner: extern "C" fn(TestSampleData, ::unity::OptionalMethod) -> ::unity::Il2CppString =
248 ::core::mem::transmute(__vi.method_ptr);
249 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
250 __inner(__receiver, __mi)
251 }
252 }
253 }
254 #[doc = "`.ctor()` overload"]
255 fn ctor(self) -> () {
256 unsafe {
257 let __receiver = <TestSampleData as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
258 ::unity::il2cpp_call!((::unity::module_base()+0x21e8200usize)as*mut u8,();
259(TestSampleData)__receiver)
260 }
261 }
262}
263
264#[cfg(feature = "root-testsampledata")]
265impl<__T: ITestSampleData> ITestSampleDataMethods for __T {}
266
267#[cfg(feature = "root-testsampledata")]
268impl TestSampleData {
269 pub fn get_key_method_info() -> &'static ::unity::il2cpp::MethodInfo {
270 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
271 }
272
273 pub fn on_build_method_info() -> &'static ::unity::il2cpp::MethodInfo {
274 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
275 }
276
277 pub fn on_release_method_info() -> &'static ::unity::il2cpp::MethodInfo {
278 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
279 }
280
281 pub fn get_debug_name_method_info() -> &'static ::unity::il2cpp::MethodInfo {
282 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
283 }
284
285 pub fn load_method_info() -> &'static ::unity::il2cpp::MethodInfo {
286 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[4]
287 }
288
289 pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
290 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[5]
291 }
292}
293
294#[cfg(feature = "root-testsampledata")]
295impl TestSampleData {
296 #[doc = "Direct (non-virtual) call to `TestSampleData`'s own `GetKey`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
297 pub unsafe fn get_key(this: impl ::core::convert::Into<::unity::IlInstance>) -> ::unity::Il2CppString {
298 let __mi = Self::get_key_method_info();
299 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> ::unity::Il2CppString = ::core::mem::transmute(__mi.method_ptr);
300 __inner(this.into(), ::core::option::Option::None)
301 }
302
303 #[doc = "Direct (non-virtual) call to `TestSampleData`'s own `OnBuild`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
304 pub unsafe fn on_build(this: impl ::core::convert::Into<::unity::IlInstance>) -> () {
305 let __mi = Self::on_build_method_info();
306 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__mi.method_ptr);
307 __inner(this.into(), ::core::option::Option::None)
308 }
309
310 #[doc = "Direct (non-virtual) call to `TestSampleData`'s own `OnRelease`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
311 pub unsafe fn on_release(this: impl ::core::convert::Into<::unity::IlInstance>) -> () {
312 let __mi = Self::on_release_method_info();
313 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__mi.method_ptr);
314 __inner(this.into(), ::core::option::Option::None)
315 }
316
317 #[doc = "Direct (non-virtual) call to `TestSampleData`'s own `GetDebugName`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
318 pub unsafe fn get_debug_name(this: impl ::core::convert::Into<::unity::IlInstance>) -> ::unity::Il2CppString {
319 let __mi = Self::get_debug_name_method_info();
320 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> ::unity::Il2CppString = ::core::mem::transmute(__mi.method_ptr);
321 __inner(this.into(), ::core::option::Option::None)
322 }
323}
324
325#[cfg(feature = "root-testsampledata")]
326impl TestSampleData {
327 #[doc = "`.ctor()` — no args"]
328 pub fn new() -> Self {
329 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
330 panic!(
331 "{}
332::{}
333 failed to instantiate",
334 ::core::stringify!(TestSampleData),
335 ::core::stringify!(new),
336 )
337 });
338 <Self as ITestSampleDataMethods>::ctor(this);
339 this
340 }
341}
342
343#[cfg(feature = "root-testsampledata")]
344#[doc(hidden)]
345pub mod prelude {
346 pub use super::{
347 ITestSampleData, ITestSampleDataMethods, ITestSampleData_Item, ITestSampleData_ItemMethods, TestSampleData, TestSampleData_Flags,
348 TestSampleData_Item,
349 };
350 #[cfg(feature = "root-structscriptabledata_1")]
351 pub use crate::root::structscriptabledata_1::IStructScriptableData_1Methods;
352 #[cfg(feature = "system-object")]
353 pub use crate::system::object::IObjectMethods;
354 #[cfg(feature = "system-enum")]
355 pub use crate::system::r#enum::IEnumMethods;
356 #[cfg(feature = "system-valuetype")]
357 pub use crate::system::valuetype::IValueTypeMethods;
358 pub use crate::{
359 root::structscriptabledata_1::IStructScriptableData_1,
360 system::{object::IObject, r#enum::IEnum, valuetype::IValueType},
361 };
362}