25 lines
		
	
	
		
			612 B
		
	
	
	
		
			C#
		
	
	
	
		
		
			
		
	
	
			25 lines
		
	
	
		
			612 B
		
	
	
	
		
			C#
		
	
	
	
|  | using System; | |||
|  | using System.Collections; | |||
|  | using System.Collections.Generic; | |||
|  | using UnityEngine; | |||
|  | using UObject = UnityEngine.Object; | |||
|  | 
 | |||
|  | public class ResourceManager : D_MonoSingleton<ResourceManager> | |||
|  | { | |||
|  |     private Dictionary<string, UObject> mResDic = new Dictionary<string, UObject>(); | |||
|  | 
 | |||
|  |     public T LoadRes<T>(string pPath) where T : UObject | |||
|  |     { | |||
|  |         if (!mResDic.ContainsKey(pPath)) | |||
|  |         { | |||
|  |             mResDic[pPath] = Resources.Load<T>(pPath); | |||
|  |         } | |||
|  | 
 | |||
|  |         return mResDic[pPath] as T; | |||
|  |     } | |||
|  | 
 | |||
|  |     internal GameObject LoadResource(string v) | |||
|  |     { | |||
|  |         throw new NotImplementedException(); | |||
|  |     } | |||
|  | } |