entity changes, classes
This commit is contained in:
parent
bda2b88796
commit
8bd4aedcf9
20 changed files with 1917 additions and 27 deletions
|
|
@ -5,6 +5,8 @@ using UnityEngine;
|
|||
public class Projectile : MonoBehaviour
|
||||
{
|
||||
[SerializeField] private Rigidbody2D rb;
|
||||
[SerializeField] private LayerMask environmentLayer;
|
||||
public PlayerEntity fromEntity;
|
||||
[Header("Stats")]
|
||||
public float damage;
|
||||
public float speed;
|
||||
|
|
@ -31,13 +33,17 @@ public class Projectile : MonoBehaviour
|
|||
{
|
||||
if (!collision.CompareTag(tag) && collision.TryGetComponent(out Entity isEntity))
|
||||
{
|
||||
isEntity.TakeDamage(damage);
|
||||
isEntity.TakeDamage(damage, fromEntity);
|
||||
currentPierce++;
|
||||
if (currentPierce > pierceAmount)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
else if (collision.gameObject.layer == 3)
|
||||
{
|
||||
Destroy(gameObject);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnDestroy()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue