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
2
Question by spadesmaster · Oct 13, 2011 at 09:01 PM · filesprojectsshared

Sharing scripts and prefabs between Unity projects

We are using Kiln (similar to Git) with External Version Control and Unity Pro. We have several shared components that we want shared across several of our Unity projects. We would like to be able to edit the shared components in any of the projects and have it update in all of our games.

Examples:

  1. Prefabs\Card.prefab

  2. Resources\Cards.png

  3. Scripts\Messenger.cs

As suggested in other threads, I have already tried:

  1. Yes, we have external version control turned on and know what files go where. No issues with that.

  2. Kiln does not allow a shared subdirectory inside one project to be inside another (at least not that I can figure out).

  3. Symlinks seemed a logical choice, but MonoDevelop on Windows does not seem to open symlinked files (Visual Studio and Unity handle them fine). I have also seen posts about Unity for Mac having issues with symlinks and our current continuous integration Mac build server seems to be freaking about the links.

If we share prefabs, etc. will Unity allow the sharing of the GUIDs, etc. in the .Meta files or will we run into issues if Developer A edits the shared files via Project A and later Developer B edits those SAME shared files via Project B?

Thanks, Christopher

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
0

Answer by spadesmaster · Mar 02, 2012 at 07:38 PM

Since no one ever answered my question, I will share what we are doing. We are using symlinked shared folders to share assets between projects on Windows. We eventually found a way to hard link directories on the Mac which worked as Unity 3.5 STILL does not honor symbolic directory links on Mac.

There is also a helpful trick for automating the #define settings on a per-project basis as well that we found useful and I will try to writeup when I get a chance.

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 Altemia · Sep 21, 2012 at 01:22 PM 0
Share

I'm unsure how to message people using the unity system, but I hope this message will reach you. Have you written up the trick for automating #defines across multiple projects and scripts? What was the means by which you hard linked directories on mac and would it be possible for you to explain how you symlinked your folders?

avatar image spadesmaster · Sep 25, 2012 at 04:45 AM 0
Share

We 'precompile' our projects to add the #defines at the top of our shared files that require it. To switch projects we first run our Perl script. I will attach the Perl script we use. It ain't pretty, but it works well for us. Renamed from .pl to .txt so it would allow the upload. Hope it helps!

avatar image
0

Answer by spadesmaster · Sep 25, 2012 at 04:45 AM

link text

We 'precompile' our projects to add the #defines at the top of our shared files that require it. To switch projects we first run our Perl script. I will attach the Perl script we use. It ain't pretty, but it works well for us. Renamed from .pl to .txt so it would allow the upload. Hope it helps!


cspp.pl.txt (4.8 kB)
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
0

Answer by eventropy · May 29, 2016 at 07:51 PM

You could also try Projeny - a free open source framework that addresses this problem for both assets and scripts (using symlinks)

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

5 People are following this question.

avatar image avatar image avatar image avatar image avatar image

Related Questions

How can I use another drive(for example D: instead of default C:) to create and open projects with Unity Hub??? 0 Answers

Download Files 2 Answers

A way copy my extra files to the Build? 2 Answers

Build settings: how to export files into the build 1 Answer

How to copy Files external to Game application to Application.dataPath 1 Answer


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