Hello,
After my car crush I’d like buttons to appear. Well I’ve made a script and it doesn’t work and I don’t know why. There was couple of wayes I tried to do this and any of them isn’t working as I said. First of all in script of car movement I’ve written this:
public static bool GameOver;
void OnCollisionEnter2D(Collision2D col)
{
if(col.gameObject.tag == "Enemy Car")
{
Destroy(gameObject);
GameOver = true;
}
}
It’s working perfectly by the way.
Now in UiMenager I’ve written this:
public void Active(){
CarMove.GameOver = true;
foreach (Button button in buttons)
button.gameObject.SetActive(true);
}
And this is not working.
I’ve also tried this:
public Button button;
public void Active(){
if(CarMove.GameOver == true)
{
button.gameObject.SetActive(true);
}
Can you please help me?