Mercurial > hg > Members > kazuma > JungleforUnity
annotate Assets/Application/Scripts/Eye.cs @ 13:e297afe0889d default tip
Add Prefab.
author | Kazuma Takeda |
---|---|
date | Tue, 07 Feb 2017 20:49:26 +0900 |
parents | 2dd40b4412e4 |
children |
rev | line source |
---|---|
3 | 1 using UnityEngine; |
2 using System.Collections; | |
3 | |
4 public class Eye : MonoBehaviour { | |
5 | |
6 // Update is called once per frame | |
7 void Update () { | |
8 RaycastHit hit; | |
9 if (Physics.Raycast (transform.position, transform.forward * 10, out hit)) { // Select picture. | |
10 Player.Instance.SetLookedObject (hit.collider.gameObject); | |
11 } else { | |
12 Player.Instance.SetLookedObject (null); | |
13 } | |
14 } | |
15 } |