public void LoadFromAssetBundle(CResourcePackerInfo resourcePackerInfo) { if (this.m_isAbandon) { this.m_state = enResourceState.Unload; } else { string name = this.m_name; string rename = resourcePackerInfo.GetRename(this.m_fullPathInResourcesWithoutExtension); if (!string.IsNullOrEmpty(rename)) { name = CFileManager.GetFullName(rename); } if (this.m_contentType == null) { this.m_content = resourcePackerInfo.m_assetBundle.Load(name); } else { this.m_content = resourcePackerInfo.m_assetBundle.Load(name, this.m_contentType); } this.m_state = enResourceState.Loaded; if ((this.m_content != null) && (this.m_content.GetType() == typeof(TextAsset))) { CBinaryObject obj2 = ScriptableObject.CreateInstance <CBinaryObject>(); obj2.m_data = (this.m_content as TextAsset).bytes; this.m_content = obj2; } } }
public CResource(string key, string fullPathInResources, System.Type contentType, enResourceType resourceType, bool unloadBelongedAssetBundleAfterLoaded) { this.m_key = key; this.m_fullPathInResources = fullPathInResources; this.m_fullPathInResourcesWithoutExtension = CFileManager.EraseExtension(this.m_fullPathInResources); this.m_name = CFileManager.EraseExtension(CFileManager.GetFullName(fullPathInResources)); this.m_resourceType = resourceType; this.m_state = enResourceState.Unload; this.m_contentType = contentType; this.m_unloadBelongedAssetBundleAfterLoaded = unloadBelongedAssetBundleAfterLoaded; this.m_content = null; this.m_isAbandon = false; }
public string GetAssetBundleInfoString() { if (this.m_resourcePackerInfoSet == null) { return(string.Empty); } string str = string.Empty; int num = 0; for (int i = 0; i < this.m_resourcePackerInfoSet.m_resourcePackerInfosAll.Count; i++) { if (this.m_resourcePackerInfoSet.m_resourcePackerInfosAll[i].IsAssetBundleLoaded()) { num++; str = str + CFileManager.GetFullName(this.m_resourcePackerInfoSet.m_resourcePackerInfosAll[i].m_pathInIFS); } } return(str); }
private string GetFormName(string formPath) { return(CFileManager.EraseExtension(CFileManager.GetFullName(formPath))); }