engage/generated/moon_sharp/interpreter/loaders/
unityassetsscriptloader.rs1#[cfg(feature = "moon_sharp-interpreter-loaders-unityassetsscriptloader-types")]
4mod __types {
5 #[allow(unused_imports)] use ::unity::prelude::*;
6
7 use super::*;
8 use crate::{
9 moon_sharp::interpreter::loaders::scriptloaderbase::{IScriptLoaderBase, ScriptLoaderBase},
10 system::object::{IObject, Object},
11 };
12
13 #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/moon_sharp/interpreter/loaders/unityassetsscriptloader/UnityAssetsScriptLoader.md"))]
14 #[::unity::class(namespace = "MoonSharp.Interpreter.Loaders", name = "UnityAssetsScriptLoader")]
15 #[parent(crate::moon_sharp::interpreter::loaders::scriptloaderbase::ScriptLoaderBase)]
16 pub struct UnityAssetsScriptLoader {
17 #[offset(32)]
18 #[rename(name = "m_Resources")]
19 pub m_resources: crate::system::collections::generic::dictionary_2::Dictionary_2<::unity::Il2CppString, ::unity::Il2CppString>,
20 #[static_field]
21 #[rename(name = "DEFAULT_PATH")]
22 pub default_path: ::unity::Il2CppString,
23 }
24}
25
26#[cfg(feature = "moon_sharp-interpreter-loaders-unityassetsscriptloader-types")]
27pub use __types::*;
28
29#[cfg(feature = "moon_sharp-interpreter-loaders-unityassetsscriptloader")]
30#[doc(hidden)]
31#[allow(non_snake_case, non_camel_case_types, clippy::too_many_arguments)]
32mod __UnityAssetsScriptLoader_unity_raw {
33 use super::*;
34 #[doc(hidden)]
35 #[allow(non_snake_case)]
36 pub mod __lookup_ctor {
37 use super::*;
38 static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
39 let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[<::unity::Il2CppString as ::unity::IlType>::il_type()];
40 ::unity::lookup::method_info_on_class_with_signature(
41 <UnityAssetsScriptLoader as ::unity::ClassIdentity>::class(),
42 ".ctor",
43 1,
44 param_types,
45 false,
46 )
47 });
48 pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
49 match &*METHOD {
50 ::core::result::Result::Ok(mi) => *mi,
51 ::core::result::Result::Err(e) => {
52 panic!(
53 "method lookup failed: {}
54::{}
55: {}
56",
57 <UnityAssetsScriptLoader as ::unity::ClassIdentity>::NAME,
58 ".ctor",
59 e
60 )
61 },
62 }
63 }
64 }
65 #[doc(hidden)]
66 #[allow(non_snake_case)]
67 pub mod __lookup_ctor_2 {
68 use super::*;
69 static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
70 let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[<crate::system::collections::generic::dictionary_2::Dictionary_2<
71 ::unity::Il2CppString,
72 ::unity::Il2CppString,
73 > as ::unity::IlType>::il_type()];
74 ::unity::lookup::method_info_on_class_with_signature(
75 <UnityAssetsScriptLoader as ::unity::ClassIdentity>::class(),
76 ".ctor",
77 1,
78 param_types,
79 false,
80 )
81 });
82 pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
83 match &*METHOD {
84 ::core::result::Result::Ok(mi) => *mi,
85 ::core::result::Result::Err(e) => {
86 panic!(
87 "method lookup failed: {}
88::{}
89: {}
90",
91 <UnityAssetsScriptLoader as ::unity::ClassIdentity>::NAME,
92 ".ctor",
93 e
94 )
95 },
96 }
97 }
98 }
99 #[doc(hidden)]
100 #[allow(non_snake_case)]
101 pub mod __lookup_load_resources_with_reflection {
102 use super::*;
103 static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
104 let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[<::unity::Il2CppString as ::unity::IlType>::il_type()];
105 ::unity::lookup::method_info_on_class_with_signature(
106 <UnityAssetsScriptLoader as ::unity::ClassIdentity>::class(),
107 "LoadResourcesWithReflection",
108 1,
109 param_types,
110 false,
111 )
112 });
113 pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
114 match &*METHOD {
115 ::core::result::Result::Ok(mi) => *mi,
116 ::core::result::Result::Err(e) => {
117 panic!(
118 "method lookup failed: {}
119::{}
120: {}
121",
122 <UnityAssetsScriptLoader as ::unity::ClassIdentity>::NAME,
123 "LoadResourcesWithReflection",
124 e
125 )
126 },
127 }
128 }
129 }
130 #[doc(hidden)]
131 #[allow(non_snake_case)]
132 pub mod __lookup_get_file_name {
133 use super::*;
134 static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
135 let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[<::unity::Il2CppString as ::unity::IlType>::il_type()];
136 ::unity::lookup::method_info_on_class_with_signature(
137 <UnityAssetsScriptLoader as ::unity::ClassIdentity>::class(),
138 "GetFileName",
139 1,
140 param_types,
141 false,
142 )
143 });
144 pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
145 match &*METHOD {
146 ::core::result::Result::Ok(mi) => *mi,
147 ::core::result::Result::Err(e) => {
148 panic!(
149 "method lookup failed: {}
150::{}
151: {}
152",
153 <UnityAssetsScriptLoader as ::unity::ClassIdentity>::NAME,
154 "GetFileName",
155 e
156 )
157 },
158 }
159 }
160 }
161 #[doc(hidden)]
162 #[allow(non_snake_case)]
163 pub mod __lookup_get_loaded_scripts {
164 use super::*;
165 static METHOD: ::std::sync::LazyLock<::unity::Il2CppResult<&'static ::unity::il2cpp::MethodInfo>> = ::std::sync::LazyLock::new(|| {
166 let param_types: &[&'static ::unity::il2cpp::Il2CppType] = &[];
167 ::unity::lookup::method_info_on_class_with_signature(
168 <UnityAssetsScriptLoader as ::unity::ClassIdentity>::class(),
169 "GetLoadedScripts",
170 0,
171 param_types,
172 false,
173 )
174 });
175 pub fn get_method_info() -> &'static ::unity::il2cpp::MethodInfo {
176 match &*METHOD {
177 ::core::result::Result::Ok(mi) => *mi,
178 ::core::result::Result::Err(e) => {
179 panic!(
180 "method lookup failed: {}
181::{}
182: {}
183",
184 <UnityAssetsScriptLoader as ::unity::ClassIdentity>::NAME,
185 "GetLoadedScripts",
186 e
187 )
188 },
189 }
190 }
191 }
192}
193
194#[cfg(feature = "moon_sharp-interpreter-loaders-unityassetsscriptloader")]
195pub trait IUnityAssetsScriptLoaderMethods: IUnityAssetsScriptLoader {
196 #[doc = "`.ctor(::unity::Il2CppString)` overload"]
197 fn ctor(self, assets_path: impl ::core::convert::Into<::unity::Il2CppString>) -> () {
198 unsafe {
199 let __receiver =
200 <UnityAssetsScriptLoader as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
201 ::unity::il2cpp_call!(__UnityAssetsScriptLoader_unity_raw::__lookup_ctor::get_method_info().method_ptr,();
202(UnityAssetsScriptLoader)__receiver,(::unity::Il2CppString)::core::convert::Into::into(assets_path))
203 }
204 }
205 #[doc = "`.ctor(crate::system::collections::generic::dictionary_2::Dictionary_2<::unity::Il2CppString,::unity::Il2CppString>)` overload"]
206 fn ctor_2(
207 self,
208 script_to_code_map: impl ::core::convert::Into<
209 crate::system::collections::generic::dictionary_2::Dictionary_2<::unity::Il2CppString, ::unity::Il2CppString>,
210 >,
211 ) -> () {
212 unsafe {
213 let __receiver =
214 <UnityAssetsScriptLoader as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
215 ::unity::il2cpp_call!(__UnityAssetsScriptLoader_unity_raw::__lookup_ctor_2::get_method_info().method_ptr,();
216(UnityAssetsScriptLoader)__receiver,(crate::system::collections::generic::dictionary_2::Dictionary_2< ::unity::Il2CppString, ::unity::Il2CppString>)::core::convert::Into::into(script_to_code_map))
217 }
218 }
219 #[doc = "`LoadResourcesWithReflection(::unity::Il2CppString)` overload"]
220 fn load_resources_with_reflection(self, assets_path: impl ::core::convert::Into<::unity::Il2CppString>) -> () {
221 unsafe {
222 let __receiver =
223 <UnityAssetsScriptLoader as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
224 ::unity::il2cpp_call!(__UnityAssetsScriptLoader_unity_raw::__lookup_load_resources_with_reflection::get_method_info().method_ptr,();
225(UnityAssetsScriptLoader)__receiver,(::unity::Il2CppString)::core::convert::Into::into(assets_path))
226 }
227 }
228 #[doc = "`GetFileName(::unity::Il2CppString)` overload"]
229 fn get_file_name(self, filename: impl ::core::convert::Into<::unity::Il2CppString>) -> ::unity::Il2CppString {
230 unsafe {
231 let __receiver =
232 <UnityAssetsScriptLoader as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
233 ::unity::il2cpp_call!(__UnityAssetsScriptLoader_unity_raw::__lookup_get_file_name::get_method_info().method_ptr, ::unity::Il2CppString;
234(UnityAssetsScriptLoader)__receiver,(::unity::Il2CppString)::core::convert::Into::into(filename))
235 }
236 }
237 #[doc = "`LoadFile(::unity::Il2CppString, crate::moon_sharp::interpreter::table::Table)` overload"]
238 fn load_file(
239 self,
240 file: impl ::core::convert::Into<::unity::Il2CppString>,
241 global_context: impl ::core::convert::Into<crate::moon_sharp::interpreter::table::Table>,
242 ) -> crate::system::object::Object {
243 unsafe {
244 let __receiver =
245 <UnityAssetsScriptLoader as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
246 {
247 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
248 let __vi = *__vt.get(8usize).unwrap_or_else(|| {
249 panic!(
250 "unity: virtual slot {}
251 out of range (vtable len {}
252) on the runtime class behind {}
253 (method `{}
254`)",
255 8usize,
256 __vt.len(),
257 <UnityAssetsScriptLoader as ::unity::ClassIdentity>::NAME,
258 "LoadFile",
259 )
260 });
261 let __inner: extern "C" fn(
262 UnityAssetsScriptLoader,
263 ::unity::Il2CppString,
264 crate::moon_sharp::interpreter::table::Table,
265 ::unity::OptionalMethod,
266 ) -> crate::system::object::Object = ::core::mem::transmute(__vi.method_ptr);
267 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
268 __inner(
269 __receiver,
270 ::core::convert::Into::into(file),
271 ::core::convert::Into::into(global_context),
272 __mi,
273 )
274 }
275 }
276 }
277 #[doc = "`ScriptFileExists(::unity::Il2CppString)` overload"]
278 fn script_file_exists(self, file: impl ::core::convert::Into<::unity::Il2CppString>) -> bool {
279 unsafe {
280 let __receiver =
281 <UnityAssetsScriptLoader as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
282 {
283 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
284 let __vi = *__vt.get(7usize).unwrap_or_else(|| {
285 panic!(
286 "unity: virtual slot {}
287 out of range (vtable len {}
288) on the runtime class behind {}
289 (method `{}
290`)",
291 7usize,
292 __vt.len(),
293 <UnityAssetsScriptLoader as ::unity::ClassIdentity>::NAME,
294 "ScriptFileExists",
295 )
296 });
297 let __inner: extern "C" fn(UnityAssetsScriptLoader, ::unity::Il2CppString, ::unity::OptionalMethod) -> bool =
298 ::core::mem::transmute(__vi.method_ptr);
299 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
300 __inner(__receiver, ::core::convert::Into::into(file), __mi)
301 }
302 }
303 }
304 #[doc = "`GetLoadedScripts()` overload"]
305 fn get_loaded_scripts(self) -> ::unity::Array<::unity::Il2CppString> {
306 unsafe {
307 let __receiver =
308 <UnityAssetsScriptLoader as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
309 ::unity::il2cpp_call!(__UnityAssetsScriptLoader_unity_raw::__lookup_get_loaded_scripts::get_method_info().method_ptr, ::unity::Array< ::unity::Il2CppString> ;
310(UnityAssetsScriptLoader)__receiver)
311 }
312 }
313}
314
315#[cfg(feature = "moon_sharp-interpreter-loaders-unityassetsscriptloader")]
316impl<__T: IUnityAssetsScriptLoader> IUnityAssetsScriptLoaderMethods for __T {}
317
318#[cfg(feature = "moon_sharp-interpreter-loaders-unityassetsscriptloader")]
319impl UnityAssetsScriptLoader {
320 pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
321 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
322 }
323
324 pub fn ctor_2_method_info() -> &'static ::unity::il2cpp::MethodInfo {
325 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
326 }
327
328 pub fn load_resources_with_reflection_method_info() -> &'static ::unity::il2cpp::MethodInfo {
329 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
330 }
331
332 pub fn get_file_name_method_info() -> &'static ::unity::il2cpp::MethodInfo {
333 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
334 }
335
336 pub fn load_file_method_info() -> &'static ::unity::il2cpp::MethodInfo {
337 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[4]
338 }
339
340 pub fn script_file_exists_method_info() -> &'static ::unity::il2cpp::MethodInfo {
341 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[5]
342 }
343
344 pub fn get_loaded_scripts_method_info() -> &'static ::unity::il2cpp::MethodInfo {
345 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[6]
346 }
347}
348
349#[cfg(feature = "moon_sharp-interpreter-loaders-unityassetsscriptloader")]
350impl UnityAssetsScriptLoader {
351 #[doc = "Direct (non-virtual) call to `UnityAssetsScriptLoader`'s own `LoadFile`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
352 pub unsafe fn load_file(
353 this: impl ::core::convert::Into<::unity::IlInstance>,
354 file: ::unity::Il2CppString,
355 global_context: crate::moon_sharp::interpreter::table::Table,
356 ) -> crate::system::object::Object {
357 let __mi = Self::load_file_method_info();
358 let __inner: extern "C" fn(
359 ::unity::IlInstance,
360 ::unity::Il2CppString,
361 crate::moon_sharp::interpreter::table::Table,
362 ::unity::OptionalMethod,
363 ) -> crate::system::object::Object = ::core::mem::transmute(__mi.method_ptr);
364 __inner(this.into(), file, global_context, ::core::option::Option::None)
365 }
366
367 #[doc = "Direct (non-virtual) call to `UnityAssetsScriptLoader`'s own `ScriptFileExists`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
368 pub unsafe fn script_file_exists(this: impl ::core::convert::Into<::unity::IlInstance>, file: ::unity::Il2CppString) -> bool {
369 let __mi = Self::script_file_exists_method_info();
370 let __inner: extern "C" fn(::unity::IlInstance, ::unity::Il2CppString, ::unity::OptionalMethod) -> bool =
371 ::core::mem::transmute(__mi.method_ptr);
372 __inner(this.into(), file, ::core::option::Option::None)
373 }
374}
375
376#[cfg(feature = "moon_sharp-interpreter-loaders-unityassetsscriptloader")]
377impl UnityAssetsScriptLoader {
378 #[doc = "`.ctor(::unity::Il2CppString)` — overload selector"]
379 pub fn new(assets_path: ::unity::Il2CppString) -> Self {
380 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
381 panic!(
382 "{}
383::{}
384 failed to instantiate",
385 ::core::stringify!(UnityAssetsScriptLoader),
386 ::core::stringify!(new),
387 )
388 });
389 <Self as IUnityAssetsScriptLoaderMethods>::ctor(this, assets_path);
390 this
391 }
392
393 #[doc = "`.ctor(crate::system::collections::generic::dictionary_2::Dictionary_2<::unity::Il2CppString,::unity::Il2CppString>)` — overload selector"]
394 pub fn new_2(
395 script_to_code_map: crate::system::collections::generic::dictionary_2::Dictionary_2<::unity::Il2CppString, ::unity::Il2CppString>,
396 ) -> Self {
397 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
398 panic!(
399 "{}
400::{}
401 failed to instantiate",
402 ::core::stringify!(UnityAssetsScriptLoader),
403 ::core::stringify!(new_2),
404 )
405 });
406 <Self as IUnityAssetsScriptLoaderMethods>::ctor_2(this, script_to_code_map);
407 this
408 }
409}
410
411#[cfg(feature = "moon_sharp-interpreter-loaders-unityassetsscriptloader")]
412#[doc(hidden)]
413pub mod prelude {
414 pub use super::{IUnityAssetsScriptLoader, IUnityAssetsScriptLoaderMethods, UnityAssetsScriptLoader};
415 #[cfg(feature = "moon_sharp-interpreter-loaders-scriptloaderbase")]
416 pub use crate::moon_sharp::interpreter::loaders::scriptloaderbase::IScriptLoaderBaseMethods;
417 #[cfg(feature = "system-object")]
418 pub use crate::system::object::IObjectMethods;
419 pub use crate::{moon_sharp::interpreter::loaders::scriptloaderbase::IScriptLoaderBase, system::object::IObject};
420}