Exemplo n.º 1
0
    private void OnTriggerEnter2D(Collider2D collision)
    {
        if (collision.tag == "Circle" || collision.tag == "DoubleCircle")
        {
            circleController = collision.gameObject.GetComponentInChildren <CircleController>();
        }

        if (collision.tag == "ColorSwitch")
        {
            RandomColor();
            Destroy(collision.gameObject);
        }
        else if (collision.tag == "Star")
        {
            Score++;
            Write();
            CreateLevel();
            circleController.PlayStarAudio();
            Destroy(collision.gameObject);
        }
        else if (collision.tag == "Dead Layer")
        {
            Dead();
        }
        else if (collision.tag != CurrentColor && collision.tag != "Circle" && collision.tag != "DoubleCircle")
        {
            Dead();
        }
    }