コード例 #1
0
    static void VerificarLimiteBolas(ControleBola cb)
    {
        bolasRodando++;
        bolas.Add(cb);

        if (bolasRodando > Dados.bolasMaximasPorVez)
        {
            ControleBola b = bolas[0];
            bolas.RemoveAt(0);
            b.Destruir();
        }
    }
コード例 #2
0
    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);
            }
            //*/
        }
    }