private static UIAtlas CreateAtlas(BUNDLELIST bundleList, string aAtlasPath, string aPrefabName) { #if ASSET_BUNDLE GameObject bundleObj = ResourceBundle.intance.ResourceObject(bundleList, aPrefabName, typeof(GameObject)) as GameObject; if (bundleObj == null) { #if DEBUG_LOG Debug.LogError(string.Format(" === ERROR ATALS {0} PREFAB NAME = {1}", bundleList.ToString(), aPrefabName)); #endif return(null); } UIAtlas atlas = bundleObj.GetComponent <UIAtlas>(); if (atlas == null) { #if DEBUG_LOG Debug.LogError("=== ATLAS NULL"); #endif return(null); } return(atlas); #else return(Resources.Load(ResourcePathInfo.intance.GetResourcePathInfo(bundleList, string.Format("{0}{1}", aAtlasPath, aPrefabName)), typeof(UIAtlas)) as UIAtlas); #endif }
//================================================================================== // // 에셋 번들 로드 // //================================================================================== public static GameObject CreatePrefab(BUNDLELIST bundleList, Transform aParentTrs, string aPrefabName, SetTransformType TransformType = SetTransformType.OriginValue) { #if ASSET_BUNDLE GameObject resultObj = ResourceBundle.intance.ResourceObject(bundleList, aPrefabName, typeof(GameObject)) as GameObject; #else GameObject resultObj = Resources.Load(ResourcePathInfo.intance.GetResourcePathInfo(bundleList, aPrefabName)) as GameObject; #endif if (resultObj == null) { #if DEBUG_LOG Debug.LogError(string.Format("error CreatePrefab --- bundleList : {0}", bundleList.ToString())); Debug.LogError(string.Format("error CreatePrefab --- aParentTrs : {0}", aParentTrs.name)); Debug.LogError(string.Format("error CreatePrefab --- aPrefabName : {0}", aPrefabName)); #endif return(null); } resultObj = InstantiateGameObject(resultObj, aParentTrs, TransformType, aPrefabName); return(resultObj); }
// Instantiate 하지 않은 프리팹로딩. public static GameObject CreateDefaultPrefab(BUNDLELIST bundleList, string aPrefabName) { #if ASSET_BUNDLE GameObject resultObj = ResourceBundle.intance.ResourceObject(bundleList, aPrefabName, typeof(GameObject)) as GameObject; #else GameObject resultObj = Resources.Load(ResourcePathInfo.intance.GetResourcePathInfo(bundleList, aPrefabName)) as GameObject; #endif if (resultObj == null) { #if DEBUG_LOG Debug.LogError(string.Format(" === ERR CreateDefaultPrefab BUNDLE NAME {0} PREFAB NAME{1}", bundleList.ToString(), aPrefabName)); #endif return(null); } #if ASSET_BUNDLE ReLinkAtlas(resultObj); #endif return(resultObj); }