示例#1
0
    void OnTriggerEnter(Collider collider)
    {
        if (piece == null)
        {
            return;
        }

        if (!piece.Falling)
        {
            return;
        }

        if (transform.position.y < 1.5f || CubeCollide(collider)) // if collided with the platform or with another piece
        {
            piece.Falling = false;                                // stop the movement and spawn another piece
            StartCoroutine(piece.Blink());
        }
    }