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 kou · Feb 12, 2013 at 12:51 PM · asset storepackagemanagerasset bundles

How to upload dll using package manager?

When I try to upload my extension using Package manager, I get the alert in the console that "Asset bundles can not include Editor Objects (DefaultAsset): Assets/mydll.dll"

I wonder why I am getting this message and how to overcome it, Thank you

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

Answer by hoy_smallfry · Feb 12, 2013 at 11:23 PM

Class libraries cannot be part of an Asset Bundle, partially because its a security risk to inject code onto your application from the internet (viruses, anyone?). The other reason is that the whole Asset Bundle mechanism mirrors what happens to non-script assets when you build them with a player - when you build, scripts become .dll files, and non-scripts become .asset files.

You could tackle this in one of two ways:

1) Leave the assembly as a part of the project; Don't worry, all your prefabs that link with the library classes will still properly link.

2) If your class library does not have any MonoBehaviour scripts, then it is possible to stream it from an website using the method AngryAnt used in his experiment Downloading the Hydra. This only works with libraries that don't have MonoBehaviours (or, more specifically, classes in the library that aren't MonoBehaviours), because all assets Unity refers to in serialized files have to be registered with the AssetDatabase in order for them to be properly referenced when deserialization happens. The whole thing AngryAnt does in his demo goes outside of the registry, and as far as I know, Unity doesn't provide a direct way to dynamically register assets with the database (aside from whatever happens inside AssetBundle functions).

It's frustrating, yes, but hopefully that clears it up for you.

Comment
Add comment · Show 2 · 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 Bunny83 · Feb 12, 2013 at 11:46 PM 1
Share

You're basically right and i posted almost the same answer a couple of times ;) However it actually is possible to load assemblies with $$anonymous$$onoBehaviours at runtime. The important part is that the DLL must not use any namespace.

Usually when you build a DLL it uses it's own namespace. When you simply add a dll with a namespace into your project, Unity will "extract" all $$anonymous$$onoBehaviours it can find inside the DLL. However when loading the assembly manually this doesn't happen. So just remove the namespace from your DLL ;) I've managed to load $$anonymous$$onoBehaviours even within a webplayer ;) However that way with Unity 3.4 i guess. I haven't tried something like that recently. Since Unity4 "kind of" supports namespaces maybe something has changed now, but can't say for sure.

avatar image hoy_smallfry · Feb 12, 2013 at 11:49 PM 0
Share

Thank you for the correction. Tag $$anonymous$$m!

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

12 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

Related Questions

Is there a way to prevent certain Asset elements from being included in a unity package? 0 Answers

Unity does not start - package manager error 0 Answers

Can't see "My Registries" window after i implement Firebase Scoped Registry! 0 Answers

Could not read from encrypted package file. [Trying to use asset store] 0 Answers

Package Manager Connect Erorr 2019.3 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