Wayback Machinekoobas.hobune.stream
May JUN Jul
Previous capture 12 Next capture
2021 2022 2023
1 capture
12 Jun 22 - 12 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 /
  • Help Room /
avatar image
0
Question by Reinski · Oct 08, 2015 at 01:54 PM · c#projectide

Does Unity support linked files in the C# project?

Hi folks! I want to share some .cs class files between the server project (VS 2015 only) and the client project (Unity 5.2.1 together with MS Visual Studio Community 2015). By sharing, I mean that the according class file does physically only exist in one project, but is linked into the other project. You can achieve this in VS by adding an existing item and then select "add as link" from the dropdown of the Add-button. Unfortunately, if I link files into my Unity-project that way, they are removed again from the project by Unity.

Is there a way to tell Unity to accept such linked files when saving the project?

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

2 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by Dave-Carlile · Oct 08, 2015 at 03:03 PM

Unity regenerates the project files periodically (not completely sure under what circumstances - probably anytime anything is added or move around). I don't believe Unity supports linking like that.

You might be able to do something with a symbolic link, which is part of the OS. It will make Unity think the file physically exists in both places. The concept exists (and probably originated in) Linux as well.

I've not used them in the context of Unity, but I can't think of a reason it wouldn't work.

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 Reinski · Oct 09, 2015 at 09:20 AM

Hi Dave, thanks for your advice! I have tried using both, symbolic and hard links, but after testing for almost two hours with parallel opened Visual Studios, I have finally given up.

Here is a quick summary of my findings - hope it might be of any help to someone.

Problem is that both link types seem not to be fully tranparent when it comes to changes to the file. That means if one project modifies the real file, then the other VS-session using the link will not notice the change. I was almost expecting this for symbolic links after I saw that such a link has its own timestamp and even filetype (SYMLINK, but it's not a filename extension). But also for hard links it is almost the same, as the file-change is only communicated to observers of the link, when you highlight the link in Explorer and it then refreshes its timestamp.

Even stranger is the other direction, when the file is modified via the link: Here, the symolic link works better, and the VS using the real file noticed changes immediately. For the hard link it is the same as before: Changes are only communicated as soon as Explorer notices that the file has changed. And this doesn't seem to happen by itself, even if I waited for some minutes.

This behaviour is far from what I'd call 'reliable monitoring'. And I didn't even mention the consequences on the synchronization with my cloud-storage... ;)

My personal workaround is easy though, because only one of the projects is a Unity-project: I simply keep the files in the client project (Unity/VS) and link them into the server project (VS alone), using VS's built-in link feature. It's not the best solution, as I'd prefer to have all relevant files in the server-project, but at least it works without the danger of data-loss!

Greetings!

reinski

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

31 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 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 avatar image

Related Questions

Could someone help me with my game? 0 Answers

Why isn't my mobile single joystick showing on screen, PLEASE HELP? 1 Answer

Create a unity project that creates another unity game? 0 Answers

make a system for me 0 Answers

Unity crash, now errors and deleted objects reappeared.. 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