コード例 #1
0
        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);
        }
コード例 #2
0
 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);
     }
 }