Mercurial > hg > Members > kazuma > JungleforUnity
view Assets/Application/Scripts/Eye.cs @ 3:2dd40b4412e4
Create game base.
author | Kazuma |
---|---|
date | Mon, 07 Nov 2016 18:42:01 +0900 |
parents | |
children |
line wrap: on
line source
using UnityEngine; using System.Collections; public class Eye : MonoBehaviour { // Update is called once per frame void Update () { RaycastHit hit; if (Physics.Raycast (transform.position, transform.forward * 10, out hit)) { // Select picture. Player.Instance.SetLookedObject (hit.collider.gameObject); } else { Player.Instance.SetLookedObject (null); } } }