Mercurial > hg > Members > kazuma > JungleforUnity
comparison Assets/Application/Scripts/Eye.cs @ 3:2dd40b4412e4
Create game base.
author | Kazuma |
---|---|
date | Mon, 07 Nov 2016 18:42:01 +0900 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
2:ca28bf83fc89 | 3:2dd40b4412e4 |
---|---|
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 } |