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

LINEでビデオ通話してくれる妹の作り方

uezo
December 17, 2021

 LINEでビデオ通話してくれる妹の作り方

LINE Developer Community 忘年LT大会。LIFFでWebGLアプリを動かす技術です

uezo

December 17, 2021
Tweet

More Decks by uezo

Other Decks in Technology

Transcript

  1. -*/&ͰϏσΦ௨࿩ͯ͘͠ΕΔຓͷ࡞Γํ 〜Unity WebGL × LINE Platformで作る召喚型メタバース〜 2021.12.16 うえぞう|植⽊悠⼆ LINE Developer

    Community 忘年LT⼤会
  2. ࣗݾ঺հ ͏͑ͧ͏ʢ২໦ ༔ೋʣ ϗϏʔϓϩάϥϚʔ ߴߍଔۀޙʹ୯਎্ژɻόϦελͷݟश͍Λ ͠ͳ͕ΒಠֶͰϓϩάϥϛϯάΛशಘɻ ࡾҪॅ༑ւ্͓Αͼࡾඛ6'+ۜߦʹ֤ͯछ%9 ϓϩδΣΫτͷϦʔυΞʔΩςΫτ΍ϓϩμ ΫτϚωʔδϟʔ౳Λྺ೚ɻ ݱࡏ͸ίϯϐϡʔλʔؔ࿈αʔϏεاۀʹͯ

    ۚ༥ػؔ޲͚ͷίϯαϧςΟϯάʹैࣄɻ VF[P !VF[PDIBO
  3. ͍΋͏ͱϥϯνϟʔ l ͍΋͏ͱʹ͓ئ͍͢Δ͜ͱΛίϯηϓτͱ࣮ͨ͠༻ੑॏࢹͷίϚϯυೖྗܕϥϯνϟʔ l ૭ͷై೥ΤΠϓϦϧϑʔϧωλʮ͍΋͏ͱσεΫτοϓʯʹ৮ൃ͞Εͯ։ൃΛελʔτ IUUQTGPSFTUXBUDIJNQSFTTDPKQ EPDTTFSJBMNPSJUBMLIUNM

  4. ͍΋͏ͱ#05 l ϦϚΠϯμʔ΍໨֮·͠ίʔϧɺ࣌ࠁදɺఱؾɺ຋༁ɺήʔϜͳͲଟ࠼ͳػೳΛఏڙ l ͦΕͧΕͷػೳ͸ͨͩศརͳ͚ͩͰ͸ͳ͘ɺΩϟϥΫλʔͱͷձ࿩ͷதͰࣗવ͔ͭ࠷దԽͯ͠ఏڙ

  5. ͍΋͏ͱ$-07"εΩϧ l ৽ίϯηϓτʮ͍͋ͭ͞υϦϒϯʯʹΑͬͯੜ׆ʹΑΓҰ૚ͷ५͍ͱརศੑΛ΋ͨΒ͢͜ͱʹ੒ޭ

  6. (BUFCPY l ΩϟϥΫλʔঌש૷ஔʮ(BUFCPYʯΛར༻ͯ͠ର࿩Մೳͳड෇܎ʴड෇γεςϜΛ։ൃ

  7. ͍΋͏ͱΤΫεϖϦΤϯε ϦϚΠϯμʔʹ༧ ఆΛొ࿥͢Δ l ܁Γฦ͞ΕΔແຯס૩ͳ࡞ۀΛʮ͍΋͏ͱʹ͓ئ͍͢Δʯʹม׵͢Δ͜ͱͰɺͳΜͯ͜ͱͷͳ͍ຖ೔ ʹ५͍Λ΋ͨΒ͢͜ͱ͕Մೳ ࣌ࠁදΛௐ΂Δ ແຯס૩ ແຯס૩ ͍΋͏ͱʹϦϚΠ

    ϯυΛ͓ئ͍͢Δ ͍΋͏ͱʹ࣌ࠁද Λڭ͑ͯ΋Β͏ ৺ͷ५͍ ৺ͷ५͍
  8. ਂࠁ͞Λ૿͢զ͕ࠃͷຓෆ଍   ೥൒Ͱ ഒ௒

  9. ͍΋͏ͱϓϩμΫτͷਐԽͷܥේ ࣮༻ੑͷ۩උ ͍΋͏ͱϥϯνϟʔ ݱ࣮ੈքͷ՝୊ղܾ ͍΋͏ͱ#05 ͍΋͏ͱ$-07"εΩϧ Ի੠ର࿩ (BUFCPYΞϓϦ ݱ࣮΁ͷঌשʢର໘ʣ ͍΋͏ͱ-*/&௨࿩

    ݱ࣮΁ͷঌשʢඇର໘ʣ 8FBSFIFSF ͍΋͏ͱσεΫτοϓ ݪ࡞ɾϦεϖΫτ
  10. σϞಈը IUUQTZPVUVCF$44@/(:IF6

  11. ΩϟϥΫλʔͱͷର࿩ʹ͓͚Δ-*''ͷՁ஋ Θ͟Θ͟ΞϓϦɾσόΠεΛىಈͯ͠࿩͍ͨ͠ͱ͍͏ڧ͍૝͍ ΩϟϥΫλʔʹ͓ئ͍ l جຊػೳ͸νϟοτϘοτͰఏڙͭͭ͠ɺΑΓྑ࣭ͳର࿩ମݧΛر๬͢Δ৔߹ͷΈԻ੠ର࿩ʹ੾Γସ ͑Δͱ͍͏બ୒ࢶΛϢʔβʔʹ༩͑Δ l -*/&ࣗମ͕ίϛϡχέʔγϣϯνϟωϧͰ͋Γɺผ్ΞϓϦ౳Λىಈ͢ΔΑΓ΋ಋઢ͕εϜʔζ Ϣʔβʔͷݩʑͷ໨త͸ νϟοτϘοτͰୡ੒

    -*/&͸ίϛϡχέʔγϣϯνϟωϧ Ͱ͋Γ͜ͷಋઢ͕ମݧͱͯࣗ͠વ ͍ͭͰʹ͓͠Ό΂Γ -*'' "QQ౳
  12. ֓೦ΞʔΩςΫνϟ 6OJUZ8FC(-PO-*'' "[VSF4QFFDI4FSWJDFT l ௨࿩தͷը໘͸6OJUZ্Ͱ8FC(-ΛλʔήοτϓϥοτϑΥʔϜͱͯ͠։ൃ͠ɺ-*''ͱͯ͠ಈ࡞ l εΩϧຖͷର࿩ॲཧ౳͸αʔόʔαΠυʹ੾Γग़͢͜ͱͰ։ൃޮ཰Λ޲্ l ϓϩϯϓτ l

    τϐοΫͷཧղ l ର࿩ॲཧ $POWFSTBUJPO4FSWJDF ʢ'BTU"1* 1ZUIPOʣ 3FNJOEFS4FSWJDF 'BTU"1* 1ZUIPO 70*$&30*%4FSWFS l ొ࿥ l औಘ l ఆظ1VTI l จࣈى͜͠ l ಡΈ্͛ 70*$&30*%͍ͭͳͪΌΜ QZWDSPJEΛ 'BTU"1*Ͱ3&45"1*4FSWFSԽ -*/& ೝূ τʔΫϯ ཁٻԻ੠ ॲཧཁٻจݴ ॲཧཁٻจݴ Ԡ౴จݴ Ԡ౴จݴ Ԡ౴Ի੠ ϦϚΠϯμʔ௨஌ τʔΫϯ Ϣʔβ ৘ใ ϓογϡ ௨஌ૹ৴ ϦϚΠϯμʔ֬ೝ ͓஌Βͤจݴ ʢओͳར༻Ξηοτʣ l .JDSPQIPOF8FC(--JCSBSZ l 4"-4""NQMJUVEF l $IBUEPMM,JU l $ZHOFUʢ%Ϟσϧʣ ొ࿥
  13. ѱເʂ8FC(-ͱͷಆ͍ͷه࿥  ΤσΟλͰ͸ಈ͕͘ϒϥ΢βͰಈ͔ͳ͍͜ͱ͕ଟ͍ɻͰ΋Ϗϧυʹ෼ʙ෼͔͔Δ  l5PVTFEMPQFO ZPVOFFEUPVTF&NTDSJQUFO`T MJOLJOHTVQQPSU TFF IUUQTHJUIVCDPNLSJQLFOFNTDSJQUFOXJLJ-JOLJOHz 👉ݪҼՕॴಛఆ͕ख୳Γ

     $ඪ४ͷBTZODBXBJUͰॲཧ͕ఀࢭ👉ϒϥ΢β+4͸γϯάϧεϨουͰͨ͠Ͷɻɻ6OJ5BTL΁Ҡߦ  /&5ඪ४ͷ)UUQ$MJFOU࢖͑ͳ͍👉6OJUZ8FC3FRVFTUʹஔ͖׵͑ɻ6OJ5BTLͷ͓͔͛ͰίϧʔνϯͰ͸ ͳ͘BXBJUͰ͖Δʂ࠷ߴʂʂ  )551ϦΫΤετࣦഊ👉8FCϖʔδͳͷͰ$034ରԠ͕ඞཁ  ඪ४ͷ.JDSPQIPOF࢖͑ͣ👉༗ঈΞηοτʮ.JDSPQIPOF8FC(--JCSBSZʯʹཔΔ  ϒϥ΢β࣮ߦ࣌ͷΈϚΠΫͷϓνϊΠζൃੜɺԻ੠ೝࣝͷ๦͛ʹ👉ϊΠζͷಛ௃Λ௫ΜͰ࿥Իର৅֎ ͱ͢Δॲཧ  ϚΠΫೖྗ͕ )[Ͱ࿥ԻͰ͖ͣ👉)[ͱͯ͠ରԠɻݪҼෆ໌ɻɻ  "VEJP$MJQ(FU%BUB ࢖༻ෆՄɻ࿥ԻσʔλΛѻ͑ͣ👉6OJUZͷαϯϓϦϯάσʔλΛ8BWʹಠࣗม׵  %PXOMPBE)BOEMFS"VEJP$MJQ(FU$POUFOU ΋࢖༻ෆՄɻԻ੠ಡΈ্͛σʔλΛ࠶ੜͰ͖ͣ👉1$. σʔλ͔Β"VEJP$MJQ$MFBUF Ͱੜ੒  .1ͳͲѹॖԻݯ࠶ੜͰ͖ͳ͍ͨΊ554ͷμ΢ϯϩʔυαΠζେ👉αϯϓϦϯάϨʔτΛ )[ ͔Β )[ʹԼ͛ͯ൒ݮ  Ի੠ؔ࿈ͷ੍໿ͰϦοϓγϯΫ΋Ͱ͖ͣ👉༗ঈΞηοτʮ4"-4"ʯ ʮ"NQMJUVEFʯʹཔΔ  ೔ຊޠ͕6*ʹදࣔ͞Εͳ͍👉ϑΥϯτϑΥʔϧόοΫ͠ͳ͍͜ͱ͕ݪҼɻ೔ຊޠϑΥϯτಋೖ
  14. -*''ͱ8FC(-ͷ૬ޓӡ༻5JQTʢਤղʣ 6OJUZεΫϦϓτ KTMJC ൃ৴தը໘ϒϥ΢β+4 -*/& όοΫΤϯυΞϓϦ 3FRVJSF-JGG5PLFO TFTTJPO4UPSBHF l -*''ॳظԽ࣌ͷϦμΠϨΫτΛߟྀ͠ɺ6OJUZΞϓϦΛϩʔυ͠ͳ͍ঢ়ଶͰॳظԽˍτʔΫϯΛऔಘ

    l 6OJUZ8FC(-ͷϒϥ΢βεΫϦϓτ૬ޓӡ༻ͷػೳʢKTMJCʣΛར༻͠ϒϥ΢β͔ΒτʔΫϯΛऔಘ l όοΫΤϯυଆʹτʔΫϯΛ౉ͯ͠ݕূɺϢʔβʔ৘ใͳͲΛ༻͍ͯ೚ҙͷॲཧΛ࣮ߦ l ௨࿩தը໘Ͱ͸JOJU ͍ͯ͠ͳ͍ͷͰػೳར༻ʹ੍໿͋Γͷ͸ͣʢະݕূɻJGSBNFͰରԠ͔ͳʁʣ τʔΫϯݕূ Ϣʔβʔ৘ใ ػೳ΁ͷॲཧཁٻʢXJUIτʔΫϯʣ ػೳॲཧʢϢʔβʔʹඥ͚ͮ ͨϦϚΠϯυొ࿥ͳͲʣ MJGGJOJU ͱ MJGGHFU"DDFTT5PLFO "DDFTT5PLFO TFU*UFN ௨࿩தը໘ϒϥ΢β+4 HFU*UFN "DDFTT5PLFO TFOE-JGG5PLFO TFU-JGG5PLFO Ϩεϙϯεʢൃ࿩จݴΞχϝʔγϣϯʣ IUUQTEFWFMPQFSTMJOFCJ[KBEPDTMJGGPQFOJOHMJGGBQQSFEJSFDUGMPX 4FFBMTP -*''63-ʹΞΫηε͔ͯ͠Β-*''ΞϓϦ͕։͘·Ͱͷಈ࡞ʹ͍ͭͯ
  15. -*''ͱ8FC(-ͷ૬ޓӡ༻5JQTʢίʔυʣ <script> window.liff = liff; window.sendLiffToken = function() { var

    liffToken = window.sessionStorage.getItem("LiffAccessToken"); unityInstance.SendMessage("Cygnet_MidiDress", "SetLiffToken", liffToken); } </script> 6OJUZεΫϦϓτ KTMJC using System.Runtime.InteropServices; using UnityEngine; public class LiffController : MonoBehaviour { [DllImport("__Internal")] private static extern void RequireLiffToken(); public string LiffAccessToken { private set; get; } private void Start() { // Request to HTML to call SetLiffToken RequireLiffToken(); } // HTML calls this method to pass the liff token public void SetLiffToken(string liffToken) { LiffAccessToken = liffToken; } } mergeInto(LibraryManager.library, { CloseLiffWindow: function () { window.liff.closeWindow(); }, RequireLiffToken: function () { window.sendLiffToken(); } }); ϒϥ΢β+4
  16. ·ͱΊ l-*/&ͱ͍͏ίϛϡχέʔγϣϯΞϓϦͷதͰͷΩϟϥΫλʔ ର࿩ʹ͸ແݶͷՄೳੑ lωΠςΟϒˠ8FC(-Խ͸ϋϚΓͲ͜Ζଟ͠ɻ࠷ॳ͔Β8FC(- ϕʔεͰਐΊΔ͜ͱΛΦεεϝ l࠷ޙʹখωλɿ-*''͸Ի੠ͷࣗಈ࠶ੜΛڐՄɻॿ͔Δ l&OKPZDSFBUJOHBQQPO-*/&1MBUGPSN

  17. ͝੩ௌ͋Γ͕ͱ͏͍͟͝·ͨ͠👋 ߨԋ಺༰͸ݸਓͷݟղͰ͋Γɺॴଐ͢Δ૊৫ͷެࣜݟղͰ͸͋Γ·ͤΜɻ うえぞう(植⽊ 悠⼆) VF[P !VF[PDIBO