Skip to main content

engage/generated/unity_engine/
guilayoutoption.rs

1// @generated by il2cpp-bindgen — do not edit by hand.
2
3#[cfg(feature = "unity_engine-guilayoutoption-types")]
4mod __types {
5    #[allow(unused_imports)] use ::unity::prelude::*;
6
7    use super::*;
8    use crate::system::{
9        object::{IObject, Object},
10        r#enum::{Enum, IEnum},
11        valuetype::{IValueType, ValueType},
12    };
13
14    #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/unity_engine/guilayoutoption/GUILayoutOption.md"))]
15    #[::unity::class(namespace = "UnityEngine", name = "GUILayoutOption")]
16    #[parent(crate::system::object::Object)]
17    pub struct GUILayoutOption {
18        #[offset(16)]
19        #[rename(name = "type")]
20        pub r#type: crate::unity_engine::guilayoutoption::GUILayoutOption_Type,
21        #[offset(24)]
22        #[rename(name = "value")]
23        pub value: ::unity::IlInstance,
24    }
25
26    #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/unity_engine/guilayoutoption/GUILayoutOption_Type.md"))]
27    #[repr(C)]
28    #[derive(::core::clone::Clone, ::core::marker::Copy, ::core::fmt::Debug, ::core::cmp::PartialEq, ::core::cmp::Eq)]
29    pub struct GUILayoutOption_Type {
30        pub value: i32,
31    }
32    impl ::unity::ClassIdentity for GUILayoutOption_Type {
33        const NAME: &'static str = "GUILayoutOption.Type";
34        const NAMESPACE: &'static str = "UnityEngine";
35
36        fn class() -> ::unity::Class {
37            static CACHE: ::std::sync::OnceLock<::unity::Class> = ::std::sync::OnceLock::new();
38            *CACHE.get_or_init(|| ::unity::Class::lookup(Self::NAMESPACE, Self::NAME))
39        }
40    }
41    impl ::unity::IlType for GUILayoutOption_Type {
42        fn il_type() -> &'static ::unity::il2cpp::Il2CppType {
43            &<Self as ::unity::ClassIdentity>::class().raw()._1.byval_arg
44        }
45    }
46    impl GUILayoutOption_Type {
47        pub fn fixed_width() -> Self {
48            Self { value: 0 }
49        }
50
51        pub fn fixed_height() -> Self {
52            Self { value: 1 }
53        }
54
55        pub fn min_width() -> Self {
56            Self { value: 2 }
57        }
58
59        pub fn max_width() -> Self {
60            Self { value: 3 }
61        }
62
63        pub fn min_height() -> Self {
64            Self { value: 4 }
65        }
66
67        pub fn max_height() -> Self {
68            Self { value: 5 }
69        }
70
71        pub fn stretch_width() -> Self {
72            Self { value: 6 }
73        }
74
75        pub fn stretch_height() -> Self {
76            Self { value: 7 }
77        }
78
79        pub fn align_start() -> Self {
80            Self { value: 8 }
81        }
82
83        pub fn align_middle() -> Self {
84            Self { value: 9 }
85        }
86
87        pub fn align_end() -> Self {
88            Self { value: 10 }
89        }
90
91        pub fn align_justify() -> Self {
92            Self { value: 11 }
93        }
94
95        pub fn equal_size() -> Self {
96            Self { value: 12 }
97        }
98
99        pub fn spacing() -> Self {
100            Self { value: 13 }
101        }
102    }
103}
104
105#[cfg(feature = "unity_engine-guilayoutoption-types")]
106pub use __types::*;
107
108#[cfg(feature = "unity_engine-guilayoutoption")]
109pub trait IGUILayoutOptionMethods: IGUILayoutOption {
110    #[doc = "`.ctor(crate::unity_engine::guilayoutoption::GUILayoutOption_Type, crate::system::object::Object)` overload"]
111    fn ctor(
112        self,
113        r#type: impl ::core::convert::Into<crate::unity_engine::guilayoutoption::GUILayoutOption_Type>,
114        value: impl ::core::convert::Into<crate::system::object::Object>,
115    ) -> () {
116        unsafe {
117            let __receiver = <GUILayoutOption as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
118            ::unity::il2cpp_call!((::unity::module_base()+0x3c457f0usize)as*mut u8,();
119(GUILayoutOption)__receiver,(crate::unity_engine::guilayoutoption::GUILayoutOption_Type)::core::convert::Into::into(r#type),(crate::system::object::Object)::core::convert::Into::into(value))
120        }
121    }
122}
123
124#[cfg(feature = "unity_engine-guilayoutoption")]
125impl<__T: IGUILayoutOption> IGUILayoutOptionMethods for __T {}
126
127#[cfg(feature = "unity_engine-guilayoutoption")]
128impl GUILayoutOption {
129    pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
130        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
131    }
132}
133
134#[cfg(feature = "unity_engine-guilayoutoption")]
135impl GUILayoutOption {
136    #[doc = "`.ctor(crate::unity_engine::guilayoutoption::GUILayoutOption_Type, crate::system::object::Object)` — overload selector"]
137    pub fn new(r#type: crate::unity_engine::guilayoutoption::GUILayoutOption_Type, value: crate::system::object::Object) -> Self {
138        let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
139            panic!(
140                "{}
141::{}
142 failed to instantiate",
143                ::core::stringify!(GUILayoutOption),
144                ::core::stringify!(new),
145            )
146        });
147        <Self as IGUILayoutOptionMethods>::ctor(this, r#type, value);
148        this
149    }
150}
151
152#[cfg(feature = "unity_engine-guilayoutoption")]
153#[doc(hidden)]
154pub mod prelude {
155    pub use super::{GUILayoutOption, GUILayoutOption_Type, IGUILayoutOption, IGUILayoutOptionMethods};
156    #[cfg(feature = "system-object")]
157    pub use crate::system::object::IObjectMethods;
158    #[cfg(feature = "system-enum")]
159    pub use crate::system::r#enum::IEnumMethods;
160    #[cfg(feature = "system-valuetype")]
161    pub use crate::system::valuetype::IValueTypeMethods;
162    pub use crate::system::{object::IObject, r#enum::IEnum, valuetype::IValueType};
163}