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 AnomalusUndrdog · Apr 06, 2013 at 11:33 PM · gitversion controlmetafiles

Is it safe to share .meta files of scripts across multiple projects?

Here's my situation: I'm making a library/plugin that I'd like to be reused across many of my Unity projects.

Since I use Git as version control for all my projects, I would turn my library into a Git submodule. That means a separate Git repository for that library.

Which means the Unity .meta files of those files (C# scripts, GUI images, a Unity scene file, and fonts) will be shared on many Unity projects.

Could conflicts arise from such a thing? Even if Unity won't report any errors, would that corrupt the Library folders of my projects somehow? Take note that some of my Unity projects are in a Windows PC and some are in a Mac laptop. And I want to sync all of them properly.

Comment
Add comment · Show 2
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 Heisenbug · Jan 09, 2014 at 08:56 PM 0
Share

Nice question! I use submodules too and I was really interested in any kind of answer/solution to this question. Have you figured something out?

avatar image FunGoStudios · Jan 09, 2014 at 08:58 PM 0
Share

I've just noticed that each .meta begins with a file format version may it's safe if you use the same format across projects? Example: fileFormatVersion: 2 guid: 7a4d8e09f0554452cbc0f0b2b6e27c13 $$anonymous$$onoImporter: serializedVersion: 2 defaultReferences: [] executionOrder: 0 icon: {instanceID: 0} userData:

1 Reply

· Add your reply
  • Sort: 
avatar image
-1

Answer by Jamora · Jan 09, 2014 at 10:46 PM

The standard way (at least for me) is to

  • make a new Unity project for the library, which, in your case also syncs with git.

  • All required assets will then have to be exported into a package from the Assets menu (Assets -> Export Package). That package should be stored in Git as the 'build'.

  • Whenever you need that package in a different project, you download the Package from git and extract it into the project (using Assets -> Import Package -> Custom Pakcage).

This way, all meta data should stay intact and not cause any problems later on.

If your package consists only of code, it might be easier to just make a .dll out of it and place that into the Plugins -folder.

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 Heisenbug · Jan 10, 2014 at 09:53 AM 0
Share

This way is like not use a submodule at all, isn't it? If I can't checkout into the submodule and update the relative repo, I think I loose all the advantages of using a submodule: if I'm working on a repo A using a submodule B, if I find a bug in the submodule B I can't fix it directly from the local git repo, but I have to open the relative project, fix the bug, rebuild the package and download it again into repo A.

avatar image Jamora · Jan 10, 2014 at 12:09 PM 0
Share

No, you gain all the advantages of using a submodule; If you find a bug in your package, you fix it in one location, then release a newer version of it and everyone who was affected by the bug may download the fixed version.

According to my understanding of .meta-files as long as the relative folder structure is the same they should work. So if you force all users to download the assets from git to the same folder, say "/UnityProjectFolder/Assets/Sub$$anonymous$$odule/", there should be no problems.

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

13 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

Related Questions

Version control and Monodevelop 1 Answer

Error and conflict on meta files on repository and my pc 0 Answers

Why is ProjectSettings.asset unexpectedly modified? 2 Answers

How to maintain an iOS and Android version of the same project? 1 Answer

Import commits from Unity Collaborate to Github 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