We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent e902a9f commit 84faf4bCopy full SHA for 84faf4b
Assets/Scripts/MonoSingleton.cs
@@ -71,7 +71,39 @@ protected virtual void Awake ()
71
}
72
73
74
+
75
+ public static void CreateInstance()
76
+ {
77
+ DestroyInstance();
78
+ instance = Instance;
79
+ }
80
81
+ public static void DestroyInstance()
82
83
+ if (instance == null) return;
84
85
+ instance.Clear();
86
+ instance = default(T);
87
88
89
+ protected void Init()
90
91
+ OnInit();
92
93
94
+ public void Clear()
95
96
+ OnClear();
97
98
99
+ protected virtual void OnInit()
100
101
102
103
+ protected virtual void OnClear()
104
105
106
107
#endregion
108
-}
109
+}
0 commit comments