Quantcast
Channel: Questions in topic: "ios"
Viewing all articles
Browse latest Browse all 4709

Input across scripts

$
0
0
Hello. I have been trying to read input from a ui. Basically, I want my camera to know when a gameobject with a guitexture has been touched ( I am developing for mobile, more specifically, ios). My guitexture knows when it has been touched, but I need a way to send the information that the gameobject has been clicked across scripts. Do I use a global variable? My script is in c#, named Test, and is: using UnityEngine; using System.Collections; public class Test: MonoBehaviour { void OnMouseDown() { Debug.Log ("Mouse Down"); } void OnMouseUp() { Debug.Log ("Mouse up"); } } ![alt text][1] ![alt text][2] [1]: /storage/temp/51238-v1.png [2]: /storage/temp/51239-v1.png I would appreciate it very much if someone could explain how I would go about doing this. Thank you for your time! (Note: jump-ui is the empty gameobject)

Viewing all articles
Browse latest Browse all 4709

Trending Articles