view Assets/Application/Scripts/Eye.cs @ 11:cf20add31466

change putAttribute -> use fmap.
author Kazuma Takeda
date Sat, 28 Jan 2017 19:15:44 +0900
parents 2dd40b4412e4
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);
		}
	}
}