$30 off During Our Annual Pro Sale. View Details »

ARコンテンツ作成勉強会:VuforiaでつくるスマホAR+VRアプリ

shinjism
October 13, 2018

 ARコンテンツ作成勉強会:VuforiaでつくるスマホAR+VRアプリ

Unity Asset Storeで公開されているVuforia AR+VR Sampleを用いたスマホアプリ作成ハンズオンでのスライド

shinjism

October 13, 2018
Tweet

More Decks by shinjism

Other Decks in Technology

Transcript

  1. View Slide

  2. View Slide

  3. View Slide

  4. View Slide

  5. View Slide

  6. View Slide

  7. View Slide

  8. View Slide

  9. View Slide

  10. View Slide

  11. View Slide

  12. View Slide

  13. View Slide





  14. View Slide





  15. View Slide

  16. View Slide

  17. View Slide

  18. View Slide

  19. View Slide

  20. View Slide

  21. View Slide

  22. View Slide

  23. View Slide

  24. View Slide

  25. View Slide

  26. View Slide

  27. View Slide

  28. View Slide



  29. View Slide




  30. View Slide

  31. View Slide

  32. View Slide




  33. View Slide


  34. View Slide

  35. View Slide



  36. View Slide

  37. View Slide

  38. View Slide





  39. View Slide

  40. View Slide

  41. View Slide

  42. View Slide

  43. View Slide



  44. View Slide

  45. View Slide

  46. View Slide

  47. View Slide

  48. View Slide

  49. View Slide

  50. View Slide

  51. View Slide

  52. View Slide

  53. View Slide

  54. View Slide

  55. View Slide

  56. View Slide

  57. View Slide

  58. View Slide

  59. View Slide

  60. View Slide

  61. View Slide

  62. View Slide

  63. View Slide

  64. View Slide

  65. View Slide

  66. View Slide

  67. View Slide

  68. View Slide

  69. View Slide

  70. View Slide

  71. View Slide

  72. /* 省略 */
    public class UserHeadRotation : MonoBehaviour {
    // オブジェクトが有効になった時に1度だけ呼ばれる関数
    void Start () {
    }
    // フレームが更新される度に呼ばれる関数
    void Update () {
    }
    }

    View Slide

  73. /* 省略 */
    public class UserHeadRotation : MonoBehaviour {
    // オブジェクトが有効になった時に1度だけ呼ばれる関数
    void Start () {
    }
    // フレームが更新される度に呼ばれる関数
    void Update () {
    // 左右キーの入力を受け取る
    // 上下キーの入力を受け取る
    // X軸とY軸を回転させる
    }
    }

    View Slide

  74. /* 省略 */
    public class UserHeadRotation : MonoBehaviour {
    // オブジェクトが有効になった時に1度だけ呼ばれる関数
    void Start () {
    }
    // フレームが更新される度に呼ばれる関数
    void Update () {
    // 左右キーの入力を受け取る
    // 上下キーの入力を受け取る
    // X軸とY軸を回転させる
    }
    }

    View Slide

  75. View Slide

  76. /* 省略 */
    public class UserHeadRotation : MonoBehaviour {
    // オブジェクトが有効になった時に1度だけ呼ばれる関数
    void Start () {
    }
    // フレームが更新される度に呼ばれる関数
    void Update () {
    // 左右キーの入力を受け取る
    float y = Input.GetAxis("Horizontal");
    // 上下キーの入力を受け取る
    // X軸とY軸を回転させる
    }
    }

    View Slide

  77. /* 省略 */
    public class UserHeadRotation : MonoBehaviour {
    // オブジェクトが有効になった時に1度だけ呼ばれる関数
    void Start () {
    }
    // フレームが更新される度に呼ばれる関数
    void Update () {
    // 左右キーの入力を受け取る
    float y = Input.GetAxis("Horizontal");
    // 上下キーの入力を受け取る
    // X軸とY軸を回転させる
    }
    }

    View Slide

  78. View Slide

  79. /* 省略 */
    public class UserHeadRotation : MonoBehaviour {
    // オブジェクトが有効になった時に1度だけ呼ばれる関数
    void Start () {
    }
    // フレームが更新される度に呼ばれる関数
    void Update () {
    // 左右キーの入力を受け取る
    float y = Input.GetAxis("Horizontal");
    // 上下キーの入力を受け取る
    float x = Input.GetAxis("Vertical") * -1;
    // X軸とY軸を回転させる
    }
    }

    View Slide

  80. /* 省略 */
    public class UserHeadRotation : MonoBehaviour {
    // オブジェクトが有効になった時に1度だけ呼ばれる関数
    void Start () {
    }
    // フレームが更新される度に呼ばれる関数
    void Update () {
    // 左右キーの入力を受け取る
    float y = Input.GetAxis("Horizontal");
    // 上下キーの入力を受け取る
    float x = Input.GetAxis("Vertical") * -1;
    // X軸とY軸を回転させる
    }
    }

    View Slide

  81. /* 省略 */
    public class UserHeadRotation : MonoBehaviour {
    // オブジェクトが有効になった時に1度だけ呼ばれる関数
    void Start () {
    }
    // フレームが更新される度に呼ばれる関数
    void Update () {
    // 左右キーの入力を受け取る
    float y = Input.GetAxis("Horizontal");
    // 上下キーの入力を受け取る
    float x = Input.GetAxis("Vertical") * -1;
    // X軸とY軸を回転させる
    transform.Rotate(x, y, 0);
    }
    }

    View Slide

  82. /* 省略 */
    public class UserHeadRotation : MonoBehaviour {
    // オブジェクトが有効になった時に1度だけ呼ばれる関数
    void Start () {
    }
    // フレームが更新される度に呼ばれる関数
    void Update () {
    // 左右キーの入力を受け取る
    float y = Input.GetAxis("Horizontal");
    // 上下キーの入力を受け取る
    float x = Input.GetAxis("Vertical") * -1;
    // X軸とY軸を回転させる
    transform.Rotate(x, y, 0);
    }
    }

    View Slide

  83. /* 省略 */
    public class UserHeadRotation : MonoBehaviour {
    // オブジェクトが有効になった時に1度だけ呼ばれる関数
    void Start () {
    }
    // フレームが更新される度に呼ばれる関数
    void Update () {
    // 左右キーの入力を受け取る
    float y = Input.GetAxis("Horizontal");
    // 上下キーの入力を受け取る
    float x = Input.GetAxis("Vertical") * -1;
    // X軸とY軸を回転させる
    transform.Rotate(x, y, 0);
    }
    }

    View Slide



  84. View Slide

  85. View Slide

  86. View Slide

  87. View Slide

  88. View Slide

  89. View Slide

  90. View Slide

  91. View Slide

  92. View Slide

  93. View Slide

  94. View Slide

  95. View Slide

  96. View Slide

  97. View Slide

  98. View Slide

  99. View Slide

  100. View Slide

  101. View Slide

  102. View Slide

  103. View Slide

  104. View Slide

  105. View Slide

  106. View Slide

  107. View Slide

  108. View Slide




  109. View Slide

  110. View Slide

  111. View Slide

  112. View Slide

  113. View Slide

  114. View Slide

  115. View Slide

  116. View Slide

  117. View Slide

  118. View Slide

  119. View Slide

  120. View Slide

  121. View Slide

  122. View Slide



  123. View Slide

  124. View Slide

  125. View Slide

  126. View Slide



  127. View Slide



  128. View Slide

  129. View Slide

  130. View Slide

  131. View Slide

  132. View Slide

  133. View Slide

  134. View Slide

  135. View Slide

  136. View Slide

  137. View Slide

  138. View Slide

  139. View Slide

  140. View Slide

  141. View Slide

  142. View Slide

  143. View Slide



  144. View Slide

  145. View Slide

  146. View Slide



  147. View Slide

  148. View Slide

  149. View Slide

  150. View Slide

  151. View Slide

  152. View Slide

  153. View Slide

  154. View Slide

  155. View Slide

  156. View Slide



  157. View Slide

  158. View Slide

  159. View Slide

  160. View Slide



  161. View Slide

  162. View Slide

  163. View Slide



  164. View Slide

  165. View Slide

  166. View Slide

  167. View Slide

  168. #region PUBLIC_MEMBER_VARIABLES
    static public bool isFullScreenMode = true;
    public GameObject[] AROnlyObjects;
    public GameObject[] VROnlyObjects;
    [Range(0.1f, 5.0f)]
    public float transitionDuration = 1.5f; // seconds
    public Canvas StereoViewDivider;
    public Animator m_Astronaut, m_Drone;
    public bool InAR { get { return mTransitionCursor <= 0.66f; } }
    #endregion PUBLIC_MEMBER_VARIABLES

    View Slide

  169. #region PUBLIC_MEMBER_VARIABLES
    static public bool isFullScreenMode = true;
    public GameObject[] AROnlyObjects;
    public GameObject[] VROnlyObjects;
    [Range(0.1f, 5.0f)]
    public float transitionDuration = 1.5f; // seconds
    public Canvas StereoViewDivider;
    public Animator m_Astronaut, m_Drone;
    public bool InAR { get { return mTransitionCursor <= 0.66f; } }
    #endregion PUBLIC_MEMBER_VARIABLES

    View Slide

  170. void UpdateVisibleObjects()
    {
    foreach (var go in VROnlyObjects)
    {
    go.SetActive(!InAR);
    }
    // Start Astronaut and Drone animations in VR mode
    if (!InAR)
    {
    if (m_Astronaut)
    {
    m_Astronaut.SetBool("IsDrilling", !InAR);
    }
    if (m_Drone != null)
    {
    m_Drone.SetBool("IsScanning", !InAR);
    m_Drone.SetBool("IsShowingLaser", !InAR);
    m_Drone.SetBool("IsFacingObject", !InAR);
    }
    }
    }

    View Slide

  171. void UpdateVisibleObjects()
    {
    foreach (var go in VROnlyObjects)
    {
    go.SetActive(!InAR);
    }
    // Start Astronaut and Drone animations in VR mode
    if (!InAR)
    {
    if (m_Astronaut)
    {
    m_Astronaut.SetBool("IsDrilling", !InAR);
    }
    if (m_Drone != null)
    {
    m_Drone.SetBool("IsScanning", !InAR);
    m_Drone.SetBool("IsShowingLaser", !InAR);
    m_Drone.SetBool("IsFacingObject", !InAR);
    }
    }
    }

    View Slide



  172. View Slide

  173. View Slide

  174. View Slide

  175. View Slide

  176. View Slide

  177. View Slide

  178. View Slide

  179. View Slide

  180. View Slide

  181. View Slide

  182. View Slide

  183. View Slide

  184. View Slide

  185. View Slide

  186. View Slide

  187. View Slide

  188. View Slide

  189. View Slide



  190. View Slide

  191. View Slide

  192. View Slide

  193. View Slide

  194. View Slide

  195. View Slide

  196. View Slide

  197. View Slide

  198. View Slide

  199. View Slide

  200. View Slide

  201. View Slide

  202. View Slide

  203. View Slide

  204. View Slide

  205. /* 省略 */
    public class SceneControllerScript : MonoBehaviour {
    /* 省略 */
    public void OnAssembleButton() {
    pt = 0f;
    panelFlag = !panelFlag;
    }
    // ドアを開ける関数
    // ドアを閉める関数
    }

    View Slide

  206. /* 省略 */
    public class SceneControllerScript : MonoBehaviour {
    /* 省略 */
    public void OnAssembleButton() {
    pt = 0f;
    panelFlag = !panelFlag;
    }
    // ドアを開ける関数
    public void OpenDoor () {
    dt = 0f;
    doorFlag = true;
    }
    // ドアを閉める関数
    public void CloseDoor () {
    dt = 1f;
    doorFlag = false;
    }
    }

    View Slide

  207. View Slide

  208. View Slide

  209. View Slide

  210. View Slide

  211. View Slide

  212. View Slide

  213. #region PRIVATE_MEMBER_VARIABLES
    float mFocusedTime;
    bool mTriggered;
    TransitionManager mTransitionManager;
    Transform cameraTransform;
    #endregion // PRIVATE_MEMBER_VARIABLES
    /* 省略 */
    // オブジェクトが有効になった時に1度だけ呼ばれる関数
    void Start()
    {
    cameraTransform = Camera.main.transform;
    mTransitionManager = FindObjectOfType();
    GetComponent().material = nonFocusedMaterial;
    }

    View Slide

  214. #region PRIVATE_MEMBER_VARIABLES
    float mFocusedTime;
    bool mTriggered;
    TransitionManager mTransitionManager;
    Transform cameraTransform;
    SceneControllerScript danbocchi;
    #endregion // PRIVATE_MEMBER_VARIABLES
    /* 省略 */
    // オブジェクトが有効になった時に1度だけ呼ばれる関数
    void Start()
    {
    cameraTransform = Camera.main.transform;
    mTransitionManager = FindObjectOfType();
    GetComponent().material = nonFocusedMaterial;
    danbocchi = GetComponent();
    }

    View Slide

  215. // フレームが更新される度に呼ばれる関数
    void Update()
    {
    /* 省略 */
    if (Focused)
    {
    // Update the "focused state" time
    mFocusedTime += Time.deltaTime;
    if ((mFocusedTime > activationTime) || startAction)
    {
    mTriggered = true;
    mFocusedTime = 0;
    // Activate transition from AR to VR or vice versa
    bool goingBackToAR = (triggerType == TriggerType.AR_TRIGGER);
    mTransitionManager.Play(goingBackToAR);
    StartCoroutine(
    ResetAfter(0.3f * mTransitionManager.transitionDuration)
    );
    }

    View Slide

  216. // フレームが更新される度に呼ばれる関数
    void Update()
    {
    /* 省略 */
    if (Focused)
    {
    // Update the "focused state" time
    mFocusedTime += Time.deltaTime;
    if ((mFocusedTime > activationTime) || startAction)
    {
    mTriggered = true;
    mFocusedTime = 0;
    // Activate transition from AR to VR or vice versa
    bool goingBackToAR = (triggerType == TriggerType.AR_TRIGGER);
    mTransitionManager.Play(goingBackToAR);
    StartCoroutine(
    ResetAfter(0.3f * mTransitionManager.transitionDuration)
    );
    }

    View Slide

  217. // フレームが更新される度に呼ばれる関数
    void Update()
    {
    /* 省略 */
    if (Focused)
    {
    // Update the "focused state" time
    mFocusedTime += Time.deltaTime;
    if ((mFocusedTime > activationTime) || startAction)
    {
    mTriggered = true;
    mFocusedTime = 0;
    // Activate transition from AR to VR or vice versa
    bool goingBackToAR = (triggerType == TriggerType.AR_TRIGGER);
    mTransitionManager.Play(goingBackToAR);
    StartCoroutine(
    ResetAfter(0.3f * mTransitionManager.transitionDuration)
    );
    }

    View Slide

  218. // フレームが更新される度に呼ばれる関数
    void Update()
    {
    /* 省略 */
    if (Focused)
    {
    // Update the "focused state" time
    mFocusedTime += Time.deltaTime;
    if ((mFocusedTime > activationTime) || startAction)
    {
    mTriggered = true;
    mFocusedTime = 0;
    // Activate transition from AR to VR or vice versa
    bool goingBackToAR = (triggerType == TriggerType.AR_TRIGGER);
    mTransitionManager.Play(goingBackToAR);
    StartCoroutine(
    ResetAfter(0.3f * mTransitionManager.transitionDuration)
    );
    }

    View Slide

  219. // フレームが更新される度に呼ばれる関数
    void Update()
    {
    /* 省略 */
    if (Focused)
    {
    // Update the "focused state" time
    mFocusedTime += Time.deltaTime;
    if ((mFocusedTime > activationTime) || startAction)
    {
    mTriggered = true;
    mFocusedTime = 0;
    // Activate transition from AR to VR or vice versa
    bool goingBackToAR = (triggerType == TriggerType.AR_TRIGGER);
    mTransitionManager.Play(goingBackToAR);
    StartCoroutine(
    ResetAfter(0.3f * mTransitionManager.transitionDuration)
    );
    }

    View Slide

  220. // フレームが更新される度に呼ばれる関数
    void Update()
    {
    /* 省略 */
    if (Focused)
    {
    // Update the "focused state" time
    mFocusedTime += Time.deltaTime;
    if ((mFocusedTime > activationTime) || startAction)
    {
    mTriggered = true;
    mFocusedTime = 0;
    danbocchi.OpenDoor();
    // Activate transition from AR to VR or vice versa
    bool goingBackToAR = (triggerType == TriggerType.AR_TRIGGER);
    mTransitionManager.Play(goingBackToAR);
    StartCoroutine(
    ResetAfter(0.3f * mTransitionManager.transitionDuration)
    );
    }

    View Slide



  221. View Slide

  222. View Slide

  223. View Slide

  224. // フレームが更新される度に呼ばれる関数
    void Update()
    {
    /* 省略 */
    if (Focused)
    {
    // Update the "focused state" time
    mFocusedTime += Time.deltaTime;
    if ((mFocusedTime > activationTime) || startAction)
    {
    mTriggered = true;
    mFocusedTime = 0;
    danbocchi.OpenDoor();
    // Activate transition from AR to VR or vice versa
    bool goingBackToAR = (triggerType == TriggerType.AR_TRIGGER);
    mTransitionManager.Play(goingBackToAR);
    StartCoroutine(
    ResetAfter(0.3f * mTransitionManager.transitionDuration)
    );
    }

    View Slide

  225. #region PRIVATE_METHODS
    private void UpdateMaterials(bool focused)
    {
    /* 省略 */
    }
    private IEnumerator ResetAfter(float seconds)
    {
    /* 省略 */
    }
    #endregion // PRIVATE_METHODS

    View Slide

  226. #region PRIVATE_METHODS
    private void UpdateMaterials(bool focused)
    {
    /* 省略 */
    }
    private IEnumerator TransitionXRMode()
    {
    // ドアを開く
    // ドアが開くまで待つ(1秒待機)
    // AR←→VRの移行
    }
    private IEnumerator ResetAfter(float seconds)
    {
    /* 省略 */
    }
    #endregion // PRIVATE_METHODS

    View Slide

  227. #region PRIVATE_METHODS
    private void UpdateMaterials(bool focused)
    {
    /* 省略 */
    }
    private IEnumerator TransitionXRMode()
    {
    // ドアを開く
    // ドアが開くまで待つ(1秒待機)
    // AR←→VRの移行
    }
    private IEnumerator ResetAfter(float seconds)
    {
    /* 省略 */
    }
    #endregion // PRIVATE_METHODS

    View Slide

  228. #region PRIVATE_METHODS
    private void UpdateMaterials(bool focused)
    {
    /* 省略 */
    }
    private IEnumerator TransitionXRMode()
    {
    // ドアを開く
    danbocchi.OpenDoor();
    // ドアが開くまで待つ(1秒待機)
    // AR←→VRの移行
    }
    private IEnumerator ResetAfter(float seconds)
    {
    /* 省略 */
    }
    #endregion // PRIVATE_METHODS

    View Slide

  229. #region PRIVATE_METHODS
    private void UpdateMaterials(bool focused)
    {
    /* 省略 */
    }
    private IEnumerator TransitionXRMode()
    {
    // ドアを開く
    danbocchi.OpenDoor();
    // ドアが開くまで待つ(1秒待機)
    // AR←→VRの移行
    }
    private IEnumerator ResetAfter(float seconds)
    {
    /* 省略 */
    }
    #endregion // PRIVATE_METHODS

    View Slide

  230. #region PRIVATE_METHODS
    private void UpdateMaterials(bool focused)
    {
    /* 省略 */
    }
    private IEnumerator TransitionXRMode()
    {
    // ドアを開く
    danbocchi.OpenDoor();
    // ドアが開くまで待つ(1秒待機)
    // AR←→VRの移行
    bool goingBackToAR = (triggerType == TriggerType.AR_TRIGGER);
    mTransitionManager.Play(goingBackToAR);
    StartCoroutine(
    ResetAfter(0.3f * mTransitionManager.transitionDuration)
    );
    }
    private IEnumerator ResetAfter(float seconds)
    {
    /* 省略 */
    }
    #endregion // PRIVATE_METHODS

    View Slide

  231. #region PRIVATE_METHODS
    private void UpdateMaterials(bool focused)
    {
    /* 省略 */
    }
    private IEnumerator TransitionXRMode()
    {
    // ドアを開く
    danbocchi.OpenDoor();
    // ドアが開くまで待つ(1秒待機)
    // AR←→VRの移行
    bool goingBackToAR = (triggerType == TriggerType.AR_TRIGGER);
    mTransitionManager.Play(goingBackToAR);
    StartCoroutine(
    ResetAfter(0.3f * mTransitionManager.transitionDuration)
    );
    }
    private IEnumerator ResetAfter(float seconds)
    {
    /* 省略 */
    }
    #endregion // PRIVATE_METHODS

    View Slide

  232. #region PRIVATE_METHODS
    private void UpdateMaterials(bool focused)
    {
    /* 省略 */
    }
    private IEnumerator TransitionXRMode()
    {
    // ドアを開く
    danbocchi.OpenDoor();
    // ドアが開くまで待つ(1秒待機)
    yield return new WaitForSeconds(1.0f);
    // AR←→VRの移行
    bool goingBackToAR = (triggerType == TriggerType.AR_TRIGGER);
    mTransitionManager.Play(goingBackToAR);
    StartCoroutine(
    ResetAfter(0.3f * mTransitionManager.transitionDuration)
    );
    }
    private IEnumerator ResetAfter(float seconds)
    {
    /* 省略 */
    }
    #endregion // PRIVATE_METHODS

    View Slide

  233. // フレームが更新される度に呼ばれる関数
    void Update()
    {
    /* 省略 */
    if (Focused)
    {
    // Update the "focused state" time
    mFocusedTime += Time.deltaTime;
    if ((mFocusedTime > activationTime) || startAction)
    {
    mTriggered = true;
    mFocusedTime = 0;
    danbocchi.OpenDoor();
    // Activate transition from AR to VR or vice versa
    bool goingBackToAR = (triggerType == TriggerType.AR_TRIGGER);
    mTransitionManager.Play(goingBackToAR);
    StartCoroutine(
    ResetAfter(0.3f * mTransitionManager.transitionDuration)
    );
    }

    View Slide

  234. // フレームが更新される度に呼ばれる関数
    void Update()
    {
    /* 省略 */
    if (Focused)
    {
    // Update the "focused state" time
    mFocusedTime += Time.deltaTime;
    if ((mFocusedTime > activationTime) || startAction)
    {
    mTriggered = true;
    mFocusedTime = 0;
    danbocchi.OpenDoor();
    // Activate transition from AR to VR or vice versa
    bool goingBackToAR = (triggerType == TriggerType.AR_TRIGGER);
    mTransitionManager.Play(goingBackToAR);
    StartCoroutine(
    ResetAfter(0.3f * mTransitionManager.transitionDuration)
    );
    }

    View Slide

  235. // フレームが更新される度に呼ばれる関数
    void Update()
    {
    /* 省略 */
    if (Focused)
    {
    // Update the "focused state" time
    mFocusedTime += Time.deltaTime;
    if ((mFocusedTime > activationTime) || startAction)
    {
    mTriggered = true;
    mFocusedTime = 0;
    // AR←→VR移行をコルーチンとして呼び出す
    }

    View Slide

  236. // フレームが更新される度に呼ばれる関数
    void Update()
    {
    /* 省略 */
    if (Focused)
    {
    // Update the "focused state" time
    mFocusedTime += Time.deltaTime;
    if ((mFocusedTime > activationTime) || startAction)
    {
    mTriggered = true;
    mFocusedTime = 0;
    // AR←→VR移行をコルーチンとして呼び出す
    StartCoroutine(TransitionXRMode());
    }

    View Slide



  237. View Slide

  238. View Slide

  239. View Slide

  240. #region PRIVATE_METHODS
    private void UpdateMaterials(bool focused)
    {
    /* 省略 */
    }
    private IEnumerator TransitionXRMode()
    {
    // ドアを開く
    danbocchi.OpenDoor();
    // ドアが開くまで待つ(1秒待機)
    yield return new WaitForSeconds(1.0f);
    // AR←→VRの移行
    bool goingBackToAR = (triggerType == TriggerType.AR_TRIGGER);
    mTransitionManager.Play(goingBackToAR);
    StartCoroutine(
    ResetAfter(0.3f * mTransitionManager.transitionDuration)
    );
    }
    private IEnumerator ResetAfter(float seconds)
    {
    /* 省略 */
    }
    #endregion // PRIVATE_METHODS

    View Slide

  241. private IEnumerator ResetAfter(float seconds)
    {
    Debug.Log("Resetting View trigger after: " + seconds);
    yield return new WaitForSeconds(seconds);
    Debug.Log("Resetting View trigger: " + name);
    // Reset variables
    mTriggered = false;
    mFocusedTime = 0;
    Focused = false;
    UpdateMaterials(false);
    }

    View Slide

  242. private IEnumerator ResetAfter(float seconds)
    {
    Debug.Log("Resetting View trigger after: " + seconds);
    yield return new WaitForSeconds(seconds);
    Debug.Log("Resetting View trigger: " + name);
    // ドアを閉じる
    // Reset variables
    mTriggered = false;
    mFocusedTime = 0;
    Focused = false;
    UpdateMaterials(false);
    }

    View Slide

  243. private IEnumerator ResetAfter(float seconds)
    {
    Debug.Log("Resetting View trigger after: " + seconds);
    yield return new WaitForSeconds(seconds);
    Debug.Log("Resetting View trigger: " + name);
    // ドアを閉じる
    danbocchi.CloseDoor();
    // Reset variables
    mTriggered = false;
    mFocusedTime = 0;
    Focused = false;
    UpdateMaterials(false);
    }

    View Slide



  244. View Slide

  245. View Slide

  246. View Slide

  247. View Slide

  248. View Slide



  249. View Slide

  250. View Slide

  251. View Slide

  252. View Slide

  253. View Slide

  254. View Slide

  255. View Slide

  256. View Slide

  257. /* 省略 */
    public class SceneControllerScript : MonoBehaviour {
    /* 省略 */
    public void OnAssembleButton() {
    pt = 0f;
    panelFlag = !panelFlag;
    }
    // ドアを開ける関数
    public void OpenDoor () {
    dt = 0f;
    doorFlag = true;
    }
    // ドアを閉める関数
    public void CloseDoor () {
    dt = 1f;
    doorFlag = false;
    }
    }

    View Slide

  258. /* 省略 */
    public class SceneControllerScript : MonoBehaviour {
    /* 省略 */
    public void OnAssembleButton() {
    pt = 0f;
    panelFlag = !panelFlag;
    }
    // ドアを開ける関数
    public void OpenDoor () {
    dt = 0f;
    doorFlag = true;
    GetComponent().Play();
    }
    // ドアを閉める関数
    public void CloseDoor () {
    dt = 1f;
    doorFlag = false;
    }
    }

    View Slide



  259. View Slide

  260. View Slide

  261. View Slide

  262. View Slide





  263. View Slide

  264. View Slide

  265. View Slide

  266. View Slide

  267. View Slide



  268. View Slide

  269. View Slide

  270. View Slide

  271. View Slide

  272. View Slide

  273. View Slide

  274. View Slide

  275. View Slide

  276. View Slide



  277. View Slide




  278. View Slide

  279. View Slide



  280. View Slide

  281. View Slide

  282. View Slide

  283. View Slide

  284. View Slide

  285. View Slide

  286. View Slide

  287. View Slide

  288. View Slide

  289. View Slide

  290. ◼ ◼

    View Slide

  291. View Slide

  292. View Slide




  293. View Slide