using UnityEngine;
using System.Collections;
public class ComponentSwitch : MonoBehaviour {
// Use this for initialization
static void Start () {
}
// Update is called once per frame
static void Update () {
if(Input.GetKeyDown(KeyCode.Space))
{
GameCamera.enabled = !GameCamera.enabled;
}
}
}
basically here is my script,, the GameCamera, Refers to a GameCamera Created via AC all i want to do is toggle between turning it off and on,, can anyone help me with this script ? im in need of it,, my deadline is this coming wednesday and i'm almost done with my game and all i need to is to learn this script.. thank you guys i really appreciate some help now
Comments
{
public GameCamera myGameCamera;
{
myGameCamera.enabled = !myGameCamera.enabled;
}
You can then assign the appropriate GameCamera prefab into the script's inspector.