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

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

Tetsuya Mori
November 28, 2018

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

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

Tetsuya Mori

November 28, 2018
Tweet

More Decks by Tetsuya Mori

Other Decks in Programming

Transcript

  1. גࣜձࣾΩοζελʔ CTO
    ৿ɹ఩࠸
    Managed Debugger

    ͷ࢖͍ํΛ͝঺հ
    ·ͩ Debug.Log() ࢖ͬͯΔͷʂʁ

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

    View full-size slide

  2. ͜Μ͹Μ͸ʂ
    2

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  5. ࠓ೔ͷ͓࿩ͷ֓ཁ
    5

    View full-size slide

  6. •Unity σόοά׬શʹཧղ͍ͨ͠ਓ
    •UniRx ͱ͔ͰϥϜμࣜΛ࢖͏ͱ

    ʮελοΫτϨʔε͕ಡΈͮΒ͍…ʂʯ

    ͬͯࢥ͍ͬͯΔਓ
    •iOS ͱ͔ Android ͱ͔ͷ

    ࣮ػσόοάͰࢮʹͦ͏ʹͳͬͯΔਓ
    6
    ࠓ೔ͷର৅ऀ
    ֓ཁ

    View full-size slide

  7. •֤σόοάख๏ͷ࢖͍Ͳ͜Ζ
    •JetBrains Rider Λ༻͍ͨ
    Managed Debugger ͷ࢖͍ํ
    7
    ࠓ೔࿩͢ίτ
    ֓ཁ

    View full-size slide

  8. •JetBrains Rider Ҏ֎ͷ IDE ʹ

    ԙ͚ΔσόοΨͷ࢖͍ํ
    •ίϯγϡʔϚήʔϜػʹԙ͚Δ

    σόοΨͷ࢖͍ํ
    8
    ࠓ೔࿩͞ͳ͍ίτ
    ֓ཁ

    View full-size slide

  9. •Unity 2018.3.0b11

    ʹͯಈ࡞֬ೝ͓ͯ͠Γ·͢
    •JetBrains Rider 2018.3 EAP 7

    ʹͯಈ࡞֬ೝ͓ͯ͠Γ·͢
    •IL2CPP Backend ͳ iOS ϏϧυΛ

    iOS 12.1 Ͱಈ࡞֬ೝ͓ͯ͠Γ·͢
    9
    ։ൃ؀ڥ
    ֓ཁ

    View full-size slide

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

    View full-size slide

  11. ࣗݾ঺հ
    11

    View full-size slide

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

    View full-size slide

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

    for Developer Technologies
    •ࣗশ Unity ΤϰΝϯδΣϦετ

    View full-size slide

  14. 14
    Job
    ࣗݾ঺հ
    ࢠͲ΋޲͚ΞϓϦ࡞ͬͯΔձࣾͰ
    $50΍ͬͯ·͢

    View full-size slide

  15. 15
    Recruit
    ࣗݾ঺հ
    •Unity ͰͷΞχϝʔγϣϯ࡞Γ΍

    γʔϯ࡞ΓͳͲΛߦ͏

    Unity ΞʔςΟετ
    •Πϥετ੍࡞΍ը໘σβΠϯΛߦ͏

    σβΠφɾΠϥετϨʔλ

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  21. •Editor Ͱͷ࣮૷தͳΒɺ·͊ΞϦ
    •ͨͩ͠ɺϩάΛ௥Ճɾมߋ͢Δ౓ʹ

    ίϯύΠϧ͕૸ΔͷͰ

    ڊେϓϩδΣΫτͩͱγϯυΠ
    •࣮ػͰͷσόοά͸౎౓Ϗϧυ͕

    ඞཁʹͳΔͷͰඇݱ࣮త
    22
    Debug.Log() ͡Όμϝʁ
    σόοάख๏

    View full-size slide

  22. •σόοάΛิॿ͢Διϑτ΢ΣΞ
    •Breakpoint Λுͬͯϓϩηε͕

    ౰֘ߦʹࢸͬͨ࣌ʹҰ࣌ఀࢭ
    •Ұ࣌ఀࢭ࣌఺ͷม਺ͷঢ়ଶΛղੳ
    •ͦ͜ʹࢸΔελοΫτϨʔεΛදࣔ
    23
    σόοΨ is Կʁ
    σόοάख๏

    View full-size slide

  23. •Visual Studio ΍ JetBrains Rider

    ͳͲͷ IDE ʹ౥ࡌ͞Ε͍ͯΔ
    •Visual Studio Code Ͱ΋֦ுػೳͱͯ͠

    ΠϯετʔϧՄೳʢΒ͍͠ʣ
    •ίϯςΩετʹΑͬͯ͸σόοάΛઐ໳ͱ͢Δ

    δϣϒͷਓΛࢦ͢ίτ΋͋Δ
    24
    σόοΨ is Կʁ
    σόοάख๏

    View full-size slide

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

    View full-size slide

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

    View full-size slide

  26. σόοΨͷ࢖͍ํ
    28

    View full-size slide

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

    Λ෇͚Δͱɺىಈ௚ޙʹ

    μΠΞϩά͕ग़ͯ

    σόοΨ઀ଓΛ଴ͯΔ
    29
    σόοΨͷ࢖͍ํ
    σόοΨͷ࢖͍ํ
    Unity 2018.2 ͔Β
    IL2CPP Backend Ͱ΋
    Script Debugging Մೳʹ

    View full-size slide

  28. ηΫγϣϯλΠτϧ
    •Wait For Managed
    Debugger

    Λ෇͚Δͱىಈ࣌ʹ

    μΠΞϩά͕ग़Δ
    •Ok ϘλϯΛԡ͢·Ͱ

    ϓϩηε͕Ұ࣌ఀࢭͯ͠

    ͘ΕΔͷͰɺͦͷؒʹ

    σόοΨΛ઀ଓ͢Δ
    30
    σόοΨͷ࢖͍ํ
    σόοΨͷ࢖͍ํ

    View full-size slide

  29. ηΫγϣϯλΠτϧ
    •Debugger ઀ଓ
    •ಉҰ LAN ಺ʹډΔ

    ϓϩηεΛ୳ͯ͘͠ΕΔ
    •Editor ΋࣮ػ΋ର৅
    31
    σόοΨͷ࢖͍ํ
    σόοΨͷ࢖͍ํ

    View full-size slide

  30. ηΫγϣϯλΠτϧ
    •Breakpoint ΛுΔ
    •Breakpoint ʹରͯ͠

    ৚݅ࣜΛઃఆՄೳ

    ʢ࣮ػͩͱո͍͠ʁʣ
    •εΫγϣ͸ this ͕ null
    ͷ৔߹ʹࢭΊ͍ͯΔ
    32
    σόοΨͷ࢖͍ํ
    σόοΨͷ࢖͍ํ
    Unity ͋Δ͋Δ

    View full-size slide

  31. ηΫγϣϯλΠτϧ
    •Exception Λ Watch
    •Exception ൃੜ࣌఺Ͱ

    ࢭΊͯ͘ΕΔ
    •ӈԼͷεΫγϣͷ৔߹

    transform ࢀর࣌఺Ͱ

    NullReferenceException ͕

    ൃੜ͍ͯ͠Δ
    33
    σόοΨͷ࢖͍ํ
    σόοΨͷ࢖͍ํ

    View full-size slide

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

    View full-size slide

  33. •σόοΨΛ࢖͑͹ಡΈਏ͍Τϥʔ΋

    ղੳ͠΍͘͢ͳΔʂ
    •Xcode ܨ͕ͳͯ͘΋࣮ػσόοάՄೳʂ
    •Managed Code ͰσόοάͰ͖Δʂ
    •Visual Studio ͳΓ Rider ͳΓ

    ศརͳ IDE Λੵۃతʹ࢖͍ͬͯ͜͏ʂ
    36
    ·ͱΊ
    ·ͱΊ
    Unity 2018.2 ͔Β

    View full-size slide

  34. •ຊ೔࢖ͬͨσϞϓϩδΣΫτ
    • https://github.com/monry/debugger_demo
    37
    Appendix

    View full-size slide

  35. Thank you for your attention!!
    38

    View full-size slide