Skip to main content

engage/generated/unity_engine/
contextmenuitemattribute.rs

1// @generated by il2cpp-bindgen — do not edit by hand.
2
3#[cfg(feature = "unity_engine-contextmenuitemattribute-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::propertyattribute::{IPropertyAttribute, PropertyAttribute},
11    };
12
13    #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/unity_engine/contextmenuitemattribute/ContextMenuItemAttribute.md"))]
14    #[::unity::class(namespace = "UnityEngine", name = "ContextMenuItemAttribute")]
15    #[parent(crate::unity_engine::propertyattribute::PropertyAttribute)]
16    pub struct ContextMenuItemAttribute {
17        #[offset(16)]
18        #[rename(name = "name")]
19        pub name: ::unity::Il2CppString,
20        #[offset(24)]
21        #[rename(name = "function")]
22        pub function: ::unity::Il2CppString,
23    }
24}
25
26#[cfg(feature = "unity_engine-contextmenuitemattribute-types")]
27pub use __types::*;
28
29#[cfg(feature = "unity_engine-contextmenuitemattribute")]
30pub trait IContextMenuItemAttributeMethods: IContextMenuItemAttribute {
31    #[doc = "`.ctor(::unity::Il2CppString, ::unity::Il2CppString)` overload"]
32    fn ctor(self, name: impl ::core::convert::Into<::unity::Il2CppString>, function: impl ::core::convert::Into<::unity::Il2CppString>) -> () {
33        unsafe {
34            let __receiver =
35                <ContextMenuItemAttribute as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
36            ::unity::il2cpp_call!((::unity::module_base()+0x2c47390usize)as*mut u8,();
37(ContextMenuItemAttribute)__receiver,(::unity::Il2CppString)::core::convert::Into::into(name),(::unity::Il2CppString)::core::convert::Into::into(function))
38        }
39    }
40}
41
42#[cfg(feature = "unity_engine-contextmenuitemattribute")]
43impl<__T: IContextMenuItemAttribute> IContextMenuItemAttributeMethods for __T {}
44
45#[cfg(feature = "unity_engine-contextmenuitemattribute")]
46impl ContextMenuItemAttribute {
47    pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
48        <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
49    }
50}
51
52#[cfg(feature = "unity_engine-contextmenuitemattribute")]
53impl ContextMenuItemAttribute {
54    #[doc = "`.ctor(::unity::Il2CppString, ::unity::Il2CppString)` — overload selector"]
55    pub fn new(name: ::unity::Il2CppString, function: ::unity::Il2CppString) -> Self {
56        let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
57            panic!(
58                "{}
59::{}
60 failed to instantiate",
61                ::core::stringify!(ContextMenuItemAttribute),
62                ::core::stringify!(new),
63            )
64        });
65        <Self as IContextMenuItemAttributeMethods>::ctor(this, name, function);
66        this
67    }
68}
69
70#[cfg(feature = "unity_engine-contextmenuitemattribute")]
71#[doc(hidden)]
72pub mod prelude {
73    pub use super::{ContextMenuItemAttribute, IContextMenuItemAttribute, IContextMenuItemAttributeMethods};
74    #[cfg(feature = "system-object")]
75    pub use crate::system::object::IObjectMethods;
76    #[cfg(feature = "unity_engine-propertyattribute")]
77    pub use crate::unity_engine::propertyattribute::IPropertyAttributeMethods;
78    pub use crate::{system::object::IObject, unity_engine::propertyattribute::IPropertyAttribute};
79}