Beispiel #1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Player")
     {
         LH_Health playerHP = collision.gameObject.GetComponent <LH_Health>();
         playerHP.Heal(mHealing);
         // Destroy(this.gameObject);
     }
 }
Beispiel #2
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.tag == "Player")
     {
         LH_Health playerHP = collision.gameObject.GetComponent <LH_Health>();
         playerHP.doDamage(mDamage);
         // Debug.Log("Player damaged");
     }
 }
Beispiel #3
0
    //Upon colliding the Player, respond by dealing damage to the Player and dying
    //This functions as a very basic fighting mechanic
    private void OnTriggerEnter2D(Collider2D collision)
    {
        uint damage = (uint)(int)mPlayerDamage;

        if (collision.tag == "Player")
        {
            LH_Health playerHP = collision.gameObject.GetComponent <LH_Health> ();
            FindObjectOfType <ZG_AudioManager>().playDynamicSound("enemyTakeDamage1");
            playerHP.doDamage(damage);
            Destroy(gameObject);
        }
    }
Beispiel #4
0
 // Use this for initialization
 void Start()
 {
     healthscript = FindObjectOfType <LH_Health>();
     //healthscript = this.gameObject.GetComponent<LH_Health>();
 }