public void HitStorm(Puck puck) { SphereSurfaceSlider otherSlider = puck.GetComponent <SphereSurfaceSlider>(); if (otherSlider && puck) { otherSlider.HitByStormWithSphericalVelocity(0.5f * slider.sphericalVelocity); GameObject.Destroy(gameObject); } }
void OnCollisionEnter(Collision collision) { Puck puck = collision.collider.GetComponent <Puck>(); SphereSurfaceSlider otherSlider = collision.collider.GetComponent <SphereSurfaceSlider>(); if (otherSlider && puck) { otherSlider.HitByStormWithSphericalVelocity(slider.sphericalVelocity); GameObject.Destroy(gameObject); } }