void Action(Transform target) { PlayerStats targetStats = target.GetComponent <PlayerStats>(); OnProjectileHit.Invoke(stats, targetStats, this); Destroy(gameObject); }
void OnCollisionEnter(Collision c) { if (CollisionHandled) { return; } CollisionHandled = true; var canStick = c.gameObject.GetComponentInParent <ArrowStickable>(); if (canStick) { Body.isKinematic = true; Body.velocity = Vector3.zero; Body.angularVelocity = Vector3.zero; } OnProjectileHit.Invoke(c); }
public void ProjectileHit(Projectile projectile) { OnProjectileHit?.Invoke(projectile); }