From 22891bf59032ba88262824255a706d652031384b Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 10 Mar 2022 14:07:40 +0800 Subject: * move folder --- Assets/Scripts/Utils/Singleton.cs | 35 ----------------------------------- 1 file changed, 35 deletions(-) delete mode 100644 Assets/Scripts/Utils/Singleton.cs (limited to 'Assets/Scripts/Utils/Singleton.cs') 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 : 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 where T : class, new() -{ - private static T _instance; - - public static T Instance - { - get - { - if (_instance == null) - _instance = Activator.CreateInstance(); - return _instance; - } - } -} \ No newline at end of file -- cgit v1.1-26-g67d0