engage/generated/unity_engine/resource_management/util/
componentsingleton_1_2.rs1#[cfg(feature = "unity_engine-resource_management-util-componentsingleton_1_2-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/unity_engine/resource_management/util/componentsingleton_1_2/ComponentSingleton_1_2.md"))]
19 #[::unity::class(namespace = "UnityEngine.ResourceManagement.Util", name = "ComponentSingleton`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 ComponentSingleton_1_2<T0: ::unity::ClassIdentity> {
26 #[static_field]
27 #[rename(name = "s_Instance")]
28 pub s_instance: T0,
29 }
30}
31
32#[cfg(feature = "unity_engine-resource_management-util-componentsingleton_1_2-types")]
33pub use __types::*;
34
35#[cfg(feature = "unity_engine-resource_management-util-componentsingleton_1_2")]
36#[::unity::methods]
37impl<T0: ::unity::ClassIdentity> ComponentSingleton_1_2<T0> {
38 #[doc = "`get_Exists()` overload"]
39 #[method(name = "get_Exists", args = 0)]
40 pub fn get_exists() -> bool;
41
42 #[doc = "`get_Instance()` overload"]
43 #[method(name = "get_Instance", args = 0)]
44 pub fn get_instance() -> T0;
45
46 #[doc = "`FindInstance()` overload"]
47 #[method(name = "FindInstance", args = 0)]
48 pub fn find_instance() -> T0;
49
50 #[doc = "`GetGameObjectName()` overload"]
51 #[method(name = "GetGameObjectName", args = 0)]
52 pub fn get_game_object_name(self) -> ::unity::Il2CppString;
53
54 #[doc = "`CreateNewSingleton()` overload"]
55 #[method(name = "CreateNewSingleton", args = 0)]
56 pub fn create_new_singleton() -> T0;
57
58 #[doc = "`Awake()` overload"]
59 #[method(name = "Awake", args = 0)]
60 pub fn awake(self) -> ();
61
62 #[doc = "`DestroySingleton()` overload"]
63 #[method(name = "DestroySingleton", args = 0)]
64 pub fn destroy_singleton() -> ();
65
66 #[doc = "`.ctor()` overload"]
67 #[method(name = ".ctor", args = 0)]
68 pub fn ctor(self) -> ();
69}
70
71#[cfg(feature = "unity_engine-resource_management-util-componentsingleton_1_2")]
72impl<T0: ::unity::ClassIdentity> ComponentSingleton_1_2<T0> {
73 #[doc = "`.ctor()` — no args"]
74 pub fn new() -> Self {
75 let this = <Self as ::unity::FromIlInstance>::instantiate().unwrap_or_else(|| {
76 panic!(
77 "{}
78::{}
79 failed to instantiate",
80 ::core::stringify!(ComponentSingleton_1_2),
81 ::core::stringify!(new),
82 )
83 });
84 <Self as IComponentSingleton_1_2Methods<T0>>::ctor(this);
85 this
86 }
87}
88
89#[cfg(feature = "unity_engine-resource_management-util-componentsingleton_1_2")]
90#[doc(hidden)]
91pub mod prelude {
92 pub use super::{ComponentSingleton_1_2, IComponentSingleton_1_2, IComponentSingleton_1_2Methods};
93 #[cfg(feature = "system-object")]
94 pub use crate::system::object::IObjectMethods;
95 #[cfg(feature = "unity_engine-behaviour")]
96 pub use crate::unity_engine::behaviour::IBehaviourMethods;
97 #[cfg(feature = "unity_engine-component")]
98 pub use crate::unity_engine::component::IComponentMethods;
99 #[cfg(feature = "unity_engine-monobehaviour")]
100 pub use crate::unity_engine::monobehaviour::IMonoBehaviourMethods;
101 #[cfg(feature = "unity_engine-object_2")]
102 pub use crate::unity_engine::object_2::IObject_2Methods;
103 pub use crate::{
104 system::object::IObject,
105 unity_engine::{behaviour::IBehaviour, component::IComponent, monobehaviour::IMonoBehaviour, object_2::IObject_2},
106 };
107}