예제 #1
0
    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);
    }
예제 #2
0
    private void PunchableObjectHit(Collider collider, IPunchable punchableObject)
    {
        float velocity = CalculateVelocity(transform.position, positionPrevFrame);

        punchableObject.Hit(new PunchInfo(collider, transform.position, velocity, charge.runTimeValue));
    }