超初心者向け!ハコスコ×Unity=簡単VR

 超初心者向け!ハコスコ×Unity=簡単VR

Unityインストールから始める、ハコスコを使ったUnityハンズオンセミナーの資料です。

A3462b9e5802cfb289c6295316410150?s=128

Makoto Ito

July 08, 2016
Tweet

Transcript

  1. ϋίεί(PPHMF$BSECPBSE Λ࢖ͬͨεϚϗ73ϋϯζΦϯ ηϛφʔ  6OJUZϏΪφʔϋϯζΦϯηϛφʔ!෋࢜ IUUQCJUMZ6WO9U 

  2. αϯϓϧϓϩδΣΫτΛ։͘ 

  3. ϓϩδΣΫτϑΝΠϧΛ64#͔Β σεΫτοϓʹίϐʔͯ͠ల։ ͦΕͧΕJ04"OESPJE޲͚ͰϑΥϧμ͕ʣ 

  4. ϓϩδΣΫτϑΝΠϧΛ։͘ 

  5. 6OJUZը໘ ىಈ௚ޙ 

  6. ϨΠΞ΢τΛมߋ 

  7. #VOEMF*EFOUJpFSΛมߋ ࠷ॳ͔Β͋Δ໊લ͔Βɺಠࣗͷ໊લʹมߋ 

  8. "OESPJEͷϏϧυ 

  9. લ४උ w ʮ"OESPJE4%,#VJMEUPPMTʯΞϯΠϯετʔ ϧͯ͠ʮ"OESPJE4%,#VJMEUPPMTʯʹΠ ϯετʔϧ͢Δ ԼهαΠτࢀর  w IUUQTUNCMSDP;L5E-W+RD w

    "OESPJEͷzઃఆzˠz։ൃऀ޲͚zˠz64#σόοάz ΛΦϯ w "OESPJEΛ64#Ͱ1$ͱͭͳ͙ 
  10. ࢼ͠ʹϏϧυͯ͠ΈΔ 

  11. J04ͷϏϧυ 

  12. લ४උ w J04Λ64#Ͱ1$ͱͭͳ͙ w 9DPEF͸Πϯετʔϧ͓ͯ͘͠ 

  13. ࢼ͠ʹϏϧυͯ͠ΈΔ 64#έʔϒϧͰJ04ʹͭͳ͛Δ 

  14. ࢼ͠ʹϏϧυͯ͠ΈΔ సૹ࣌ʹ͸ϩοΫղআ͓ͯ͘͠ 

  15. ϋίείΞϓϦ࣮૷ɹ ʙॳڃฤʙ 

  16. ৽نγʔϯͷηοτΞοϓ 

  17. ஍ฏΛ࡞Δ 

  18. ஍ฏͷ৽نϚςϦΞϧΛ࡞Δ 

  19. ஍ฏͷ৽نϚςϦΞϧΛ࡞Δ 

  20. 4%ϢχςΟͪΌΜొ৔ 

  21. 4%ϢχςΟͪΌΜઃఆ Ґஔͷมߋͱෆඞཁͳ߲໨Λఀࢭ 

  22. (PPHMF73ͷΧϝϥΛར༻ ݩʑ͋ͬͨΧϝϥ͸ෆඞཁͳͷͰফ͢ 

  23. ࢼ͠ʹϓϨΠͯ͠ΈΔ Ϗϧυ͢Δલʹ&EJUPS্Ͱ֬ೝ 

  24. ࢼ͠ʹϏϧυͯ͠ΈΔ Ϗϧυ͢ΔγʔϯΛ4UFQʹมߋ 

  25. ࢼ͠ʹϏϧυͯ͠ΈΔ ࣮ػʹసૹ͞ΕΔ  64#Ͱͭͳ͍࣮ͩػʹసૹ͞ΕΔ

  26. $PNQPOFOUͷ௥Ճʢํ๏ͦͷϝχϡʔ͔Βʣ ϢχςΟͪΌΜͷࢹઢͷিಥ൑ఆ෦෼Λ௥Ճ ࢹઢ͕$PMMJEFSʹ൓Ԡͨ͠Βস͏Α͏ʹ͍ͨ͠ 

  27. $PNQPOFOUͷ௥Ճʢํ๏ͦͷ̎εΫϦϓτΛ%%ʣ ࢹઢ൓ԠεΫϦϓτΛ௥Ճ ࢹઢ͕$PMMJEFSʹ൓Ԡͨ͠Βস͏Α͏ʹ͍ͨ͠ 

  28. $PNQPOFOUͷ௥Ճʢํ๏ͦͷ"EE$PNQPOFOU͔Βʣ সإʹ͢Δࣗ࡞εΫϦϓτͷ਽ܗΛ௥Ճ ࢹઢ͕$PMMJEFSʹ൓Ԡͨ͠Βস͏Α͏ʹ͍ͨ͠ 

  29. εΫϦϓτͷฤू ৽ن௥Ճͨ͠εΫϦϓτΛฤू 

  30. εΫϦϓτͷฤू ্هεΫϦϓτΛଧͪࠐΉ using UnityEngine;
 using System.Collections;
 using VRStandardAssets.Utils; // VRStandardAssets.Utils໊લۭ͕ؒར༻Ͱ͖ΔΑ͏ʹ௥Ճ


    
 public class SmileInteractive : MonoBehaviour {
 
 VRInteractiveItem interactiveItem; // SD_unitychan ʹ͋ΔVRInteractiveItemΛ࢖͑ΔΑ͏ʹ
 Animator anim; // SD_unitychan ͷإΞχϝʔγϣϯΛมߋͰ͖ΔΑ͏ʹ
 
 void Awake () // StartͩͱɺOnEnable ʹؒʹ߹Θͳ͍ͷͰɺAwakeͰ
 {
 interactiveItem = GetComponent<VRInteractiveItem>(); // ಉ͡ΦϒδΣΫτதͷVRInteractiveItemΛरͬͯ͘Δ
 anim = GetComponent<Animator> (); // ಉ͡ΦϒδΣΫτதͷAnimatorΛरͬͯ͘Δ
 }
 
 private void OnEnable () // ར༻Մೳʹͳͬͨࡍʹݺ͹ΕΔ
 {
 interactiveItem.OnOver += Smile; // Ϛ΢εΦʔόʔͨ࣌͠ͷΠϕϯτؔ਺Smile Λ௥Ճ
 interactiveItem.OnOut += Normal; // Ϛ΢ε͕֎Εͨ࣌ͷΠϕϯτؔ਺Normal Λ௥Ճ
 }
 
 private void OnDisable () // ࠷ޙʹݺ͹ΕΔ
 {
 interactiveItem.OnOver -= Smile; // OnEnable Ͱ௥Ճͨ͠΋ͷͷޙ࢝຤
 interactiveItem.OnOut -= Normal; // ಉ্
 }
 
 private void Smile() // Πϕϯτؔ਺
 {
 anim.CrossFade("smile@sd_hmd", 0); // smileΞχϝʔγϣϯʹมߋ
 anim.SetLayerWeight (1, 1);
 }
 
 private void Normal() // Πϕϯτؔ਺
 {
 anim.CrossFade("default@sd_hmd", 0); // ௨ৗΞχϝʔγϣϯʹมߋ
 anim.SetLayerWeight (1, 1);
 }
 } 
  31. ࢹ఺Λ߹ΘͤΔͱসإΛ֬ೝ εΫϦϓτ͕ͪΌΜͱಈ͍͍ͯΔ͔ͷ֬ೝ 

  32. ग़དྷ্͕ΓΛ࣮ػͰ֬ೝ 

  33. ϋίείΞϓϦ࣮૷ ʙνϟϨϯδฤʙ 

  34. 'MZFSͷඈߦػΛϢχςΟͪΌΜ ʹมߋͯ͠ΈΑ͏ w 7FIJDMFTͷ'MZFS1MBZFSTIJQͷ'MZFS1MBZFSTIJQͷ୅ ΘΓʹ4%@VOJUZDIBO@IVNBOPJE w ͪΐͬͱ܏͚ΔͱͦΕͬΆ͍ w Ξχϝʔγϣϯ͸੾ͬͯ΋͍͍ w

    εέʔϧม͑ͨํ͕͍͍͔΋ w ҉͍ͷͰϥΠτΛ౰ͯΔ 
  35. 'MZFSΛࢀߟʹͯ͠5FNQMF3VOత ͳήʔϜʹมߋ w ஍ฏ໘Λ࡞Δ w :࣠ͷҠಈ͸͠ͳ͍Α͏ʹ w ૸ΔΞχϝʔγϣϯ w ্Λ޲͘ͱδϟϯϓͱ͔

    w ԼΛ޲͘ͱεϥΠσΟϯάͱ͔ 
  36. ΦϦδφϧ73ήʔϜͷ੡࡞