Input across scripts

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");
	}
	
}


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)

There are many examples on UA that show how to do this. You might add

public SomeClass someClass;

to the top (above OnMouseDown/first method), which will expose a field in the Inspector that you can drag/drop the other GameObject you want to notify that has SomeClass component attached. Then, in your OnMouse event you can

someClass.someMethod(aParameter, bParameter);
someClass.someVar = 1;

This is pseudo code don’t copy and paste it