I'm trying to enable and disable GameObject (canvas) using this code:
public int canvaslevel = 1;
public GameObject one;
public GameObject two;
public GameObject three;
void Update(){
if(canvaslevel=1){
one.SetActive(true);
two.SetActive(false);
three.SetActive(false);
}
if(canvaslevel=2){
one.SetActive(false);
two.SetActive(true);
three.SetActive(false);
}
if(canvaslevel=3){
one.SetActive(false);
two.SetActive(false);
three.SetActive(true);
}
}
but it doesn't work!!!
error:
Cannot implicitly convert type
int' to
bool'