Esempio n. 1
0
    void DropGrid()
    {
        GridRb             = NextGrid.GetComponentInChildren <Rigidbody>();
        GridRb.isKinematic = false;
        GridRb.useGravity  = true;
        gridFalling        = true;

        LeftArrowCurrent.SetActive(false);
        RightArrowCurrent.SetActive(false);
        TopArrowCurrent.SetActive(false);
        BotArrowCurrent.SetActive(false);


        score += 10;
        floorAmmount++;
        UIScript.instance.ScoreTextsUpdate(score);


        lastGrid = NextGrid;
        var t = NextGrid.GetComponentsInChildren <Transform>();

        var target = new Vector3(CameraTarget.transform.position.x, CameraTarget.transform.position.y + (4f), CameraTarget.transform.position.z);

        CameraTarget.transform.DOMove(target, 1f).SetDelay(1.5f);

        for (int i = 0; i < t.Length; i++)
        {
            if (t[i].name.StartsWith("Holo"))
            {
                t[i].gameObject.SetActive(false);
            }
        }

        Invoke("ResetBlock", 2f);
    }
Esempio n. 2
0
    void TopArrow()
    {
        SoundManagerScript.PlaySound("click_sound");

        NextGrid.transform.localPosition += new Vector3(0, 0, 4);
        UpdateRayPosition(NextGridLimit);
        if (NextGrid.transform.localPosition.z >= NextGridLimit.TopLimit)
        {
            TopArrowCurrent.SetActive(false);
        }
        if (!BotArrowCurrent.activeSelf)
        {
            BotArrowCurrent.SetActive(true);
        }
    }