public Object LoadResource(string objectName, System.Action <Object> afterLoadAct = null) { LocalResInfo resInfo = LoadFromFileOrCache(objectName); Object obj = resInfo.localRes; if (afterLoadAct != null) { afterLoadAct(obj); } return(obj); }
private LocalResInfo LoadFromFileOrCache(string prefabName) { if (assetInfoList.ContainsKey(prefabName)) { return(assetInfoList[prefabName]); } else { LocalResInfo newInfo = new LocalResInfo(prefabName); assetInfoList.Add(prefabName, newInfo); UnloadAsset(); return(newInfo); } }