// Start is called before the first frame update void Start() { _controleBola = FindObjectOfType(typeof(ControleBola)) as ControleBola; _playerControle = FindObjectOfType(typeof(playerControler)) as playerControler; StartCoroutine("SpawnMina"); StartCoroutine("SpawnEscada"); }
// Update is called once per frame void Update() { if (!isFalled) { if (transform.position.x != inicial) { isFalled = true; ControleBola bola = GameObject.Find("Bola").GetComponent <ControleBola>(); bola.totalCaidos(); } } }
static void VerificarLimiteBolas(ControleBola cb) { bolasRodando++; bolas.Add(cb); if (bolasRodando > Dados.bolasMaximasPorVez) { ControleBola b = bolas[0]; bolas.RemoveAt(0); b.Destruir(); } }
void OnCollisionEnter2D(Collision2D col) { if (col.gameObject.tag == Dados.tagBola) { ControleBola bola = col.gameObject.GetComponent <ControleBola>(); Acertado(col.relativeVelocity, bola.Rebatidas()); //* if (bola != null) { bola.Destruir(true); } //*/ } }
// Use this for initialization public void Start() { scriptBola = bola.GetComponent <ControleBola>(); }