public void Interact()
    {
        levelCompleteTrigger.SetActive(false);

        if (!canProceede)
        {
            database.GameOverInvoke();
            AudioManager.Instance.PlaySFX(database.musicClips[0], 1f);
            Vibrate.PerformeVibration(250);
            return;
        }
        else
        {
            database.LevelCompleteInvoke();
            Vibrate.PerformeVibration(1000);
        }
    }
 private void PlayerPowerUp()
 {
     if (playerScore == (levelScore - 1))
     {
         smallCube.SetActive(false);
         bigCube.SetActive(true);
         invinsible = true;
         database.InvinsibleInvoke();
         Vibrate.PerformeVibration(250);
     }
     else
     {
         playerScore = database.playerScore;
         float scoreRatio = playerScore / levelScore;
         if (scoreRatio < 1.01f)
         {
             powerUp.localScale = new Vector3(1.01f, scoreRatio + 0.01f, 1.01f);
         }
     }
 }
Esempio n. 3
0
    private void BreakMyself()
    {
        transform.GetChild(0).gameObject.SetActive(false);

        foreach (Rigidbody cube in childCubes)
        {
            cube.gameObject.SetActive(true);
        }

        foreach (Rigidbody cube in childCubes)
        {
            cube.AddExplosionForce(force, transform.position, radius, upwardModifier);
        }

        if (canDealDamage)
        {
            database.DealDamageInvoke();
            Vibrate.PerformeVibration(200);
        }
        else
        {
            AudioManager.Instance.PlaySFX(database.musicClips[3], 0.55f);
        }
    }