public Resource[] GetResources() { return(m_ResourceCollection.GetResources()); }
public bool SyncToProject() { ResourceCollection resourceCollection = new ResourceCollection(); resourceCollection.OnLoadingResource += delegate(int index, int count) { if (OnLoadingResource != null) { OnLoadingResource(index, count); } }; resourceCollection.OnLoadingAsset += delegate(int index, int count) { if (OnLoadingAsset != null) { OnLoadingAsset(index, count); } }; resourceCollection.OnLoadCompleted += delegate() { if (OnCompleted != null) { OnCompleted(); } }; if (!resourceCollection.Load()) { return(false); } int assetIndex = 0; int assetCount = resourceCollection.AssetCount; Resource[] resources = resourceCollection.GetResources(); foreach (Resource resource in resources) { if (resource.IsLoadFromBinary) { continue; } Asset[] assets = resource.GetAssets(); foreach (Asset asset in assets) { AssetImporter assetImporter = AssetImporter.GetAtPath(asset.Name); if (assetImporter == null) { if (OnCompleted != null) { OnCompleted(); } return(false); } assetImporter.assetBundleName = resource.Name; assetImporter.assetBundleVariant = resource.Variant; assetImporter.SaveAndReimport(); if (OnResourceDataChanged != null) { OnResourceDataChanged(++assetIndex, assetCount, asset.Name); } } } if (OnCompleted != null) { OnCompleted(); } return(true); }