Skip to content

Coding Yourself

Steffenvy edited this page Apr 17, 2020 · 7 revisions

A lot of the code is not designed for updating the variables with scripts at runtime, for example there is some caching for performance going on, but I've tried making some components use a Refresh() method that you can call to recalculate things at runtime if you've changed the fields. I feel like most of the code has no need to be updated at runtime, but if there is an inability to do something you want because of that restriction, I can add more runtime accessibility.

Since Collisions don't know anything about the triangle index, unlike RaycastHits, for CollisionEffects.cs I allow the ability to automatically use a raycast to find it in the case that it would be useful to do so (non-convex MeshCollider). If you want to find the submesh SurfaceType/s yourself using that code, you can use the static method CollisionEffects.GetSmartCollisionSurfaceTypes(Collision c, bool findMeshColliderSubmesh, SurfaceData data);. This raycast distinction code is done with the first ContactPoint only, but that should be okay.

Clone this wiki locally