23 lines
		
	
	
		
			576 B
		
	
	
	
		
			C#
		
	
	
	
			
		
		
	
	
			23 lines
		
	
	
		
			576 B
		
	
	
	
		
			C#
		
	
	
	
| using System;
 | |
| using System.Collections;
 | |
| using System.Collections.Generic;
 | |
| using UnityEngine;
 | |
| using UObject = UnityEngine.Object;
 | |
| 
 | |
| namespace MMO
 | |
| {
 | |
|     public class MMOResourceManager : MMOSingleton<MMOResourceManager>
 | |
|     {
 | |
|         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;
 | |
|         }
 | |
|     }
 | |
| } |