Ejemplo n.º 1
0
 private void OnTriggerEnter(Collider collision)
 {
     if (collision.tag == "Player")
     {
         hp = collision.gameObject.GetComponent <HpSystem>();
         hp.AdjustHealth(DmgCount);
     }
 }
Ejemplo n.º 2
0
 private void OnTriggerEnter(Collider other)
 {
     Debug.Log("Ping");
     if (other.tag == "Player")
     {
         hp = other.gameObject.GetComponent <HpSystem>();
         hp.AdjustHealth(HealingCount);
         Destroy(gameObject);
     }
 }
Ejemplo n.º 3
0
    // Update is called once per frame

    private void OnTriggerEnter(Collider other)
    {
        if (atk.isAttacking == true && other.tag == "Enemy")
        {
            hp = other.gameObject.GetComponent <HpSystem>();
            hp.AdjustHealth(-weapon.AttackDamage);
            curDur--;
            if (curDur == 0)
            {
                wp.weaponName = "";
                wp.isPicked   = false;
                Destroy(gameObject);
            }
        }
    }