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

Managed Debugger の使い方をご紹介/How to use Managed Debugger on Unity

Managed Debugger の使い方をご紹介/How to use Managed Debugger on Unity

2018/11/28 (Wed) に開催された Gotanda.unity #9 での登壇資料になります。

7b13f432547b92d04c79b749adb535e0?s=128

Tetsuya Mori

November 28, 2018
Tweet

Transcript

  1. גࣜձࣾΩοζελʔ CTO ৿ɹ఩࠸ Managed Debugger
 ͷ࢖͍ํΛ͝঺հ ·ͩ Debug.Log() ࢖ͬͯΔͷʂʁ
 Unity

    2018.2 ࣌୅ͷϞμϯͳσόοάख๏͸ίϨͩʂ 2018/11/28 Gotanda.unity #9 at Unity Technologies Japan
  2. ͜Μ͹Μ͸ʂ 2

  3. •LT ֓ཁ •ࣗݾ঺հ •σόοάख๏͋Ε͜Ε •ϥΠϒσϞ •σόοΨͷ࢖͍ํ •·ͱΊ 3 ΞδΣϯμ

  4. •LT ֓ཁ •ࣗݾ঺հ •σόοάख๏͋Ε͜Ε •ϥΠϒσϞ •σόοΨͷ࢖͍ํ •·ͱΊ 4 ΞδΣϯμ ΠϚίί

  5. ࠓ೔ͷ͓࿩ͷ֓ཁ 5

  6. •Unity σόοά׬શʹཧղ͍ͨ͠ਓ •UniRx ͱ͔ͰϥϜμࣜΛ࢖͏ͱ
 ʮελοΫτϨʔε͕ಡΈͮΒ͍…ʂʯ
 ͬͯࢥ͍ͬͯΔਓ •iOS ͱ͔ Android ͱ͔ͷ


    ࣮ػσόοάͰࢮʹͦ͏ʹͳͬͯΔਓ 6 ࠓ೔ͷର৅ऀ ֓ཁ
  7. •֤σόοάख๏ͷ࢖͍Ͳ͜Ζ •JetBrains Rider Λ༻͍ͨ Managed Debugger ͷ࢖͍ํ 7 ࠓ೔࿩͢ίτ ֓ཁ

  8. •JetBrains Rider Ҏ֎ͷ IDE ʹ
 ԙ͚ΔσόοΨͷ࢖͍ํ •ίϯγϡʔϚήʔϜػʹԙ͚Δ
 σόοΨͷ࢖͍ํ 8 ࠓ೔࿩͞ͳ͍ίτ

    ֓ཁ
  9. •Unity 2018.3.0b11
 ʹͯಈ࡞֬ೝ͓ͯ͠Γ·͢ •JetBrains Rider 2018.3 EAP 7
 ʹͯಈ࡞֬ೝ͓ͯ͠Γ·͢ •IL2CPP

    Backend ͳ iOS ϏϧυΛ
 iOS 12.1 Ͱಈ࡞֬ೝ͓ͯ͠Γ·͢ 9 ։ൃ؀ڥ ֓ཁ
  10. •LT ֓ཁ •ࣗݾ঺հ •σόοάख๏͋Ε͜Ε •ϥΠϒσϞ •σόοΨͷ࢖͍ํ •·ͱΊ 10 ΞδΣϯμ ΠϚίί

  11. ࣗݾ঺հ 11

  12. 12 Who am I ? ࣗݾ঺հ @monry a.k.a. ΋ΜΓ͌ઌੜ

  13. 13 Who am I ? ࣗݾ঺հ •2019-2020 Microsoft MVP
 for

    Developer Technologies •ࣗশ Unity ΤϰΝϯδΣϦετ
  14. 14 Job ࣗݾ঺հ ࢠͲ΋޲͚ΞϓϦ࡞ͬͯΔձࣾͰ $50΍ͬͯ·͢

  15. 15 Recruit ࣗݾ঺հ •Unity ͰͷΞχϝʔγϣϯ࡞Γ΍
 γʔϯ࡞ΓͳͲΛߦ͏
 Unity ΞʔςΟετ •Πϥετ੍࡞΍ը໘σβΠϯΛߦ͏
 σβΠφɾΠϥετϨʔλ

  16. 16 PR ࣗݾ঺հ ϚϯΨͰΘ͔Δ Unity ޷ධ࿈ࡌதʂ

  17. 17 PR ࣗݾ঺հ #΋ͷϥδ ύʔιφϦςΟ΍ͬͯ·͢ʂ ήετืूதʂ

  18. ຊ୊ 18

  19. •LT ֓ཁ •ࣗݾ঺հ •σόοάख๏͋Ε͜Ε •ϥΠϒσϞ •σόοΨͷ࢖͍ํ •·ͱΊ 19 ΞδΣϯμ ΠϚίί

  20. σόοάख๏͋Ε͜Ε 20

  21. 21 σόοάख๏ σόοάख๏ ໨ࢹ צ ϩά σόοΨ σόοΨ

  22. •Editor Ͱͷ࣮૷தͳΒɺ·͊ΞϦ •ͨͩ͠ɺϩάΛ௥Ճɾมߋ͢Δ౓ʹ
 ίϯύΠϧ͕૸ΔͷͰ
 ڊେϓϩδΣΫτͩͱγϯυΠ •࣮ػͰͷσόοά͸౎౓Ϗϧυ͕
 ඞཁʹͳΔͷͰඇݱ࣮త 22 Debug.Log() ͡Όμϝʁ

    σόοάख๏
  23. •σόοάΛิॿ͢Διϑτ΢ΣΞ •Breakpoint Λுͬͯϓϩηε͕
 ౰֘ߦʹࢸͬͨ࣌ʹҰ࣌ఀࢭ •Ұ࣌ఀࢭ࣌఺ͷม਺ͷঢ়ଶΛղੳ •ͦ͜ʹࢸΔελοΫτϨʔεΛදࣔ 23 σόοΨ is Կʁ

    σόοάख๏
  24. •Visual Studio ΍ JetBrains Rider
 ͳͲͷ IDE ʹ౥ࡌ͞Ε͍ͯΔ •Visual Studio

    Code Ͱ΋֦ுػೳͱͯ͠
 ΠϯετʔϧՄೳʢΒ͍͠ʣ •ίϯςΩετʹΑͬͯ͸σόοάΛઐ໳ͱ͢Δ
 δϣϒͷਓΛࢦ͢ίτ΋͋Δ 24 σόοΨ is Կʁ σόοάख๏
  25. •LT ֓ཁ •ࣗݾ঺հ •σόοάख๏͋Ε͜Ε •ϥΠϒσϞ •σόοΨͷ࢖͍ํ •·ͱΊ 25 ΞδΣϯμ ΠϚίί

  26. Live Demo 26

  27. •LT ֓ཁ •ࣗݾ঺հ •σόοάख๏͋Ε͜Ε •ϥΠϒσϞ •σόοΨͷ࢖͍ํ •·ͱΊ 27 ΞδΣϯμ ΠϚίί

  28. σόοΨͷ࢖͍ํ 28

  29. ηΫγϣϯλΠτϧ •Ϗϧυ࣌ͷΦϓγϣϯ •Development Build •Script Debugging •Wait For Managed Debugger


    Λ෇͚Δͱɺىಈ௚ޙʹ
 μΠΞϩά͕ग़ͯ
 σόοΨ઀ଓΛ଴ͯΔ 29 σόοΨͷ࢖͍ํ σόοΨͷ࢖͍ํ Unity 2018.2 ͔Β IL2CPP Backend Ͱ΋ Script Debugging Մೳʹ
  30. ηΫγϣϯλΠτϧ •Wait For Managed Debugger
 Λ෇͚Δͱىಈ࣌ʹ
 μΠΞϩά͕ग़Δ •Ok ϘλϯΛԡ͢·Ͱ
 ϓϩηε͕Ұ࣌ఀࢭͯ͠


    ͘ΕΔͷͰɺͦͷؒʹ
 σόοΨΛ઀ଓ͢Δ 30 σόοΨͷ࢖͍ํ σόοΨͷ࢖͍ํ
  31. ηΫγϣϯλΠτϧ •Debugger ઀ଓ •ಉҰ LAN ಺ʹډΔ
 ϓϩηεΛ୳ͯ͘͠ΕΔ •Editor ΋࣮ػ΋ର৅ 31

    σόοΨͷ࢖͍ํ σόοΨͷ࢖͍ํ
  32. ηΫγϣϯλΠτϧ •Breakpoint ΛுΔ •Breakpoint ʹରͯ͠
 ৚݅ࣜΛઃఆՄೳ
 ʢ࣮ػͩͱո͍͠ʁʣ •εΫγϣ͸ this ͕

    null ͷ৔߹ʹࢭΊ͍ͯΔ 32 σόοΨͷ࢖͍ํ σόοΨͷ࢖͍ํ Unity ͋Δ͋Δ
  33. ηΫγϣϯλΠτϧ •Exception Λ Watch •Exception ൃੜ࣌఺Ͱ
 ࢭΊͯ͘ΕΔ •ӈԼͷεΫγϣͷ৔߹
 transform ࢀর࣌఺Ͱ


    NullReferenceException ͕
 ൃੜ͍ͯ͠Δ 33 σόοΨͷ࢖͍ํ σόοΨͷ࢖͍ํ
  34. •LT ֓ཁ •ࣗݾ঺հ •σόοάख๏͋Ε͜Ε •ϥΠϒσϞ •σόοΨͷ࢖͍ํ •·ͱΊ 34 ΞδΣϯμ ΠϚίί

  35. ·ͱΊ 35

  36. •σόοΨΛ࢖͑͹ಡΈਏ͍Τϥʔ΋
 ղੳ͠΍͘͢ͳΔʂ •Xcode ܨ͕ͳͯ͘΋࣮ػσόοάՄೳʂ •Managed Code ͰσόοάͰ͖Δʂ •Visual Studio ͳΓ

    Rider ͳΓ
 ศརͳ IDE Λੵۃతʹ࢖͍ͬͯ͜͏ʂ 36 ·ͱΊ ·ͱΊ Unity 2018.2 ͔Β
  37. •ຊ೔࢖ͬͨσϞϓϩδΣΫτ • https://github.com/monry/debugger_demo 37 Appendix

  38. Thank you for your attention!! 38