• 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
0
Question by Kevin Laity · Apr 07, 2010 at 09:51 PM · assetbundle

Folders inside an AssetBundle

How can I pack an AssetBundle to include a folder structure?

Or, can I at least somehow rename an asset when I pack it, to differentiate files that came from different folders, but have the same name?

Comment
Add comment
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

3 Replies

· Add your reply
  • Sort: 
avatar image
4
Best Answer

Answer by Daniel Sperry 2 · Apr 18, 2010 at 06:53 PM

You don't, the names are flattened by default. But you may change the names inside the bundle with:

  • BuildPipeline.BuildAssetBundleExplicitAssetNames

This allows you to use names that match your folder structure. Those names may be used with AssetBundle.Load().

I have used BuildAssetBundleExplicitAssetNames to sulfix my assets (inside the bundle) with the guid that can be obtained with AssetDatabase.AssetPathToGUID.

Comment
Add comment · Share
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
-1

Answer by qJake · Apr 07, 2010 at 11:04 PM

When packaging an asset bundle, the entire folder structure is preserved 100%. Just make the directory structure is exactly the way you want it in Unity, select all the relevant files (hold Ctrl or Cmd on Mac), and then Export the asset bundle. You don't need to do anything special in terms of the folder hierarchy.

Comment
Add comment · Show 3 · Share
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 Kevin Laity · Apr 08, 2010 at 02:20 PM 0
Share

You seem to be confusing an 'asset bundle' with a 'package'. The editor doesn't have an option to make an asset bundle as far as i know. You must write your own editor script to do it. And I've tried getting unity to use a package as an asset bundle and it didn't work.

avatar image qJake · Apr 09, 2010 at 01:28 AM 0
Share

Oh... - http://unity3d.com/support/resources/example-projects/assetbundles.html - I see, this is something for the web player mainly. I thought you were talking about packages, sorry.

avatar image BerggreenDK · Jun 21, 2011 at 08:47 PM 0
Share

assets bundle exporter is a function ONLY available in the Unity PRO license. Guess why :o) if you build large games, then you can also afford to pay for the engine.

avatar image
0

Answer by lilboylost · Oct 09, 2014 at 03:19 AM

Build multiple bundles for each folder and then pack it inside one final bundle

Comment
Add comment · Share
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

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.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

How to import the object from server to unity 2 Answers

How to auto find a component inside an assembly (dll)? 0 Answers

Load scene with navmesh from asset bundle 1 Answer

apply texture on OBJ files automatically in batchmode 1 Answer

Unauthorized use of Caching API in webplayer 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