Beispiel #1
0
    private void FullDown()
    {
        while (true)
        {
            if (!MoveDirection(Vector3.down))
            {
                break;
            }
        }

        StopCoroutine(fallingCoroutine);

        if (AddToGrid())
        {
            SoundManager.Instance.PlayOneShot("FX_Common");

            CheckForLines();

            for (int i = 0; i < transform.childCount; i++)
            {
                if (rotationPoint == transform.GetChild(i))
                {
                    continue;
                }

                transform.GetChild(i).parent = spawner.transform;

                i--;
            }

            gameObject.SetActive(false);

            spawner.SpawnBlock();
        }
        else
        {
            spawner.GameOver();
        }
    }