void OnLoadedCfgFile(AssetCat assetCat) { string className = "CsCat.Cfg" + Path.GetFileNameWithoutExtension(assetCat.assetPath).UpperFirstLetter(); string jsonContent = assetCat.Get <TextAsset>().text; TypeUtil.GetType(className).GetPropertyValue("Instance").InvokeMethod("Parse", false, jsonContent); loadedCount++; }
void OnLoadedCfgFilePaths(AssetCat assetCat) { string fileContent = assetCat.Get <TextAsset>().text; fileContent = fileContent.Replace("\r", ""); string[] filePaths = fileContent.Split('\n'); loadedCount = 0; totalCount = filePaths.Length; for (var i = 0; i < filePaths.Length; i++) { var filePath = filePaths[i]; resLoadComponent.GetOrLoadAsset(filePath, OnLoadedCfgFile); } }
public virtual void OnAllAssetsLoadDone() { if (!prefabPath.IsNullOrWhiteSpace()) { GameObject prefab = prefabAssetCat.Get <GameObject>(); GameObject clone = InstantiateGameObject(prefab); clone.name = prefab.name; clone.transform.CopyFrom(prefab.transform); SetGameObject(clone, null); } if (this.parentTransform != null) { SetParentTransform(this.parentTransform); } }