So im trying to toggle a script on my scene camera how ever im getting an error with the line " var bloom = mainMenuCamera.GetComponent<“Bloom”>();" its telling me that “)” is unexpected. Cant think why. Any help would be fantastic.
public class VideoController : MonoBehaviour {
[Header("Video Settings:")]
public bool isBloomOn;
[Header("Toggle Text:")]
public Text bloomToggleText;
[Header("Cameras:")]
public GameObject mainMenuCamera;
void Start () {
if (!PlayerPrefs.HasKey ("isBloom")) {
PlayerPrefs.SetInt ("isBloom", 1);
var bloom = mainMenuCamera.GetComponent<"Bloom">();
}
}
void FixedUpdate () {
if (PlayerPrefs.GetInt ("isBloom") == 1) {
bloomToggleText.text = "ON";
isBloomOn = true;
} else {
isBloomOn = false;
bloomToggleText.text = "OFF";
}
}
public void ToggleBloom () {
if (PlayerPrefs.GetInt ("isBloom") == 1) {
PlayerPrefs.SetInt ("isBloom", 0);
} else {
PlayerPrefs.SetInt ("isBloom", 1);
}
}
}