Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 13 Next capture
2021 2022 2023
1 capture
13 Jun 22 - 13 Jun 22
sparklines
Close Help
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
avatar image
1
Question by Robert-Castle · Mar 02, 2015 at 06:37 PM · bundlesprite packerbundles

SpritePacker not working on bundles

Hi,

In the editor my sprites are packed. But when I build an asset bundle, the same sprites in the bundle are not packed.

I have a system that builds 3 sets of bundles for different platforms (iOS, Android, OSX). It automatically switches platform, builds the bundle then moves on to the next. I never see the packing progress bar.

Is there anything I need to do in my scripts to get the sprites to be packed?

  • I am using Unity Pro 4.6.1 on OSX

  • I am using the Cache Server

  • In the Editor Settings I have set the sprite packer mode to "Always Enabled". I have also tried "Enable For Build", with the same result.

  • Everything about my asset bundle is working, except the packing.

  • I am building my bundle like this:

           BuildAssetBundleOptions buildOptions = BuildAssetBundleOptions.CollectDependencies | BuildAssetBundleOptions.CompleteAssets;
             bool success = BuildPipeline.BuildAssetBundle(manifest, 
                                                           bundleObjects.ToArray(), 
                                                           Path.Combine(bundleDirectory, bundleName), 
                                                           out crc, 
                                                           buildOptions, 
                                                           target);
    
Comment
Add comment · Show 3
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image SentreStage · Jul 13, 2015 at 03:40 AM 0
Share

Any luck with this? I know this post is a few months old, but I'm having a similar issue and there doesnt seem to be many resources availabe on the internet for dealing with Sprites in AssetBundles for 4.6.. everything is pointing to Unity 5 for this now because of the new AssetBundle system.

Would love to know if you got this figured out and how you managed to load a sprite of a Texture2D with Sprite's option set to multiple from an assetbundle.

avatar image Robert-Castle · Jul 14, 2015 at 07:55 AM 1
Share

I never found a reliable solution. The issue seemed to related to memory usage. With very small bundles I could created them for all 3 platforms and they would all be packed. For the rest, I could get the first packed and built correctly. It was then significantly less likely to work for the 2nd platform, and always failed on the 3rd if it got that far. So in the end I had to manually switch targets and build the bundles for that target.

If you would like to see the skeleton code I used to pack up sprites into asset bundles let me know and I will post.

avatar image SentreStage · Jul 21, 2015 at 04:20 AM 0
Share

I ended up writing a solution that worked for me. Had to manually add all the sprites, AND the texture. Still haven't tested if this works with packed sprites or not, but I think it might. So the details of my solution were to grab all of the sprites as Sprite objects, and the texture as Texture2D, and put them all into the bundle as separate objects.

You can post your skeleton code if you like, I'd love to compare.

0 Replies

· Add your reply
  • Sort: 

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this Question

Answers Answers and Comments

21 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

Can I know if the current scene has been loaded from bundle? 0 Answers

EditorSceneManager.OpenScene & AssetBundle 0 Answers

Best practices for updating/adding content with Addressables bundles 0 Answers

The AssetBundle can't be loaded because another AssetBundle with the same files is already loaded. 1 Answer

Bundle Cache Size 0 Answers


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges