예제 #1
0
 protected override void DoPower(GameObject paddle)
 {
     if (health.Value < 3)
     {
         health.addValue(1);
     }
 }
예제 #2
0
 // Update is called once per frame
 void Update()
 {
     if (transform.position.y < -stageBounds.y - .5f)
     {
         Sounds.PlayAudio(loseLifeClip);
         health.addValue(-1);
         if (health.Value <= 0)
         {
             Sounds.PlayAudio(loseGameClip);
             lose.Call();
             Destroy(this.gameObject);
             return;
         }
         serveCall.Call();
     }
 }
예제 #3
0
    void Hit()
    {
        if (UnityEngine.Random.value >= 0.5)
        {
            Sounds.PlayAudio(brickData.hit1Clip);
        }
        else
        {
            Sounds.PlayAudio(brickData.hit2Clip);
        }

        health -= 1;
        score.addValue(brickData.value);
        if (health <= 0)
        {
            died = true;
            return;
        }
        brickColor -= 1;
        SetSprite();
    }