engage/generated/root_motion/
singleton_1.rs1#[cfg(feature = "root_motion-singleton_1-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 monobehaviour::{IMonoBehaviour, MonoBehaviour},
14 object_2::{IObject_2, Object_2},
15 },
16 };
17
18 #[doc=include_str!(concat!(env!("CARGO_MANIFEST_DIR"),"/","docs/root_motion/singleton_1/Singleton_1.md"))]
19 #[::unity::class(namespace = "RootMotion", name = "Singleton`1")]
20 #[parent(crate::unity_engine::monobehaviour::MonoBehaviour)]
21 #[parent(crate::unity_engine::behaviour::Behaviour)]
22 #[parent(crate::unity_engine::component::Component)]
23 #[parent(crate::unity_engine::object_2::Object_2)]
24 #[parent(crate::system::object::Object)]
25 pub struct Singleton_1<T0: ::unity::ClassIdentity> {
26 #[static_field]
27 #[rename(name = "sInstance")]
28 pub s_instance: T0,
29 }
30}
31
32#[cfg(feature = "root_motion-singleton_1-types")]
33pub use __types::*;
34
35#[cfg(feature = "root_motion-singleton_1")]
36#[::unity::methods]
37impl<T0: ::unity::ClassIdentity> Singleton_1<T0> {
38 #[doc = "`get_instance()` overload"]
39 #[method(name = "get_instance", args = 0)]
40 pub fn get_instance() -> T0;
41
42 #[doc = "`Awake()` overload"]
43 #[method(name = "Awake", args = 0)]
44 pub fn awake(self) -> ();
45
46 #[doc = "`.ctor()` overload"]
47 #[method(name = ".ctor", args = 0)]
48 pub fn ctor(self) -> ();
49
50 #[doc = "`.cctor()` overload"]
51 #[method(name = ".cctor", args = 0)]
52 pub fn cctor() -> ();
53}
54
55#[cfg(feature = "root_motion-singleton_1")]
56impl<T0: ::unity::ClassIdentity> Singleton_1<T0> {
57 #[doc = "`.ctor()` — no args"]
58 pub fn new() -> Self {
59 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
60 panic!(
61 "{}
62::{}
63 failed to instantiate",
64 ::core::stringify!(Singleton_1),
65 ::core::stringify!(new),
66 )
67 });
68 <Self as ISingleton_1Methods<T0>>::ctor(this);
69 this
70 }
71}
72
73#[cfg(feature = "root_motion-singleton_1")]
74#[doc(hidden)]
75pub mod prelude {
76 pub use super::{ISingleton_1, ISingleton_1Methods, Singleton_1};
77 #[cfg(feature = "system-object")]
78 pub use crate::system::object::IObjectMethods;
79 #[cfg(feature = "unity_engine-behaviour")]
80 pub use crate::unity_engine::behaviour::IBehaviourMethods;
81 #[cfg(feature = "unity_engine-component")]
82 pub use crate::unity_engine::component::IComponentMethods;
83 #[cfg(feature = "unity_engine-monobehaviour")]
84 pub use crate::unity_engine::monobehaviour::IMonoBehaviourMethods;
85 #[cfg(feature = "unity_engine-object_2")]
86 pub use crate::unity_engine::object_2::IObject_2Methods;
87 pub use crate::{
88 system::object::IObject,
89 unity_engine::{behaviour::IBehaviour, component::IComponent, monobehaviour::IMonoBehaviour, object_2::IObject_2},
90 };
91}