Example #1
0
    private void Update()
    {
        Ray rightRay = new Ray(rayCastGameObject.transform.position, Vector3.down);

        if (Physics.Raycast(rightRay, out raycastHit, maxDistance))
        {
            if (raycastHit.collider.CompareTag("SingleBlock") && isTouched)
            {
                isTouched = false;
                goldenCubeScore.DeductGoldenCubeScore();
                playerMoveController.enabled  = false;
                blockCreatorContoller.enabled = false;
                playerAnimator.SetBool("isMove", false);
                if (goldenCubeScore.goldenScore >= 1)
                {
                    lifePrewiewAnimator.SetBool("isShow", true);
                }
                Time.timeScale = 0;
                print("Get HIt");
            }
        }

        if (Input.GetKeyDown(KeyCode.Escape))
        {
            Application.Quit();
        }
    }
 private void Update()
 {
     if (isFly)
     {
         blockFlyingTimer += Time.deltaTime;
         if (blockFlyingTimer >= 3)
         {
             //gameOverAnim.SetBool("showAnim", true);
             ScoreGameOver.ReloadScore();
             blockResetTransform.isResetTransform        = true;
             pogruzhikMoveController.isMoveToPosRight    = true;
             blockCreatorContoller.isTapUPFirst          = false;
             blockCreatorContoller.isCanChangeBlockScale = true;
             blockFlyingTimer = 0;
             goldenCubeScore.DeductGoldenCubeScore();
             isFly = false;
         }
     }
 }