I have a working script to make the object respond to a click, but I only want it to respond when a certain variable equals a certain value.
Here is my c# code:
using UnityEngine;
using System.Collections;
public class example : MonoBehaviour {
// Use this for initialization
void Start () {
}
// Update is called once per frame
void Update () {
}
void OnMouseDown(){
//do something
}
}