void Start() { // We just copy and paste files, so you don't have to do it manually. CopyPasteFoldersAndPNG(Application.dataPath + "/RuntimeSpriteSheetsGenerator/Demos/Sprites", Application.persistentDataPath); string[] files = Directory.GetFiles(Application.persistentDataPath + "/Textures", "*.png"); assetPacker = GetComponent <AssetPacker>(); assetPacker.OnProcessCompleted.AddListener(LaunchAnimations); assetPacker.AddTexturesToPack(files); assetPacker.Process(); }
void OnResourceLoadingComplete() { foreach (var imageInfo in imagesToPack) { Texture2D texture = GetTextureFromLoadedResources(imageInfo.Key, resourcesDictionary); if (texture) { assetPacker.AddTextureToPack(texture, imageInfo.Value, imageInfo.Key); } } progressText.text = "Packing Textures..."; assetPacker.OnProcessCompleted.AddListener(OnTexturePackingComplete); assetPacker.Process(); }