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 Anon · Mar 17, 2011 at 03:49 AM · dllmonobehaviourdistribution

Prefabs not finding MonoBehaviours moved into a plugin DLL

"From 3.0 you can use monobehaviours from dlls. The dll need to be added to any folder named Plugins inside the Assets folder.

Once there you can use the Project window at the Unity Editor to explore the DLL contents and drag and drop the monobehavior into any game object.

It works just fine!"

Well, not exactly fine... I have a lot of prefabs with various scripts as components attached to them, and none of them switch to finding the MonoBehaviour scripts that I moved to a DLL even though I can see the scripts in the assets browser (with a different icon than the ones with source code available). I was looking to set someone up for level editing without giving them everything including the script code, and this seemed like it might've worked. But it's a lot of work to go through every prefab and correctly update the monobehaviours to point to the new location in the dll. Can this be fixed in the future? Is there a workaround to programatically get the prefabs finding the scripts when they're moved to DLLs?

Comment
Add comment · Show 4
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 · Mar 17, 2011 at 04:33 AM 0
Share

Well, managed code dlls don't have to be in the plugin folder. Just place them somewhere inside "Assets" just like a script file. Your problem is that the script assets are gone and the $$anonymous$$onoBehaviours inside the dll (from Unity's view) are completely new assets. Unity uses a hash to keep up the linkage. When Unity open the project and the old asset is gone Unity can't remember anything about the asset except that it was a $$anonymous$$onoScript. Unfortunately at the moment there is now way to retrieve the class-name that was inside the script. At least i guess. $$anonymous$$aybe we'll get an update one day.

avatar image yoyo · Mar 17, 2011 at 05:02 AM 0
Share

What happens if you have both the script and the dll present at once -- is it possible to write an editor script that will go through all the prefabs and convert the script reference to a dll reference?

avatar image benbonso · Feb 20, 2013 at 05:33 AM 0
Share

Nobody knows how to fix it?

avatar image Steven-Walker · May 14, 2013 at 11:38 PM 0
Share

I have the same problem. In the past when I converted scripts from UnityScript to C# I was able to use meta files to search and replace the GUIDs so Unity would find the new scripts. However it appears that DLLs only get one GUID, so there isn't a way to set the GUIDs for all the scripts it contains. If anybody knows how to fix this, please post an answer!

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Steven-Walker · May 15, 2013 at 12:32 AM

I found an answer to this problem, though it is fairly complicated and requires a lot of work. I haven't done this yet myself, but it looks promising. See the link below, part 3. Basically, it requires building a table to remap file and guids from the old loose scripts to the DLL and search-replacing meta and text files throughout the project. So each project would have to be done separately.

http://forum.unity3d.com/threads/148078-Reducing-script-compile-time-or-a-better-workflow-to-reduce-excessive-recompiling?p=1026639&viewfull=1#post1026639

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.

Follow this Question

Answers Answers and Comments

2 People are following this question.

avatar image avatar image

Related Questions

Monobehaviours & Editors with Inheritance across DLL boundaries don't load into Unity 2 Answers

Is there a way to hide a dll MonoBehaviour, or disallow adding it? 1 Answer

Adding new code to built client 0 Answers

How to instantiate a MonoBehaviour from a downloaded DLL at runtime? 0 Answers

Can I distribute Unity's DLL with an open source project? 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