summaryrefslogtreecommitdiff
path: root/CollectionProj/Assets/Tools/BoundViewer/BoundViewer.cs
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2021-05-11 20:13:09 +0800
committerchai <chaifix@163.com>2021-05-11 20:13:09 +0800
commitdb44a6e164c2072a6526bb4e588e7590df4e08c4 (patch)
treedf2b447afa45d71e18050739658cd90111c60280 /CollectionProj/Assets/Tools/BoundViewer/BoundViewer.cs
parent61f7041fd10f1545991e6fbc66ade10c6835c5a4 (diff)
*rename
Diffstat (limited to 'CollectionProj/Assets/Tools/BoundViewer/BoundViewer.cs')
-rw-r--r--CollectionProj/Assets/Tools/BoundViewer/BoundViewer.cs34
1 files changed, 0 insertions, 34 deletions
diff --git a/CollectionProj/Assets/Tools/BoundViewer/BoundViewer.cs b/CollectionProj/Assets/Tools/BoundViewer/BoundViewer.cs
deleted file mode 100644
index e883ba8..0000000
--- a/CollectionProj/Assets/Tools/BoundViewer/BoundViewer.cs
+++ /dev/null
@@ -1,34 +0,0 @@
-using System.Collections;
-using System.Collections.Generic;
-using UnityEngine;
-
-public class BoundViewer : MonoBehaviour
-{
-
- private Mesh m_Mesh;
-
- private void OnEnable()
- {
- if (m_Mesh != null)
- return;
- MeshFilter renderer = GetComponentInChildren<MeshFilter>();
- if(renderer)
- {
- m_Mesh = renderer.sharedMesh;
- }
- }
-
- public void OnDrawGizmos()
- {
- OnEnable();
- if (m_Mesh != null)
- {
- Bounds bound = m_Mesh.bounds;
- bound.center = Vector3.Scale(bound.center, transform.localScale) + transform.position;
- bound.size = Vector3.Scale(bound.size, transform.localScale);
- Gizmos.DrawWireCube(bound.center, bound.size);
- UnityEditor.Handles.Label(transform.position, bound.size.ToString());
- }
- }
-
-}