private void PunchableObjectHit(Collider collider, IPunchable punchableObject) { float velocity = CalculateVelocity(); punchableObject.Hit(new PunchInfo(transform.position, velocity, charge.runTimeValue)); Vibrate(); audioSource.PlayOneShot(punchSounds.GetRandom()); Instantiate(punchParticle, particleSpawnPoint.position, Quaternion.identity); }
private void PunchableObjectHit(Collider collider, IPunchable punchableObject) { float velocity = CalculateVelocity(transform.position, positionPrevFrame); punchableObject.Hit(new PunchInfo(collider, transform.position, velocity, charge.runTimeValue)); }