I am making a game for IOS, and I want a button to be able to send output to a gameobject. For example, when the UI button is touched, the camera would move up. My button can read inputs from touch, but cannot broadcast them to the gameobject. My script is:
using UnityEngine;
using System.Collections;
public class Test: MonoBehaviour
{
void OnMouseDown()
{
Debug.Log ("Mouse Down");
}
void OnMouseUp()
{
Debug.Log ("Mouse up");
}
}
Should I use global variables? I cannot find anything like this for a button in ios. Thank you for your time.