Ejemplo n.º 1
0
    void OnTriggerEnter2D()
    {
        //Debug.Log(correct + "    Score : " + j.score);
        if (transform.position.y < -4 && correct)
        {
            Move.renderer.color = new Color(0.99f, 0.28f, 0.28f, 1f);

            if (j.score > 0)
            {
                j.score -= pts;
            }
        }
        else if (correct)
        {
            Move.renderer.color = new Color(1f, 1f, 1f, 1f);
            j.score            += pts;
        }
        else if (transform.position.y > -4.5 && !correct)
        {
            Move.renderer.color = new Color(0.99f, 0.28f, 0.28f, 1f);
            if (j.score > 0)
            {
                j.score -= pts;
            }
        }

        Debug.Log(correct + "    Score : " + j.score);
        Destroy(gameObject);

        if (num == DuplicationCube.taille - 1)
        {
            j.CalculScore();
        }
    }