engage/generated/unity_engine/ui/
togglegroup.rs1#[cfg(feature = "unity_engine-ui-togglegroup-types")]
4mod __types {
5 #[allow(unused_imports)] use ::unity::prelude::*;
6
7 use super::*;
8 use crate::{
9 system::object::{IObject, Object},
10 unity_engine::{
11 behaviour::{Behaviour, IBehaviour},
12 component::{Component, IComponent},
13 event_systems::uibehaviour::{IUIBehaviour, UIBehaviour},
14 monobehaviour::{IMonoBehaviour, MonoBehaviour},
15 object_2::{IObject_2, Object_2},
16 },
17 };
18
19 #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/unity_engine/ui/togglegroup/ToggleGroup.md"))]
20 #[::unity::class(namespace = "UnityEngine.UI", name = "ToggleGroup")]
21 #[parent(crate::unity_engine::event_systems::uibehaviour::UIBehaviour)]
22 pub struct ToggleGroup {
23 #[offset(24)]
24 #[rename(name = "m_AllowSwitchOff")]
25 pub m_allow_switch_off: bool,
26 #[offset(32)]
27 #[rename(name = "m_Toggles")]
28 pub m_toggles: crate::system::collections::generic::list_1::List_1<crate::unity_engine::ui::toggle::Toggle>,
29 }
30}
31
32#[cfg(feature = "unity_engine-ui-togglegroup-types")]
33pub use __types::*;
34
35#[cfg(feature = "unity_engine-ui-togglegroup")]
36pub trait IToggleGroupMethods: IToggleGroup {
37 #[doc = "`get_allowSwitchOff()` overload"]
38 fn get_allow_switch_off(self) -> bool {
39 unsafe {
40 let __receiver = <ToggleGroup as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
41 ::unity::il2cpp_call!((::unity::module_base()+0x3c090f0usize)as*mut u8,bool;
42(ToggleGroup)__receiver)
43 }
44 }
45 #[doc = "`set_allowSwitchOff(bool)` overload"]
46 fn set_allow_switch_off(self, value: impl ::core::convert::Into<bool>) -> () {
47 unsafe {
48 let __receiver = <ToggleGroup as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
49 ::unity::il2cpp_call!((::unity::module_base()+0x3c09100usize)as*mut u8,();
50(ToggleGroup)__receiver,(bool)::core::convert::Into::into(value))
51 }
52 }
53 #[doc = "`.ctor()` overload"]
54 fn ctor(self) -> () {
55 unsafe {
56 let __receiver = <ToggleGroup as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
57 ::unity::il2cpp_call!((::unity::module_base()+0x3c09110usize)as*mut u8,();
58(ToggleGroup)__receiver)
59 }
60 }
61 #[doc = "`Start()` overload"]
62 fn start(self) -> () {
63 unsafe {
64 let __receiver = <ToggleGroup as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
65 {
66 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
67 let __vi = *__vt.get(6usize).unwrap_or_else(|| {
68 panic!(
69 "unity: virtual slot {}
70 out of range (vtable len {}
71) on the runtime class behind {}
72 (method `{}
73`)",
74 6usize,
75 __vt.len(),
76 <ToggleGroup as ::unity::ClassIdentity>::NAME,
77 "Start",
78 )
79 });
80 let __inner: extern "C" fn(ToggleGroup, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__vi.method_ptr);
81 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
82 __inner(__receiver, __mi)
83 }
84 }
85 }
86 #[doc = "`OnEnable()` overload"]
87 fn on_enable(self) -> () {
88 unsafe {
89 let __receiver = <ToggleGroup as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
90 {
91 let __vt = ::unity::Cast::get_class(__receiver).raw().get_vtable();
92 let __vi = *__vt.get(5usize).unwrap_or_else(|| {
93 panic!(
94 "unity: virtual slot {}
95 out of range (vtable len {}
96) on the runtime class behind {}
97 (method `{}
98`)",
99 5usize,
100 __vt.len(),
101 <ToggleGroup as ::unity::ClassIdentity>::NAME,
102 "OnEnable",
103 )
104 });
105 let __inner: extern "C" fn(ToggleGroup, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__vi.method_ptr);
106 let __mi: ::unity::OptionalMethod = ::core::option::Option::Some(&*(__vi.method_info as *const ::unity::MethodInfo as *const ()));
107 __inner(__receiver, __mi)
108 }
109 }
110 }
111 #[doc = "`ValidateToggleIsInGroup(crate::unity_engine::ui::toggle::Toggle)` overload"]
112 fn validate_toggle_is_in_group(self, toggle: impl ::core::convert::Into<crate::unity_engine::ui::toggle::Toggle>) -> () {
113 unsafe {
114 let __receiver = <ToggleGroup as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
115 ::unity::il2cpp_call!((::unity::module_base()+0x3c091f0usize)as*mut u8,();
116(ToggleGroup)__receiver,(crate::unity_engine::ui::toggle::Toggle)::core::convert::Into::into(toggle))
117 }
118 }
119 #[doc = "`NotifyToggleOn(crate::unity_engine::ui::toggle::Toggle, bool)` overload"]
120 fn notify_toggle_on(
121 self,
122 toggle: impl ::core::convert::Into<crate::unity_engine::ui::toggle::Toggle>,
123 send_callback: impl ::core::convert::Into<bool>,
124 ) -> () {
125 unsafe {
126 let __receiver = <ToggleGroup as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
127 ::unity::il2cpp_call!((::unity::module_base()+0x3c08b60usize)as*mut u8,();
128(ToggleGroup)__receiver,(crate::unity_engine::ui::toggle::Toggle)::core::convert::Into::into(toggle),(bool)::core::convert::Into::into(send_callback))
129 }
130 }
131 #[doc = "`UnregisterToggle(crate::unity_engine::ui::toggle::Toggle)` overload"]
132 fn unregister_toggle(self, toggle: impl ::core::convert::Into<crate::unity_engine::ui::toggle::Toggle>) -> () {
133 unsafe {
134 let __receiver = <ToggleGroup as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
135 ::unity::il2cpp_call!((::unity::module_base()+0x3c08a20usize)as*mut u8,();
136(ToggleGroup)__receiver,(crate::unity_engine::ui::toggle::Toggle)::core::convert::Into::into(toggle))
137 }
138 }
139 #[doc = "`RegisterToggle(crate::unity_engine::ui::toggle::Toggle)` overload"]
140 fn register_toggle(self, toggle: impl ::core::convert::Into<crate::unity_engine::ui::toggle::Toggle>) -> () {
141 unsafe {
142 let __receiver = <ToggleGroup as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
143 ::unity::il2cpp_call!((::unity::module_base()+0x3c08ac0usize)as*mut u8,();
144(ToggleGroup)__receiver,(crate::unity_engine::ui::toggle::Toggle)::core::convert::Into::into(toggle))
145 }
146 }
147 #[doc = "`EnsureValidState()` overload"]
148 fn ensure_valid_state(self) -> () {
149 unsafe {
150 let __receiver = <ToggleGroup as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
151 ::unity::il2cpp_call!((::unity::module_base()+0x3c08250usize)as*mut u8,();
152(ToggleGroup)__receiver)
153 }
154 }
155 #[doc = "`AnyTogglesOn()` overload"]
156 fn any_toggles_on(self) -> bool {
157 unsafe {
158 let __receiver = <ToggleGroup as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
159 ::unity::il2cpp_call!((::unity::module_base()+0x3c08d60usize)as*mut u8,bool;
160(ToggleGroup)__receiver)
161 }
162 }
163 #[doc = "`ActiveToggles()` overload"]
164 fn active_toggles(self) -> crate::system::collections::generic::ienumerable_1::IEnumerable_1<crate::unity_engine::ui::toggle::Toggle> {
165 unsafe {
166 let __receiver = <ToggleGroup as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
167 ::unity::il2cpp_call!((::unity::module_base()+0x3c09340usize)as*mut u8,crate::system::collections::generic::ienumerable_1::IEnumerable_1<crate::unity_engine::ui::toggle::Toggle> ;
168(ToggleGroup)__receiver)
169 }
170 }
171 #[doc = "`GetFirstActiveToggle()` overload"]
172 fn get_first_active_toggle(self) -> crate::unity_engine::ui::toggle::Toggle {
173 unsafe {
174 let __receiver = <ToggleGroup as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
175 ::unity::il2cpp_call!((::unity::module_base()+0x3c09470usize)as*mut u8,crate::unity_engine::ui::toggle::Toggle;
176(ToggleGroup)__receiver)
177 }
178 }
179 #[doc = "`SetAllTogglesOff(bool)` overload"]
180 fn set_all_toggles_off(self, send_callback: impl ::core::convert::Into<bool>) -> () {
181 unsafe {
182 let __receiver = <ToggleGroup as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
183 ::unity::il2cpp_call!((::unity::module_base()+0x3c09510usize)as*mut u8,();
184(ToggleGroup)__receiver,(bool)::core::convert::Into::into(send_callback))
185 }
186 }
187}
188
189#[cfg(feature = "unity_engine-ui-togglegroup")]
190impl<__T: IToggleGroup> IToggleGroupMethods for __T {}
191
192#[cfg(feature = "unity_engine-ui-togglegroup")]
193impl ToggleGroup {
194 pub fn get_allow_switch_off_method_info() -> &'static ::unity::il2cpp::MethodInfo {
195 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
196 }
197
198 pub fn set_allow_switch_off_method_info() -> &'static ::unity::il2cpp::MethodInfo {
199 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
200 }
201
202 pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
203 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
204 }
205
206 pub fn start_method_info() -> &'static ::unity::il2cpp::MethodInfo {
207 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
208 }
209
210 pub fn on_enable_method_info() -> &'static ::unity::il2cpp::MethodInfo {
211 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[4]
212 }
213
214 pub fn validate_toggle_is_in_group_method_info() -> &'static ::unity::il2cpp::MethodInfo {
215 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[5]
216 }
217
218 pub fn notify_toggle_on_method_info() -> &'static ::unity::il2cpp::MethodInfo {
219 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[6]
220 }
221
222 pub fn unregister_toggle_method_info() -> &'static ::unity::il2cpp::MethodInfo {
223 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[7]
224 }
225
226 pub fn register_toggle_method_info() -> &'static ::unity::il2cpp::MethodInfo {
227 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[8]
228 }
229
230 pub fn ensure_valid_state_method_info() -> &'static ::unity::il2cpp::MethodInfo {
231 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[9]
232 }
233
234 pub fn any_toggles_on_method_info() -> &'static ::unity::il2cpp::MethodInfo {
235 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[10]
236 }
237
238 pub fn active_toggles_method_info() -> &'static ::unity::il2cpp::MethodInfo {
239 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[11]
240 }
241
242 pub fn get_first_active_toggle_method_info() -> &'static ::unity::il2cpp::MethodInfo {
243 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[12]
244 }
245
246 pub fn set_all_toggles_off_method_info() -> &'static ::unity::il2cpp::MethodInfo {
247 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[13]
248 }
249}
250
251#[cfg(feature = "unity_engine-ui-togglegroup")]
252impl ToggleGroup {
253 #[doc = "Direct (non-virtual) call to `ToggleGroup`'s own `Start`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
254 pub unsafe fn start(this: impl ::core::convert::Into<::unity::IlInstance>) -> () {
255 let __mi = Self::start_method_info();
256 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__mi.method_ptr);
257 __inner(this.into(), ::core::option::Option::None)
258 }
259
260 #[doc = "Direct (non-virtual) call to `ToggleGroup`'s own `OnEnable`. Bypasses the vtable, so it won't hit an override/patch — use it for base calls."]
261 pub unsafe fn on_enable(this: impl ::core::convert::Into<::unity::IlInstance>) -> () {
262 let __mi = Self::on_enable_method_info();
263 let __inner: extern "C" fn(::unity::IlInstance, ::unity::OptionalMethod) -> () = ::core::mem::transmute(__mi.method_ptr);
264 __inner(this.into(), ::core::option::Option::None)
265 }
266}
267
268#[cfg(feature = "unity_engine-ui-togglegroup")]
269impl ToggleGroup {
270 #[doc = "`.ctor()` — no args"]
271 pub fn new() -> Self {
272 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
273 panic!(
274 "{}
275::{}
276 failed to instantiate",
277 ::core::stringify!(ToggleGroup),
278 ::core::stringify!(new),
279 )
280 });
281 <Self as IToggleGroupMethods>::ctor(this);
282 this
283 }
284}
285
286#[cfg(feature = "unity_engine-ui-togglegroup")]
287#[doc(hidden)]
288pub mod prelude {
289 pub use super::{IToggleGroup, IToggleGroupMethods, ToggleGroup};
290 #[cfg(feature = "system-object")]
291 pub use crate::system::object::IObjectMethods;
292 #[cfg(feature = "unity_engine-behaviour")]
293 pub use crate::unity_engine::behaviour::IBehaviourMethods;
294 #[cfg(feature = "unity_engine-component")]
295 pub use crate::unity_engine::component::IComponentMethods;
296 #[cfg(feature = "unity_engine-event_systems-uibehaviour")]
297 pub use crate::unity_engine::event_systems::uibehaviour::IUIBehaviourMethods;
298 #[cfg(feature = "unity_engine-monobehaviour")]
299 pub use crate::unity_engine::monobehaviour::IMonoBehaviourMethods;
300 #[cfg(feature = "unity_engine-object_2")]
301 pub use crate::unity_engine::object_2::IObject_2Methods;
302 pub use crate::{
303 system::object::IObject,
304 unity_engine::{
305 behaviour::IBehaviour, component::IComponent, event_systems::uibehaviour::IUIBehaviour, monobehaviour::IMonoBehaviour,
306 object_2::IObject_2,
307 },
308 };
309}