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

UnityとハコスコでVRゲーム開発

 UnityとハコスコでVRゲーム開発

Makoto Ito

June 28, 2016
Tweet

More Decks by Makoto Ito

Other Decks in Technology

Transcript

  1. εΫϦϓτͷฤू ্هεΫϦϓτΛଧͪࠐΉ 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);
 }
 }  ࢹ఺Λ߹ΘͤΔͱসإΛ֬ೝ εΫϦϓτ͕ͪΌΜͱಈ͍͍ͯΔ͔ͷ֬ೝ 
  2. 'MZFSͷඈߦػΛϢχςΟͪΌ Μʹมߋͯ͠ΈΑ͏ w 7FIJDMFTͷ'MZFS1MBZFSTIJQͷ'MZFS1MBZFSTIJQͷ୅ ΘΓʹ4%@VOJUZDIBO@IVNBOPJE w ͪΐͬͱ܏͚ΔͱͦΕͬΆ͍ w Ξχϝʔγϣϯ͸੾ͬͯ΋͍͍ w

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