public void SpecialImpact() { AttachedObject._intactRenderer.enabled = false; AttachedObject._impactLight.enabled = true; AttachedObject._impactLight.intensity = AttachedObject._impactLightCurve.Evaluate(0f); foreach (var particleSystem in AttachedObject._impactParticles) { particleSystem.Play(); } AttachedObject._impactSource.PlayOneShot(AudioType.BH_MeteorImpact); foreach (var owCollider in AttachedObject._owColliders) { owCollider.SetActivation(false); } AttachedObject._owRigidbody.MakeKinematic(); FragmentSurfaceProxy.UntrackMeteor(AttachedObject); FragmentCollisionProxy.UntrackMeteor(AttachedObject); AttachedObject._ignoringCollisions = false; AttachedObject._hasImpacted = true; AttachedObject._impactTime = Time.time; }
public static bool Impact(MeteorController __instance, GameObject hitObject, Vector3 impactPoint, Vector3 impactVel) { __instance._intactRenderer.enabled = false; __instance._impactLight.enabled = true; __instance._impactLight.intensity = __instance._impactLightCurve.Evaluate(0f); var rotation = Quaternion.LookRotation(impactVel); foreach (var particleSystem in __instance._impactParticles) { particleSystem.transform.rotation = rotation; particleSystem.Play(); } __instance._impactSource.PlayOneShot(AudioType.BH_MeteorImpact); foreach (var owCollider in __instance._owColliders) { owCollider.SetActivation(false); } __instance._owRigidbody.MakeKinematic(); __instance.transform.SetParent(hitObject.GetAttachedOWRigidbody().transform); FragmentSurfaceProxy.UntrackMeteor(__instance); FragmentCollisionProxy.UntrackMeteor(__instance); __instance._ignoringCollisions = false; __instance._hasImpacted = true; __instance._impactTime = Time.time; var qsbMeteor = __instance.GetWorldObject <QSBMeteor>(); if (QSBMeteor.IsSpecialImpact(hitObject)) { qsbMeteor.SendMessage(new MeteorSpecialImpactMessage()); } return(false); }