I’m trying to make it so that I set a bool equal to true depending on dialogue choices, and if that boolean is true then the player is brought to level 6, but if the boolean is false, then the player is brought to level 7. I’m getting this error twice: “Assets/level3go.cs(55,62): error CS0201: Only assignment, call, increment, decrement, and new object expressions can be used as a statement”
using UnityEngine;
using System.Collections;
public class level3go : MonoBehaviour {
private bool bShowGUI = false;
// bool Dialoguer.GetGlobalBoolean(0, pickup)
void Awake(){
// You must initialize Dialoguer before using it!
Dialoguer.Initialize();
}
void OnTriggerEnter2D (Collider2D other){
if (other.tag == "Player") {
bShowGUI = true;
}
}
void OnTriggerExit2D (Collider2D other) {
if (other.tag == "Player") {
bShowGUI = false;
}
}
/*void OnTriggerEnter2D (Collider2D other){
if (other.tag == "Player") {
Dialoguer.StartDialogue (5);
bShowGUI = true;
}
}*/
void OnGUI(){
if (bShowGUI) {
if (GUI.Button (new Rect (640, 290, 100, 30), "Investigate")) {
Dialoguer.StartDialogue (20);
}
}
}
//GameObject[] enemy;
// enemy = GameObject.FindGameObjectsWithTag("pickup");
//FIXME_VAR_TYPE Enemynum= enemy.Length;
/*void Update (){
if (GameObject.FindGameObjectsWithTag("pickup").Length<=0){
// Application.LoadLevel(6);
}
}*/
void Update () {
if (GameObject.FindGameObjectsWithTag("pickup").Length<=0){
Dialoguer.GetGlobalBoolean(7) == true;
if (Dialoguer.GetGlobalBoolean(7) == true) {
Application.LoadLevel(6);
}
// Application.LoadLevel(6);
}
else {
Dialoguer.GetGlobalBoolean(8) == true;
if (Dialoguer.GetGlobalBoolean(8) == true) {
Application.LoadLevel(7);
}
}
}
}