JetBrains / resharper-unity

Unity support for both ReSharper and Rider
Apache License 2.0
1.21k stars 134 forks source link

Please make sync moving files in the rider with the unity metafiles #61

Closed van800 closed 7 years ago

van800 commented 8 years ago

This feature is present in the MonoDevelop as separated plugin and in the VS by default.

Scripts linking drops from prefabs after moving files inside rider.

issue moved from https://github.com/JetBrains/Unity3dRider/issues/17

citizenmatt commented 8 years ago

Hi @Dukobpa3. Could you provide some more details, please? Is this the same as #56, renaming/moving linked .meta files?

dukobpa3 commented 8 years ago

I think yes. It is duplicated tasks. The magic is in the guid inside metafile. Linking to gameObject provided by this guid.

You should:

  1. Rename both metafile and class to the same name (and move it to the same path if needed)
  2. Keep guid and don't change it after moving|renaming classes|interfaces|other_files
  3. Maybe something else like fix new path inside metafile, etc. But if you will keep name and guid - then Unity will fix it itself after reimporting this files.

We are using text serialization of metafiles in our projects and it seems like not big deal. But I don't know how it works with binary serialization(which enabled by default).

sindrijo commented 8 years ago

Metafiles are always text based (yaml), even when Asset Serialization is set to Force Binary

citizenmatt commented 7 years ago

See details on #56