make tornadoes work with physics object (#582)

<!-- A new module or something else important -->
## Major features
-

<!-- A new parameter added to a module, or API feature -->
## Minor features
-

<!-- Some improvement that requires no action on the part of add-on
creators i.e., improved star graphics -->
## Improvements
-

<!-- Be sure to reference the existing issue if it exists -->
## Bug fixes
- physics details are now affected by tornadoes

fix #580. i give up on tornadoes
This commit is contained in:
Will Corby 2023-04-24 20:10:27 -07:00 committed by GitHub
commit a50feb6081
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -44,8 +44,13 @@ public class AddPhysics : MonoBehaviour
bodyGo.tag = "DynamicPropDetector";
// this collider is not included in groups. oh well
bodyGo.AddComponent<SphereCollider>().radius = Radius;
var shape = bodyGo.AddComponent<SphereShape>();
shape._collisionMode = Shape.CollisionMode.Detector;
shape.radius = Radius;
bodyGo.AddComponent<DynamicForceDetector>();
bodyGo.AddComponent<DynamicFluidDetector>();
var fluidDetector = bodyGo.AddComponent<DynamicFluidDetector>();
fluidDetector._buoyancy = Locator.GetProbe().GetOWRigidbody()._attachedFluidDetector._buoyancy;
fluidDetector._splashEffects = Locator.GetProbe().GetOWRigidbody()._attachedFluidDetector._splashEffects;
var impactSensor = bodyGo.AddComponent<ImpactSensor>();
var audioSource = bodyGo.AddComponent<AudioSource>();
@ -82,4 +87,4 @@ public class AddPhysics : MonoBehaviour
{
Gizmos.DrawWireSphere(transform.position, Radius);
}
}
}