public class Diretor : MonoBehaviour
{
[SerializeField]
private GameObject GameOver;
private aviao1 aviao1;
private void Start()
{
this.aviao1 = GameObject.FindObjectOfType<aviao1>();
}
public void FinalizarJogo()
{
Time.timeScale = 0;
this.GameOver.SetActive(true);
}
public void ReiniciarJogo()
{
this.GameOver.SetActive(false);
Time.timeScale = 1;
this.aviao1.Reiniciar();
this.DestruirObstaculos();
}
private void DestruirObstaculos()
{
Obstaculo[] obstaculos = GameObject.FindObjectsOfType<Obstaculo>();
foreach (Obstaculo obstaculo in obstaculos)
{
obstaculo.Destruir();
}
}
}
ta dando esses erros aqui :
Assets/scripts/Diretor.cs(34,9): error CS0246: The type or namespace name `Obstaculo' could not be found. Are you missing an assembly reference?
Assets/scripts/Diretor.cs(35,41): error CS0844: A local variable `obstaculos' cannot be used before it is declared. Consider renaming the local variable when it hides the member `Diretor.obstaculos'