Created
October 19, 2014 16:59
-
-
Save CapnRat/cf218b56249a8326d069 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment