Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Unity の meta ファイルの過不足の merge を防止しよう / How to prevent missing or dangling meta files

151a0b14f5914e786e2e104cfb3a9b2f?s=47 Kuniwak
March 24, 2021

Unity の meta ファイルの過不足の merge を防止しよう / How to prevent missing or dangling meta files

Gotanda.unity #17 sponsored by 株式会社キッズスター 2021/3/24
https://meetup.unity3d.jp/jp/events/1279

151a0b14f5914e786e2e104cfb3a9b2f?s=128

Kuniwak

March 24, 2021
Tweet

Transcript

  1. 6OJUZͷNFUBϑΝΠϧͷ աෆ଍Λ๷ࢭ͠Α͏ Kuniwak - DeNA Co.,Ltd. 2021.03.24 Gotanda.unity #17

  2. ෼ؒͰ఻͍͑ͨ͜ͱ

  3. 6OJUZͰॏཁͳNFUBϑΝΠϧͷաෆ଍Λ ετϨεͳ͘ݟ͚ͭΔπʔϧ͸͍͔͕Ͱ͔͢ 3 ఻͍͑ͨ͜ͱ

  4. 6OJUZͰॏཁͳNFUBϑΝΠϧͷաෆ଍Λ ετϨεͳ͘ݟ͚ͭΔπʔϧ͸͍͔͕Ͱ͔͢ 4 ·ͣ͜ΕΛղઆ ఻͍͑ͨ͜ͱ

  5. NFUBϑΝΠϧͱ͸

  6. 6 NFUBϑΝΠϧ͸Ξηοτͷϝλ৘ใ͕ه࿥͞ΕͨϑΝΠϧ IUUQTEPDTVOJUZEDPN%PDVNFOUBUJPO.BOVBM"TTFU8PSLqPXIUNM fileFormatVersion: 2 guid: 96e963ca667b44… TextureImporter: internalIDToNameTa externalObjects:

    {} serializedVersion: mipmaps: mipMapMode: 0 … ը૾ΞηοτΛ JNQPSU ରԠ͢ΔNFUBϑΝΠϧ͕ ࣗಈੜ੒͞ΕΔ 6OJUZͷΠϯεϖΫλ͔Β ͍͡ΕΔ TBNQMFQOH TBNQMFQOHNFUB
  7. 6OJUZͰॏཁͳNFUBϑΝΠϧͷաෆ଍Λ ετϨεͳ͘ݟ͚ͭΔπʔϧ͸͍͔͕Ͱ͔͢ 7 ͜͜·Ͱ͸0, ఻͍͑ͨ͜ͱ

  8. 6OJUZͰॏཁͳNFUBϑΝΠϧͷաෆ଍Λ ετϨεͳ͘ݟ͚ͭΔπʔϧ͸͍͔͕Ͱ͔͢ 8 Կ͕ى͜Δͷ͔ ఻͍͑ͨ͜ͱ

  9. NFUBϑΝΠϧաෆ଍ͷᜁΓ

  10. NFUBϑΝΠϧΛ DPNNJU͠๨ΕΔ όάΔ͔΋ NFUBϑΝΠϧΛ ফ͠๨ΕΔ ࡞ۀͷअຐ

  11. NFUBϑΝΠϧΛ DPNNJU͠๨ΕΔ όάΔ͔΋ NFUBϑΝΠϧΛ ফ͠๨ΕΔ ࡞ۀͷअຐ

  12. 12 NFUBϑΝΠϧͷDPNNJU๨Ε͸όάͷݪҼʹͳΔ TBNQMFNBUʢϚςϦΞϧʣ TBNQMFQOHʢςΫενϟʣ TBNQMFQOHNFUB fileFormatVersion: 2 guid: 96e963ca667b44… TextureImporter:

    ... ςΫενϟͷࢀর ϚςϦΞϧ͔Β ςΫενϟΛ ࢀর͍ͨ͠
  13. 13 NFUBϑΝΠϧͷDPNNJU๨Ε͸όάͷݪҼʹͳΔ TBNQMFNBUʢϚςϦΞϧʣ TBNQMFQOHʢςΫενϟʣ TBNQMFQOHNFUB fileFormatVersion: 2 guid: 96e963ca667b44… TextureImporter:

    ... NFUB಺ͷ(6*%Λࢀর ࣮ମ ը૾ͷNFUBʹ ॻ͔Εͨ(6*%͕ ϚςϦΞϧଆʹ ॻ͔ΕͯΔ͜ͱͰ ࣮ݱ͞Ε͍ͯΔ
  14. 14 NFUBϑΝΠϧͷDPNNJU๨Ε͸όάͷݪҼʹͳΔ TBNQMFNBUʢϚςϦΞϧʣ TBNQMFQOHʢςΫενϟʣ TBNQMFQOHNFUBʢผ෺ʣ fileFormatVersion: 2 guid: 96e963ca667b44… TextureImporter:

    ... NFUB಺ͷ(6*%Λࢀর ࣮ମ ΋͠NFUBϑΝΠϧΛ DPNNJU͠๨ΕΔͱɺ ผͷਓͷ؀ڥͩͱ ผͷNFUBϑΝΠϧ͕ ࣗಈੜ੒͞Εͯ͠·͏
  15. 15 NFUBϑΝΠϧͷDPNNJU๨Ε͸όάͷݪҼʹͳΔ TBNQMFNBUʢϚςϦΞϧʣ TBNQMFQOHʢςΫενϟʣ TBNQMFQOHNFUBʢผ෺ʣ fileFormatVersion: 2 guid: 96e963ca667b44… TextureImporter:

    ... NFUB಺ͷ(6*%Λࢀর ࣮ମ ผͷNFUBʹ͸ผͷ (6*%͕ৼΒΕΔͷͰ ࢀর͕੾ΕΔ
  16. 16 NFUBϑΝΠϧͷDPNNJU๨Ε͸όάͷݪҼʹͳΔ TBNQMFNBUʢϚςϦΞϧʣ TBNQMFQOHʢςΫενϟʣ TBNQMFQOHNFUBʢผ෺ʣ fileFormatVersion: 2 guid: 96e963ca667b44… TextureImporter:

    ... NFUB಺ͷ(6*%Λࢀর ࣮ମ ςΫενϟͷࢀর ݁ՌతʹϚςϦΞϧ͸ ςΫενϟΛࢀর Ͱ͖ͳ͘ͳͬͯόάΔ
  17. NFUBϑΝΠϧΛ DPNNJU͠๨ΕΔ όάΔ͔΋ NFUBϑΝΠϧΛ ফ͠๨ΕΔ ࡞ۀͷअຐ

  18. NFUBϑΝΠϧΛফ͠๨ΕΔͱ खݩͰຖ౓ؔ܎ͳ͍ࠩ෼͕ग़ͯ͏͍͟

  19. 6OJUZͰॏཁͳNFUBϑΝΠϧͷաෆ଍Λ ετϨεͳ͘ݟ͚ͭΔπʔϧ͸͍͔͕Ͱ͔͢ 19 ΍͹͍͠͏͍͟ ఻͍͑ͨ͜ͱ

  20. 20 ͔͠͠ɺͨͼͨͼNFUBϑΝΠϧͷ աෆ଍͕ຖ೔ൃੜ͍ͯͨ͠ ͦ͜ͰNFUBϑΝΠϧͷաෆ଍Λ໷ͳ໷ͳ ௚͢༯ਫ਼͞Μ͕஀ੜͨ͠ͱ͍͏ʜ

  21. ͦ͜Ͱ༯ਫ਼͞ΜΛۤߦ͔Βղ์͢Δ πʔϧΛͭ͘Γ·ͨ͠

  22. None
  23. 23 $ cd /path/to/unity/project $ unity-meta-check -silent missing: Autofix/Missing.meta missing:

    Missing.meta dangling: Autofix/Dangling.meta dangling: Dangling.meta λʔϛφϧͰ΋؆୯ʹ࣮ߦͰ͖Δ
  24. 24 NFUBʹաෆ଍͕͋Δ13ͷNFSHFΛ CMPDL͢Ε͹ଞͷਓͷ࡞ۀΛࢭΊͳ͍ͰࡁΉ

  25. 25 ݕࠪͷ࣮ߦ࣌ؒ෼࡞ۀ͕ ࢭ·ͬͯ͠·͏͜ͱʹ஫ҙ NFUBʹաෆ଍͕͋Δ13ͷNFSHFΛ CMPDL͢Ε͹ଞͷਓͷ࡞ۀΛࢭΊͳ͍ͰࡁΉ

  26. 6OJUZͰॏཁͳNFUBϑΝΠϧͷաෆ଍Λ ετϨεͳ͘ݟ͚ͭΔπʔϧ͸͍͔͕Ͱ͔͢ 26 ͜͜ॏཁ ఻͍͑ͨ͜ͱ

  27. ετϨεͷͳ͞

  28.  Ξηοτ ࣮ߦ଎౓ඵ

  29. +FOLJOTʹࡌ͚ͬͯ΋ ࣮ߦ଎౓ඵະຬ   +FOLJOTͷ଴ͪ࣌ؒͱήʔϜຊମͷQVMM࣌ؒͷΦʔόʔϔου͕௕͍

  30. ΍͔ͬͨʜʂʁʢϑϥάʣ

  31. 31 +FOLJOT্Ͱੜ੒͞ΕͨΞηοτ ʢϚελʔσʔλ౳ʣʹ NFUBϑΝΠϧ͕ͳ͍ʜ

  32. 32 $ unity-meta-check | unity-meta-autofix \ -fix-missing \ -fix-dangling \

    ./Assets/AutoGenerated/ ؆қతͳBVUPpYػೳ͸͡Ί·ͨ͠
  33. ͜ΕͰ࣮ӡ༻ʹ৐Ε·ͨ͠

  34. ӡ༻ͯ͠Θ͔ͬͨ͜ͱ

  35. NFUBաෆ଍໰୊͸ ୭΋ѱ͘ͳ͔ͬͨ ਓʑ͸6OJUZͱ(JUʹ ຋࿔͞Ε͍ͯΔ͚ͩͩͬͨ   ࠔͬͯͨਓ͕6OJUZ࠶ىಈͨ͠Β࣏Γ·ͨ͠ใࠂ͢ΔͳͲṖ͕ਂ͍ (JU͸ۭϑΥϧμΛ෮ݩ͠ͳ͍ͷͰରԠͨ͠NFUB͕஦ʹු͘ ʢͨͩ͠6OJUZ͔Β͸ۭϑΥϧμ࡞ͬͯ͘ΕΔʣ 

    
  36. ·ͱΊ 36 6OJUZͰॏཁͳNFUBϑΝΠϧͷաෆ଍Λ ετϨεͳ͘ݟ͚ͭΔπʔϧ͸͍͔͕Ͱ͔͢

  37. 37 Πϯετʔϧํ๏͸3&"%.&ΛΈ͍ͯͩ͘͞ɿ https://github.com/DeNA/unity-meta-check