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 Jesse_Pixelsmith · Dec 12, 2012 at 03:57 AM · c#prefabexportdependencies

Script causing prefab export to have HUGE dependencies?

I have a script that I added to a prefab and tried to export it - but with this script on the prefab its dependencies are pretty much my whole project. No idea what's causing this, and the prefab is fine with the script removed. On a lark I made a new script with the same code and there is still a problem.

I can pick it apart and see what may be causing it, but maybe someone has run into this before?

Comment
Add comment · Show 5
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 Jesse_Pixelsmith · Dec 12, 2012 at 03:38 AM 0
Share

I guess this is happening with my C# scripts in general. I just added an empty script to a new prefab and it's trying to add all the scripts in my project as dependencies and some other stuff...

avatar image clunk47 · Dec 12, 2012 at 04:09 AM 0
Share

Post your script.

avatar image lanmay · Dec 13, 2012 at 02:30 AM 0
Share

I have the same after unity4.0, do not know how can solve this probs? I tried to delete the script folder but does not work. anyone has idea for that?

avatar image DBurke · Dec 29, 2012 at 09:26 AM 0
Share

I'm having issues with this too. I have $$anonymous$$egaFiers and Sprite $$anonymous$$anager 2 installed, and when I go to install either an object with morphs or sprite scripts attached, ALL of my scripts export with the package.

Any ideas on this? I already tried uninstalling and re-installing both $$anonymous$$F and S$$anonymous$$2 (and have emailed both developers). I think this may be a Unity issue.

Is anyone else having this problem?

avatar image SpMind · Mar 20, 2013 at 10:50 AM 0
Share

I have the same issue =( Dunno what to do. Tested in clear project. Just create emty script and when il try to export it i see many dependencies.

1 Reply

· Add your reply
  • Sort: 
avatar image
0

Answer by Bunny83 · Mar 20, 2013 at 11:40 AM

This is the normal behaviour since scripts can reference each other. Those references can't be determined by Unity. Just imagine this line:

 gameObject.AddComponent("MyAwesomeScript");

Unity don't know what scripts might be used by other scripts. All scripts are compiled into one assembly, so when you export "something" with a script attached it will always include all scripts. If you're sure a certain script isn't needed, you have to deselect it manually.

Usually when you want to export something you should take care of the dependencies yourself. For example required files from the Resources folders are not included automatically. Just select all objects you want to export and deselect "include dependencies".

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 Pangamini · Oct 07, 2013 at 05:15 AM 1
Share

So is there any way how to copy a prefab between projects, if some of the scripts referred already are in the other one? Even if i set them as dependencies, the references are missing

avatar image JonnyHilly · Jun 23, 2015 at 06:59 PM 0
Share

This 'might' be feasible IF you could un-select by folder, or shift-click batch but you can't. Unity includes pretty much the entire project listing. $$anonymous$$anually figuring out what really needs including or not is pretty much impossible and would take a very long time.

At very least, there should be an option to NOT automatically include all scripts. But that should probably be the default.

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

15 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

Related Questions

Distribute terrain in zones 3 Answers

How do I export a specific prefab into Unity package? 2 Answers

Multiple Cars not working 1 Answer

How do you save a reference to a prefab's script in a ScriptableObject? 0 Answers

Export game objects with mesh paths 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