diff 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 diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/Assets/Application/Scripts/Eye.cs	Mon Nov 07 18:42:01 2016 +0900
@@ -0,0 +1,15 @@
+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);
+		}
+	}
+}