diff options
Diffstat (limited to 'Valheim_v0.141.2_r202102/Valheim/assembly_utils/DrawBounds.cs')
-rw-r--r-- | Valheim_v0.141.2_r202102/Valheim/assembly_utils/DrawBounds.cs | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Valheim_v0.141.2_r202102/Valheim/assembly_utils/DrawBounds.cs b/Valheim_v0.141.2_r202102/Valheim/assembly_utils/DrawBounds.cs new file mode 100644 index 0000000..a30a2da --- /dev/null +++ b/Valheim_v0.141.2_r202102/Valheim/assembly_utils/DrawBounds.cs @@ -0,0 +1,16 @@ +using UnityEngine; + +public class DrawBounds : MonoBehaviour +{ + private void OnDrawGizmosSelected() + { + Gizmos.color = Color.magenta; + MeshFilter[] componentsInChildren = GetComponentsInChildren<MeshFilter>(); + foreach (MeshFilter obj in componentsInChildren) + { + Gizmos.matrix = obj.transform.localToWorldMatrix; + Mesh sharedMesh = obj.sharedMesh; + Gizmos.DrawWireCube(sharedMesh.bounds.center, sharedMesh.bounds.size); + } + } +} |