Slide 1

Slide 1 text

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

Slide 2

Slide 2 text

VOJUZQBDLBHF

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

༨ஊ

Slide 6

Slide 6 text

$ cp Unicache-v0.2.0.unitypackage Unicache-v0.2.0.tar.gz $ tar -zxvf Unicache-v0.2.0.tar.gz ֦ுࢠΛ .unitypackage => .tar.gz ʹ͢Δͱத਎͕ݟΕΔ

Slide 7

Slide 7 text

No content

Slide 8

Slide 8 text

/:guid - assetͷguid͕ϑΥϧμ໊ʹ /:guid/pathname - pathnameʹอଘઌͷpath - ྫ: Assets/Plugins/UniRx/Scripts/UnityEngineBridge/TypedMonoBehaviour.cs /:guid/asset - assetͷத਎ (ͦͷ·Μ·ϑΝΠϧ͕ೖͬͯΔ) /:guid/asset.meta - assetͷϝλσʔλ (ͦͷ··) جຊతʹguidͰϑΝΠϧ؅ཧ => ϑΝΠϧҠಈͯ͠΋guidมΘΒͳ͚Ε͹importඞཁ͔Ͳ͏͔ݕ஌Մೳ

Slide 9

Slide 9 text

ؾΛ͚ͭͨ΄͏͕ ͍͍͜ͱ

Slide 10

Slide 10 text

Ϋϥε໊ඃΓ

Slide 11

Slide 11 text

ྫ: The namespace `global::' already contains a definition for `Singleton' ಉ͡Ϋϥε໊͕ෳ਺͋ΔͱίϯύΠϧͰ͖ͳ͍ͷͰࠔΔ Plugins/Asset1/Singleton.cs Plugins/Asset2/Singleton.cs public class Singleton {}

Slide 12

Slide 12 text

ରॲ namespaceをつけよう namespace MyLib { public class Singleton {} } ͱͯ΋جຊ͚ͩͲɺ΍Βͳ͍··഑෍͍ͯ͠Δ΋ͷ͸ଟ͍ҹ৅

Slide 13

Slide 13 text

ଞͷϥΠϒϥϦΛ ϦωʔϜͯ͠ར༻

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

ରॲ 外部ライブラリは名前を変えずに外に置こう Asset1 - Assets/Plugins/Asset1/* - Assets/Plugins/Asset2/* - Assets/Plugins/MiniJSON/MiniJSON.cs ڞ௨ͷ৔ॴʹ͓͍͍ͯΕ͹ɺ 2ͭ໨Ҏ߱ͷϥΠϒϥϦΛimport͢Δࡍʹڞ௨ͷϦιʔεΛແࢹͰ͖Δ namespace MiniJSON { public static class Json {} }

Slide 16

Slide 16 text

Plugins/MyLib/* ֎෦ϥΠϒϥϦ͕ࣗ਎ͷAssetσΟϨΫτϦ (Plugins/MyLib/) ಺ʹଘࡏ ୳ͨ͠Γআ֎൑அΛ͢Δͷ͕໘౗ʹͳΔ ྫ: Plugins/MyLib/A/B/C/MiniJSON/MiniJSON.cs

Slide 17

Slide 17 text

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

Slide 18

Slide 18 text

ίϯύΠϧ͕஗͍

Slide 19

Slide 19 text

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

Slide 20

Slide 20 text

ରॲ 変更しないコードはPlugins/ に置こう Assets/MyLib => Assets/Plugins/MyLib Plugins/ ͸ϓϦίϯύΠϧͯ͘͠ΕΔ. PluginsҎԼͷίʔυʹมߋ͕ͳ͍ݶΓ࠶ίϯύΠϧ͸૸Βͳ͍. ϥΠϒϥϦͳͲมߋ͕ͳ͍ίʔυ͸ Plugins/ ҎԼ΁ (๭ϓϩδΣΫτͰ͸ɺ։ൃதͷίϯύΠϧ଴͕ͪ൒෼ʹͳΓ·ͨ͠)

Slide 21

Slide 21 text

&YBNQMFT 5FTU ͷ৔ॴ͕Θ͔Γʹ͍͘

Slide 22

Slide 22 text

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͢Δ΂͖͔ɺਂ͍֊૚·Ͱݟͳ͍ͱΘ͔Βͳ͍ͳͲ ྫ:

Slide 23

Slide 23 text

ରॲ 配下はトップレベルで不要・必要を分別できるようにしよう Assets/Plugins/MyLib/Core/* Assets/Plugins/MyLib/Examples/* Assets/Plugins/MyLib/Documents/* Assets/Plugins/MyLib/Tests/Editor/* MyLibҎԼͷҰ൪্ͷ֊૚ͷνΣοΫϘοΫεͰෆཁඞཁ͕൑அͰ͖Δ ৔ॴ͕఺ࡏ͠ͳ͍ͷͰΘ͔Γ΍͍͢͠ɺ࡟আ/௥Ճ͠΍͍͢

Slide 24

Slide 24 text

ফͤͳ͘ͳΔ໰୊

Slide 25

Slide 25 text

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

Slide 26

Slide 26 text

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

Slide 27

Slide 27 text

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

Slide 28

Slide 28 text

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

Slide 29

Slide 29 text

·ͱΊ

Slide 30

Slide 30 text

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