コード例 #1
0
        public static void Impact(MeteorController __instance,
                                  GameObject hitObject, Vector3 impactPoint, Vector3 impactVel)
        {
            var qsbMeteor = __instance.GetWorldObject <QSBMeteor>();

            if (QSBMeteor.IsSpecialImpact(hitObject))
            {
                qsbMeteor.SendMessage(new MeteorSpecialImpactMessage());
            }
        }
コード例 #2
0
        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);
        }