1 #region Copyright Notice & License Information
36 [AddComponentMenu (
"Hydrogen/Singletons/Input")]
37 public sealed
class hInput : Hydrogen.Peripherals.Input
52 static readonly System.Object _syncRoot =
new System.Object ();
56 static volatile hInput _staticInstance;
66 if (_staticInstance == null) {
68 _staticInstance = FindObjectOfType (typeof(
hInput)) as
hInput;
71 if (_staticInstance == null) {
72 var go = GameObject.Find (Hydrogen.Components.DefaultSingletonName) ??
73 new GameObject (Hydrogen.Components.DefaultSingletonName);
75 go.AddComponent<hInput> ();
76 _staticInstance = go.GetComponent<hInput> ();
80 return _staticInstance;
89 return _staticInstance != null;
95 protected override void Awake ()
102 DontDestroyOnLoad (gameObject);