engage/generated/unity_engine/
behaviour.rs1#[cfg(feature = "unity_engine-behaviour-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 component::{Component, IComponent},
12 object_2::{IObject_2, Object_2},
13 },
14 };
15
16 #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/unity_engine/behaviour/Behaviour.md"))]
17 #[::unity::class(namespace = "UnityEngine", name = "Behaviour")]
18 #[parent(crate::unity_engine::component::Component)]
19 pub struct Behaviour {}
20}
21
22#[cfg(feature = "unity_engine-behaviour-types")]
23pub use __types::*;
24
25#[cfg(feature = "unity_engine-behaviour")]
26pub trait IBehaviourMethods: IBehaviour {
27 #[doc = "`get_enabled()` overload"]
28 fn get_enabled(self) -> bool {
29 unsafe {
30 let __receiver = <Behaviour as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
31 ::unity::il2cpp_call!((::unity::module_base()+0x2c37600usize)as*mut u8,bool;
32(Behaviour)__receiver)
33 }
34 }
35 #[doc = "`set_enabled(bool)` overload"]
36 fn set_enabled(self, value: impl ::core::convert::Into<bool>) -> () {
37 unsafe {
38 let __receiver = <Behaviour as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
39 ::unity::il2cpp_call!((::unity::module_base()+0x2c37650usize)as*mut u8,();
40(Behaviour)__receiver,(bool)::core::convert::Into::into(value))
41 }
42 }
43 #[doc = "`get_isActiveAndEnabled()` overload"]
44 fn get_is_active_and_enabled(self) -> bool {
45 unsafe {
46 let __receiver = <Behaviour as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
47 ::unity::il2cpp_call!((::unity::module_base()+0x2c376a0usize)as*mut u8,bool;
48(Behaviour)__receiver)
49 }
50 }
51 #[doc = "`.ctor()` overload"]
52 fn ctor(self) -> () {
53 unsafe {
54 let __receiver = <Behaviour as ::unity::FromIlInstance>::from_il_instance(<Self as ::unity::SystemObject>::as_instance(self));
55 ::unity::il2cpp_call!((::unity::module_base()+0x2c376f0usize)as*mut u8,();
56(Behaviour)__receiver)
57 }
58 }
59}
60
61#[cfg(feature = "unity_engine-behaviour")]
62impl<__T: IBehaviour> IBehaviourMethods for __T {}
63
64#[cfg(feature = "unity_engine-behaviour")]
65impl Behaviour {
66 pub fn get_enabled_method_info() -> &'static ::unity::il2cpp::MethodInfo {
67 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[0]
68 }
69
70 pub fn set_enabled_method_info() -> &'static ::unity::il2cpp::MethodInfo {
71 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[1]
72 }
73
74 pub fn get_is_active_and_enabled_method_info() -> &'static ::unity::il2cpp::MethodInfo {
75 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[2]
76 }
77
78 pub fn ctor_method_info() -> &'static ::unity::il2cpp::MethodInfo {
79 <Self as ::unity::ClassIdentity>::class().raw().get_methods()[3]
80 }
81}
82
83#[cfg(feature = "unity_engine-behaviour")]
84impl Behaviour {
85 #[doc = "`.ctor()` — no args"]
86 pub fn new() -> Self {
87 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
88 panic!(
89 "{}
90::{}
91 failed to instantiate",
92 ::core::stringify!(Behaviour),
93 ::core::stringify!(new),
94 )
95 });
96 <Self as IBehaviourMethods>::ctor(this);
97 this
98 }
99}
100
101#[cfg(feature = "unity_engine-behaviour")]
102#[doc(hidden)]
103pub mod prelude {
104 pub use super::{Behaviour, IBehaviour, IBehaviourMethods};
105 #[cfg(feature = "system-object")]
106 pub use crate::system::object::IObjectMethods;
107 #[cfg(feature = "unity_engine-component")]
108 pub use crate::unity_engine::component::IComponentMethods;
109 #[cfg(feature = "unity_engine-object_2")]
110 pub use crate::unity_engine::object_2::IObject_2Methods;
111 pub use crate::{
112 system::object::IObject,
113 unity_engine::{component::IComponent, object_2::IObject_2},
114 };
115}