diff options
author | chai <chaifix@163.com> | 2022-03-10 14:07:40 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2022-03-10 14:07:40 +0800 |
commit | 22891bf59032ba88262824255a706d652031384b (patch) | |
tree | 7595439ba9966c9402d37e37cee5e8cf098757d5 /Assets/Scripts/Utils/Singleton.cs | |
parent | 8b04ea73e540067f83870b61d89db4868fea5e8a (diff) |
* move folder
Diffstat (limited to 'Assets/Scripts/Utils/Singleton.cs')
-rw-r--r-- | Assets/Scripts/Utils/Singleton.cs | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/Assets/Scripts/Utils/Singleton.cs b/Assets/Scripts/Utils/Singleton.cs deleted file mode 100644 index a882238a..00000000 --- a/Assets/Scripts/Utils/Singleton.cs +++ /dev/null @@ -1,35 +0,0 @@ -using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-using System;
-
-public class SingletonMB<T> : MonoBehaviour where T : class
-{
- protected static T s_Instance;
- public static T Instance
- {
- get { return s_Instance; }
- }
-
- protected virtual void Awake()
- {
- s_Instance = gameObject.GetComponent(typeof(T)) as T;
- }
-
-}
-
-public class Singleton<T> where T : class, new()
-{
- private static T _instance;
-
- public static T Instance
- {
- get
- {
- if (_instance == null)
- _instance = Activator.CreateInstance<T>();
- return _instance;
- }
- }
-}
\ No newline at end of file |