GiveLife() public method

public GiveLife ( ) : void
return void
Beispiel #1
0
    void OnTriggerEnter2D(Collider2D other)
    {
        if (other.GetComponent <PlayerController> () != null)
        {
            if (!isEquipment && !isHpRegen)
            {
                ScoreManager.AddPoints(pointsToAdd);
            }

            if (isEquipment)
            {
                eq.AddItem();
                door.isOpened = true;
                door.Open();
            }

            if (isHpRegen)
            {
                HealthManager.playerHp++;
            }

            if (isLifeUp)
            {
                life.GiveLife();
            }

            pickedItemSoundEffect.Play();
            Destroy(gameObject);
        }
    }
Beispiel #2
0
 public void PickLife()
 {
     lifeManager.GiveLife();
     spriteRenderer.enabled = false;
     boxCollider.enabled    = false;
     Destroy(gameObject);
 }
Beispiel #3
0
 public void PickLife()
 {
     lifeManager.GiveLife();
     powerItemExplode.Pickup();
     spriteRenderer.enabled = false;
     Destroy(gameObject);
 }
Beispiel #4
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.name == "Player")         // if player collides with life pickup...
     {
         lifeSystem.GiveLife();          // give life
         Destroy(gameObject);            // destroy pickup
     }
 }
Beispiel #5
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.name == "Player")
     {
         lifeSystem.GiveLife();
         Destroy(gameObject);
     }
 }
Beispiel #6
0
 public void OnTriggerEnter2D(Collider2D gameItem)
 {
     if (gameItem.tag == "Player")
     {
         LifeManager.GiveLife();
     }
     Destroy(gameObject);
 }
 // Update is called once per frame
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.name == "Player")
     {
         lifeSystem.GiveLife();
         Instantiate(lifeParticle, transform.position, transform.rotation);
         Destroy(gameObject);
     }
 }
Beispiel #8
0
 public void PickLife()
 {
     lifeManager.GiveLife();
     powerItemExplode.Pickup();
     spriteRenderer.enabled = false;
     boxCollider.enabled    = false;
     charMov.ObjetoTriggerPickup(this.name);
     Destroy(gameObject);
 }
Beispiel #9
0
 void OnTriggerEnter2D(Collider2D c)
 {
     if (c.name == "Player")
     {
         lifeSystem.GiveLife();
         pickUpLifeSound.Play();
         Destroy(gameObject);
     }
 }
Beispiel #10
0
 public void PickLife()
 {
     lifeManager.GiveLife();
     audio.PlayOneShot(pickAudio);
     powerItemExplode.Pickup();
     spriteRenderer.enabled = false;
     boxCollider.enabled    = false;
     Destroy(gameObject);
 }
Beispiel #11
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.name == "Player")
     {
         lifeSystem.GiveLife();
         Destroy(gameObject);
         //If this object hits the player then goes to Give Life function in LifeManager. Then Destroys this object.
     }
 }
Beispiel #12
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.name == "Player")
     {
         lifeManager.GiveLife();
         extraLifeSound.Play();
         Destroy(gameObject);
     }
 }
Beispiel #13
0
 //The object must have a collider and set it's settings to Is trigger in order to run this  has this mettod.This method will get the collider that will clash with it.
 void OnTriggerEnter2D(Collider2D col)
 {
     //if player pick up this object his life count increses
     if (col.name == "Player")
     {
         lifeSystem.GiveLife();
         //TO DO: Optimise
         Destroy(gameObject);
     }
 }
 private void OnTriggerEnter2D(Collider2D other)
 {
     if (other.CompareTag("Player"))
     {
         lifeSystem.GiveLife();
         pickupSound.Play();
         Instantiate(pickupEffect, transform.position, transform.rotation);
         Destroy(gameObject);
     }
 }
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.name == "MegaMan")
     {
         player.pickUpSFX.pitch = 2f;
         player.pickUpSFX.Play();
         lifeSystem.GiveLife();
         Destroy(gameObject);
     }
 }
 void OnTriggerEnter(Collider other)
 {
     if (other.gameObject == player)
     {
         gameObject.GetComponent <SpriteRenderer>().enabled = false;
         audio.PlayOneShot(pick);
         lifeSystem.GiveLife();
         powerItemExplode.Pickup();
         sphereCollider.enabled = false;
         Destroy(gameObject);
     }
 }
Beispiel #17
0
 public void onelife()
 {
     firstDead = false;
     lifeSystem.GiveLife();
 }
 private void OnTriggerEnter2D(Collider2D other)
 {
     lifeSystem.GiveLife();
     Destroy(gameObject);
 }