Exemple #1
0
 // Update is called once per frame
 private void OnTriggerStay(Collider other)
 {
     if (healthScript != null)
     {
         bool hitSuccess = healthScript.HandleHit(attackDamage);
         if (hitSuccess)
         {
             healthScript.KnockbackPlayer(transform.position);
         }
     }
 }
Exemple #2
0
    private void OnTriggerEnter(Collider other)
    {
        DungeonPlayerHealth target = other.GetComponent <DungeonPlayerHealth>();

        if (target != null)
        {
            target.HandleHit(damage);
            Destroy(gameObject);
        }
        //To Handle
        if (other.gameObject.tag == "Environment")
        {
            Destroy(gameObject);
        }
    }