Skip to main content

engage/generated/unity_engine/scene_management/
scenemanagerapi.rs

1// @generated by il2cpp-bindgen — do not edit by hand.
2
3#[cfg(feature = "unity_engine-scene_management-scenemanagerapi-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/scene_management/scenemanagerapi/SceneManagerAPI.md"))]
11    #[::unity::class(namespace = "UnityEngine.SceneManagement", name = "SceneManagerAPI")]
12    #[parent(crate::system::object::Object)]
13    pub struct SceneManagerAPI {
14        #[static_field]
15        #[rename(name = "s_DefaultAPI")]
16        pub s_default_api: crate::unity_engine::scene_management::scenemanagerapi::SceneManagerAPI,
17    }
18}
19
20#[cfg(feature = "unity_engine-scene_management-scenemanagerapi-types")]
21pub use __types::*;
22
23#[cfg(feature = "unity_engine-scene_management-scenemanagerapi")]
24impl SceneManagerAPI {
25    #[doc = "`get_ActiveAPI()` overload"]
26    pub fn get_active_api() -> crate::unity_engine::scene_management::scenemanagerapi::SceneManagerAPI {
27        unsafe {
28            ::unity::il2cpp_call!((::unity::module_base()+0x2f8a9f0usize)as*mut u8,crate::unity_engine::scene_management::scenemanagerapi::SceneManagerAPI;
29            )
30        }
31    }
32
33    #[doc = "`get_overrideAPI()` overload"]
34    pub fn get_override_api() -> crate::unity_engine::scene_management::scenemanagerapi::SceneManagerAPI {
35        unsafe {
36            ::unity::il2cpp_call!((::unity::module_base()+0x2f8b6d0usize)as*mut u8,crate::unity_engine::scene_management::scenemanagerapi::SceneManagerAPI;
37            )
38        }
39    }
40
41    #[doc = "`.cctor()` overload"]
42    pub fn cctor() -> () {
43        unsafe {
44            ::unity::il2cpp_call!((::unity::module_base()+0x2f8b840usize)as*mut u8,();
45            )
46        }
47    }
48}
49
50#[cfg(feature = "unity_engine-scene_management-scenemanagerapi")]
51pub trait ISceneManagerAPIMethods: ISceneManagerAPI {
52    #[doc = "`.ctor()` overload"]
53    fn ctor(self) -> () {
54        unsafe {
55            let __receiver = <SceneManagerAPI as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
56            ::unity::il2cpp_call!((::unity::module_base()+0x2f8b740usize)as*mut u8,();
57(SceneManagerAPI)__receiver)
58        }
59    }
60    #[doc = "`LoadSceneAsyncByNameOrIndex(::unity::Il2CppString, i32, crate::unity_engine::scene_management::loadsceneparameters::LoadSceneParameters, bool)` overload"]
61    fn load_scene_async_by_name_or_index(
62        self,
63        scene_name: impl ::core::convert::Into<::unity::Il2CppString>,
64        scene_build_index: impl ::core::convert::Into<i32>,
65        parameters: impl ::core::convert::Into<crate::unity_engine::scene_management::loadsceneparameters::LoadSceneParameters>,
66        must_complete_next_frame: impl ::core::convert::Into<bool>,
67    ) -> crate::unity_engine::asyncoperation::AsyncOperation {
68        unsafe {
69            let __receiver = <SceneManagerAPI as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
70            {
71                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
72                let __vi = *__vt.get(4usize).unwrap_or_else(|| {
73                    panic!(
74                        "unity: virtual slot {}
75 out of range (vtable len {}
76) on the runtime class behind {}
77 (method `{}
78`)",
79                        4usize,
80                        __vt.len(),
81                        <SceneManagerAPI as ::unity::ClassIdentity>::NAME,
82                        "LoadSceneAsyncByNameOrIndex",
83                    )
84                });
85                let __inner: extern "C" fn(
86                    SceneManagerAPI,
87                    ::unity::Il2CppString,
88                    i32,
89                    crate::unity_engine::scene_management::loadsceneparameters::LoadSceneParameters,
90                    bool,
91                    ::unity::OptionalMethod,
92                ) -> crate::unity_engine::asyncoperation::AsyncOperation = ::core::mem::transmute(__vi.method_ptr);
93                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
94                __inner(
95                    __receiver,
96                    ::core::convert::Into::into(scene_name),
97                    ::core::convert::Into::into(scene_build_index),
98                    ::core::convert::Into::into(parameters),
99                    ::core::convert::Into::into(must_complete_next_frame),
100                    __mi,
101                )
102            }
103        }
104    }
105    #[doc = "`LoadFirstScene(bool)` overload"]
106    fn load_first_scene(self, must_load_async: impl ::core::convert::Into<bool>) -> crate::unity_engine::asyncoperation::AsyncOperation {
107        unsafe {
108            let __receiver = <SceneManagerAPI as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
109            {
110                let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
111                let __vi = *__vt.get(5usize).unwrap_or_else(|| {
112                    panic!(
113                        "unity: virtual slot {}
114 out of range (vtable len {}
115) on the runtime class behind {}
116 (method `{}
117`)",
118                        5usize,
119                        __vt.len(),
120                        <SceneManagerAPI as ::unity::ClassIdentity>::NAME,
121                        "LoadFirstScene",
122                    )
123                });
124                let __inner: extern "C" fn(SceneManagerAPI, bool, ::unity::OptionalMethod) -> crate::unity_engine::asyncoperation::AsyncOperation =
125                    ::core::mem::transmute(__vi.method_ptr);
126                let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
127                __inner(__receiver, ::core::convert::Into::into(must_load_async), __mi)
128            }
129        }
130    }
131}
132
133#[cfg(feature = "unity_engine-scene_management-scenemanagerapi")]
134impl<__T: ISceneManagerAPI> ISceneManagerAPIMethods for __T {}
135
136#[cfg(feature = "unity_engine-scene_management-scenemanagerapi")]
137impl SceneManagerAPI {
138    pub fn get_active_api_method_info() -> &'static ::unity::il2cpp::MethodInfo {
139        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
140    }
141
142    pub fn get_override_api_method_info() -> &'static ::unity::il2cpp::MethodInfo {
143        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
144    }
145
146    pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
147        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
148    }
149
150    pub fn load_scene_async_by_name_or_index_method_info() -> &'static ::unity::il2cpp::MethodInfo {
151        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
152    }
153
154    pub fn load_first_scene_method_info() -> &'static ::unity::il2cpp::MethodInfo {
155        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[4]
156    }
157
158    pub fn cctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
159        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[5]
160    }
161}
162
163#[cfg(feature = "unity_engine-scene_management-scenemanagerapi")]
164impl SceneManagerAPI {
165    #[doc = "Direct (non-virtual) call to `SceneManagerAPI`'s own `LoadSceneAsyncByNameOrIndex`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
166    pub unsafe fn load_scene_async_by_name_or_index(
167        this: impl ::core::convert::Into<::unity::IlInstance>,
168        scene_name: ::unity::Il2CppString,
169        scene_build_index: i32,
170        parameters: crate::unity_engine::scene_management::loadsceneparameters::LoadSceneParameters,
171        must_complete_next_frame: bool,
172    ) -> crate::unity_engine::asyncoperation::AsyncOperation {
173        let __mi = Self::load_scene_async_by_name_or_index_method_info();
174        let __inner: extern "C" fn(
175            ::unity::IlInstance,
176            ::unity::Il2CppString,
177            i32,
178            crate::unity_engine::scene_management::loadsceneparameters::LoadSceneParameters,
179            bool,
180            ::unity::OptionalMethod,
181        ) -> crate::unity_engine::asyncoperation::AsyncOperation = ::core::mem::transmute(__mi.method_ptr);
182        __inner(
183            this.into(),
184            scene_name,
185            scene_build_index,
186            parameters,
187            must_complete_next_frame,
188            ::core::option::Option::None,
189        )
190    }
191
192    #[doc = "Direct (non-virtual) call to `SceneManagerAPI`'s own `LoadFirstScene`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
193    pub unsafe fn load_first_scene(
194        this: impl ::core::convert::Into<::unity::IlInstance>,
195        must_load_async: bool,
196    ) -> crate::unity_engine::asyncoperation::AsyncOperation {
197        let __mi = Self::load_first_scene_method_info();
198        let __inner: extern "C" fn(::unity::IlInstance, bool, ::unity::OptionalMethod) -> crate::unity_engine::asyncoperation::AsyncOperation =
199            ::core::mem::transmute(__mi.method_ptr);
200        __inner(this.into(), must_load_async, ::core::option::Option::None)
201    }
202}
203
204#[cfg(feature = "unity_engine-scene_management-scenemanagerapi")]
205impl SceneManagerAPI {
206    #[doc = "`.ctor()` — no args"]
207    pub fn new() -> Self {
208        let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
209            panic!(
210                "{}
211::{}
212 failed to instantiate",
213                ::core::stringify!(SceneManagerAPI),
214                ::core::stringify!(new),
215            )
216        });
217        <Self as ISceneManagerAPIMethods>::ctor(this);
218        this
219    }
220}
221
222#[cfg(feature = "unity_engine-scene_management-scenemanagerapi")]
223#[doc(hidden)]
224pub mod prelude {
225    pub use super::{ISceneManagerAPI, ISceneManagerAPIMethods, SceneManagerAPI};
226    pub use crate::system::object::IObject;
227    #[cfg(feature = "system-object")]
228    pub use crate::system::object::IObjectMethods;
229}