using UnityEngine; using System.Collections; public class GameController : MonoBehaviour { public bool craneSwitch; public static GameController instance; void Awake () { // There can only be one if (instance != null) { this.enabled = false; Destroy (this.gameObject); return; } instance = this; } // Use this for initialization void Start () { craneSwitch = false; } // Update is called once per frame void Update () { if (Input.GetKeyDown(KeyCode.Space)) { craneSwitch = !craneSwitch; Debug.Log (craneSwitch); } } }