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

unitypackage distribution

85d7f0ae00c0cf1092dffcec966e3ae9?s=47 mattak
January 31, 2018

unitypackage distribution

85d7f0ae00c0cf1092dffcec966e3ae9?s=128

mattak

January 31, 2018
Tweet

More Decks by mattak

Other Decks in Programming

Transcript

  1. VOJUZQBDLBHF࡞Δͱ͖ʹ ؾΛ͚ͭͨ΄͏͕͍͍͜ͱ (PUBOEBVOJUZ !NBUUBL !

  2. VOJUZQBDLBHF

  3. .unitypackage Ͱऴྃ͢ΔAsset഑෍ܗࣜ

  4. 1. ~.unitypackage ΛμϒϧΫϦοΫ 2. ཉ͍͠΋ͷ͚ͩࢦఆͯ͠import

  5. ༨ஊ

  6. $ cp Unicache-v0.2.0.unitypackage Unicache-v0.2.0.tar.gz $ tar -zxvf Unicache-v0.2.0.tar.gz ֦ுࢠΛ .unitypackage

    => .tar.gz ʹ͢Δͱத਎͕ݟΕΔ
  7. None
  8. /:guid - assetͷguid͕ϑΥϧμ໊ʹ /:guid/pathname - pathnameʹอଘઌͷpath - ྫ: Assets/Plugins/UniRx/Scripts/UnityEngineBridge/TypedMonoBehaviour.cs /:guid/asset

    - assetͷத਎ (ͦͷ·Μ·ϑΝΠϧ͕ೖͬͯΔ) /:guid/asset.meta - assetͷϝλσʔλ (ͦͷ··) جຊతʹguidͰϑΝΠϧ؅ཧ => ϑΝΠϧҠಈͯ͠΋guidมΘΒͳ͚Ε͹importඞཁ͔Ͳ͏͔ݕ஌Մೳ
  9. ؾΛ͚ͭͨ΄͏͕ ͍͍͜ͱ

  10. Ϋϥε໊ඃΓ

  11. ྫ: The namespace `global::' already contains a definition for `Singleton'

    ಉ͡Ϋϥε໊͕ෳ਺͋ΔͱίϯύΠϧͰ͖ͳ͍ͷͰࠔΔ Plugins/Asset1/Singleton.cs Plugins/Asset2/Singleton.cs public class Singleton {}
  12. ରॲ namespaceをつけよう namespace MyLib { public class Singleton {} }

    ͱͯ΋جຊ͚ͩͲɺ΍Βͳ͍··഑෍͍ͯ͠Δ΋ͷ͸ଟ͍ҹ৅
  13. ଞͷϥΠϒϥϦΛ ϦωʔϜͯ͠ར༻

  14. Plugins/Asset1/MiniJSON.cs Plugins/Asset2/MiniJSON.cs ௚઀ࠔΔ͜ͱ͸ͳ͍͕ɺಉ͡ίʔυ͕ෳ਺όΠφϦʹؚ·Εͯແବ. ྫ: namespace Asset1 { public static class

    Json {} } namespace Asset2 { public static class Json {} }
  15. ରॲ 外部ライブラリは名前を変えずに外に置こう Asset1 - Assets/Plugins/Asset1/* - Assets/Plugins/Asset2/* - Assets/Plugins/MiniJSON/MiniJSON.cs ڞ௨ͷ৔ॴʹ͓͍͍ͯΕ͹ɺ

    2ͭ໨Ҏ߱ͷϥΠϒϥϦΛimport͢Δࡍʹڞ௨ͷϦιʔεΛແࢹͰ͖Δ namespace MiniJSON { public static class Json {} }
  16. Plugins/MyLib/* ֎෦ϥΠϒϥϦ͕ࣗ਎ͷAssetσΟϨΫτϦ (Plugins/MyLib/) ಺ʹଘࡏ ୳ͨ͠Γআ֎൑அΛ͢Δͷ͕໘౗ʹͳΔ ྫ: Plugins/MyLib/A/B/C/MiniJSON/MiniJSON.cs

  17. ରॲ 外部ライブラリは⾃分のAssetのフォルダ外に置こう Asset1 - Assets/Plugins/Asset1/* - Assets/Plugins/MiniJSON/MiniJSON.cs ڞ௨ͷ৔ॴʹ͓͍͍ͯΕ͹ɺ 2ͭ໨Ҏ߱ͷϥΠϒϥϦΛimport͢Δࡍʹڞ௨ͷϦιʔεΛແࢹͰ͖Δ Asset2

    - Assets/Plugins/Asset2/* - Assets/Plugins/MiniJSON/MiniJSON.cs
  18. ίϯύΠϧ͕஗͍

  19. Assets/MyLib/Somthing1.cs Assets/MyLib/Somthing2.cs Assets/MyLib/Somthing3.cs PluginsҎԼʹϥΠϒϥϦͱͯ͠ͷίʔυΛஔ͔ͳ͍ύλʔϯ Script͕૿͍͑ͯ͘ͱɺίϯύΠϧ͕஗͘ͳ͍ͬͯ͘ ྫ: ͜ͷ଴ͪ ͕௕͍

  20. ରॲ 変更しないコードはPlugins/ に置こう Assets/MyLib => Assets/Plugins/MyLib Plugins/ ͸ϓϦίϯύΠϧͯ͘͠ΕΔ. PluginsҎԼͷίʔυʹมߋ͕ͳ͍ݶΓ࠶ίϯύΠϧ͸૸Βͳ͍. ϥΠϒϥϦͳͲมߋ͕ͳ͍ίʔυ͸

    Plugins/ ҎԼ΁ (๭ϓϩδΣΫτͰ͸ɺ։ൃதͷίϯύΠϧ଴͕ͪ൒෼ʹͳΓ·ͨ͠)
  21. &YBNQMFT 5FTU ͷ৔ॴ͕Θ͔Γʹ͍͘

  22. Assets/Plugins/MyLib/Hoge.cs Assets/Plugins/MyLib/README.md Assets/Plugins/MyLib/Sample1/Sample2.cs Assets/Plugins/MyLib/Sample2/Sample1.cs Assets/Plugins/MyLib/Editor/Test/HogeTest.cs - (ϥΠϒϥϦͱͯ͠ͷ) ࠷௿ݶιʔε - Example

    - Test - Document ͜ΕΒͷ۠੾Γ͕Θ͔Γʹ͘͘ͳ͍ͬͯΔ ͲΕΛimport͢Δ΂͖͔ɺਂ͍֊૚·Ͱݟͳ͍ͱΘ͔Βͳ͍ͳͲ ྫ:
  23. ରॲ 配下はトップレベルで不要・必要を分別できるようにしよう Assets/Plugins/MyLib/Core/* Assets/Plugins/MyLib/Examples/* Assets/Plugins/MyLib/Documents/* Assets/Plugins/MyLib/Tests/Editor/* MyLibҎԼͷҰ൪্ͷ֊૚ͷνΣοΫϘοΫεͰෆཁඞཁ͕൑அͰ͖Δ ৔ॴ͕఺ࡏ͠ͳ͍ͷͰΘ͔Γ΍͍͢͠ɺ࡟আ/௥Ճ͠΍͍͢

  24. ফͤͳ͘ͳΔ໰୊

  25. ͜ΕɺͲͷAssetͰ͔ͭͬͯͨjar͚ͩͬʁΈ͍ͨͳঢ়گʹͳ͍ͬͯ͘… ྫ: Assets/Plugins/Android/okhttp-3.8.0.jar Assets/Plugins/Android/okio-3.8.0.jar

  26. ରॲ どのライブラリで必要なファイルかdirectoryで判別可能にしよう Assets/Plugins/Android/MyLib/okhttp-3.8.0.jar Assets/Plugins/Android/MyLib/okio-3.8.0.jar ຊ౰͸ɺґଘؔ܎Λهड़Ͱ͖ΔԿ͔Ͱ؅ཧ͢Δͷ͕ྑͦ͞͏ ґଘϑΝΠϧ͚ͩهड़͓͍ͯͯ͠ɺಈతʹऔಘ͢Δͱ͔͕ϕετͳؾ͕͢Δ

  27. όʔδϣϯ෼͔Β ͳ͍໰୊

  28. ରॲ VERSION.txt 置こう $ cat Assets/Plugins/Zenject/Version.txt 5.4.0 γϯϓϧ͚ͩͲɺόʔδϣϯ͕มΘͬͨ͜ͱΛ໌ࣔͰ͖ͯྑ͍ gitʹ΋࢒Δ

  29. ·ͱΊ

  30. 使う側が楽になるように配布前に少し⼯夫しよう