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 Rasly · Sep 24, 2014 at 02:32 AM · editor

Cross project scripting?

How can i use one script file in two projects? So that if i change this file in one project, it should be changed in another as well.

Thanks in advance.

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 drastick · Sep 24, 2014 at 03:53 AM

I've put a bit of thought into this as I have some scripts that need to be shared between projects. The setup is really going to depend how you handle source control and what platform you are on.

Option 1: Your shared files belong to a root source control and you remap them into the project directories. When you check in your work and sync in the other project you will get and merge changes.

Option 2: On windows development I sometimes use sync/linked folders. I like this shell extension tool, it adds a lot of support to do such things. http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html You could specify your script folder that shared the file between two locations. By editing in one project it would manipulate the result seen in both locations.

Option 3: Possibly a hybrid approach of 1 and 2 or go for an advanced source control branching structure that works for your team size. My main concerns with sharing files is that changes to one project should not impact the stability of another. If your source control is setup where the core is in a main line and each project branches the results then the projects can work independently and then reintegration back to the main line. Then the other project carefully pulls in these changes. This will probably work better for larger teams. If it is just you then maybe you are more comfortable option 2 because it becomes less integration maintenance work.

Whatever solution you decide I recommend the best one that is going to keep your shared file synchronized in a manor that you can "afford" to maintain. Don't over do the branching source control if it is too much it becomes much much of a burden that you end up never keeping them synced. Where on the other hand also avoid deviating functionality systems too far that you fail to maintain stability in both projects.

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

3 People are following this question.

avatar image avatar image avatar image

Related Questions

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

Permanent handles (when object is not selected) 1 Answer

Check if a script is running in editor or game 2 Answers

Determining which Asset is connected to a GameObject. 3 Answers

Why does Assembly-CSharp reference UnityEditor.dll 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