Example #1
0
 public void HitObject(RaycastHit2D hit, Vector2 addedVector)
 {
     //Checks if the zombie has hit the structure layer
     if (hit.collider.gameObject.layer == 9)
     {
         buildingSystem.DestroyStructure(hit.point + addedVector, damage);
         timer = Time.time + attackCooldown;
     }
     //Checks if the zombie has hit the player layer
     else if (hit.collider.gameObject.layer == 10)
     {
         Attack();
     }
 }