18 lines
		
	
	
		
			366 B
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			18 lines
		
	
	
		
			366 B
		
	
	
	
		
			C#
		
	
	
	
|  | using UnityEngine; | |||
|  | 
 | |||
|  | public class ConfigBase<T> : ScriptableObject where T :ScriptableObject | |||
|  | { | |||
|  |     private static T mInstance; | |||
|  |     public static T Instance | |||
|  |     { | |||
|  |         get | |||
|  |         { | |||
|  |             if (mInstance == null) | |||
|  |             { | |||
|  |                 mInstance = Resources.Load<T>(typeof(T).ToString()); | |||
|  |             } | |||
|  | 
 | |||
|  |             return mInstance; | |||
|  |         } | |||
|  |     } | |||
|  | } |