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
0
Question by Shiolle · Dec 09, 2010 at 06:23 PM · prefabassetbundleasset

Storing a part of a complex asset in an asset bundle

I have a number of models in 3d Studio Max with multiple materials per model. Additionally those objects share a number of materials between them. For example Device1 have materials 1,2,3 and 4 applied; object Device2 have materials 1 and 5 applied; and Device3 has material 4 applied.

To avoid spawning different identical materials upon importing those models in unity I import them in a single FBX file. I then have and asset with a number of children. To be able to place them separately inside a scene I create a prefab for each object (child asset). I get something like this: http://img406.imageshack.us/i/fbximport.jpg/

Now I store all materials in an asset bundle, and want to store models in different asset bundles.

The question is: if I place a prefab Device1 in an asset bundle with BuildAssetBundleOptions.CompleteAssets option, will it place the whole asset in the bundle or only the mesh that prefab is linked to? Also what sequence of push/pop dependencies should I use to achieve the right result?

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

1 Reply

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

Answer by skovacs1 · Dec 09, 2010 at 06:31 PM

See the docs which say:

For example if you pass a Mesh into the BuildPipeline.BuildAssetBundle function and use CompleteAssets it would also include the game object and any animation clips in the same asset.

Essentially CompleteAssets will include everything that is setup on the asset.

The Push/Pop dependencies to achieve "the right result" depend on what you mean by "the right result". What is the result that you desire?

Comment
Add comment · Show 6 · 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 Shiolle · Dec 10, 2010 at 10:18 AM 0
Share

"See the docs which say:" That part of the doc is what I don't get. Device1 prefab reference Device_$$anonymous$$ asset (which is a child of another asset) and a mesh Device_$$anonymous$$. If I pass Device1 prefab to BuildAssetBundleFunction with CompleteAssets will it drag the whole Devices asset or Device_$$anonymous$$ asset only?

"What is the result that you desire?" I want only Device_$$anonymous$$ asset included in the bundle when I pass Device1 prefab to BuildAssetBundle function, not Box1 or OilTank01 nor any of the materials.

avatar image skovacs1 · Dec 10, 2010 at 04:29 PM 0
Share

The problem is then not what CompleteAssets does, but the relationship between assets. If you've separated Device_$$anonymous$$ of the prefab Devices into another prefab (Device1), Device1 is now a separate asset from Devices. They may use the same shared$$anonymous$$esh or shared$$anonymous$$aterials which would be bundled with them, but bundling Device1 will not include the Devices prefab or its children as they are separate non-dependent assets. They depend on the same resources, but not on each other. Device1 has no direct connection to Devices or any of it's children.

avatar image skovacs1 · Dec 10, 2010 at 04:31 PM 0
Share

You can change all sorts of things about Devices or Device$$anonymous$$ or Device1 and with the exception of changing any shared assets, changes to one will not affect the other. You can add a script to the Device$$anonymous$$ in Devices, but the script will not be added to Device1 because they are separate.

avatar image skovacs1 · Dec 10, 2010 at 04:39 PM 0
Share

I am with you in noting where the docs are lacking and you are correct that this particular one is confusing. A $$anonymous$$esh doesn't have a GameObject to include, so the description doesn't really make sense. I believe that they were referring to a $$anonymous$$eshFilter Component or prefabs with FBXImporters or the like which would have $$anonymous$$esh and a specific GameObject to include.

avatar image Shiolle · Dec 10, 2010 at 06:23 PM 0
Share

Thank you for the answers. I think I don't fully understand the way dependencies between assets and game objects work in Unity.

Show more comments

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

No one has followed this question yet.

Related Questions

How to import the object from server to unity 2 Answers

The name 'Joystick' does not denote a valid type ('not found') 2 Answers

Copy the file from assets and paste it out side the assets folder 0 Answers

.Asset vs .Prefab vs. .Unity3d ? 1 Answer

How to create prefabs from Editor scripts? 2 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