summaryrefslogtreecommitdiff
path: root/Assets/Scripts
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2020-10-13 07:46:54 +0800
committerchai <chaifix@163.com>2020-10-13 07:46:54 +0800
commit8cd16fb71177bb61a9475284d944bc6aba30740e (patch)
treec2b1be659f930d41a2241062d3deef1213b91a31 /Assets/Scripts
parent58a47386a711746d17c5c66ac897a53f7a4aad4b (diff)
+hitbox test
Diffstat (limited to 'Assets/Scripts')
-rw-r--r--Assets/Scripts/Test/HitBoxTest.cs21
1 files changed, 19 insertions, 2 deletions
diff --git a/Assets/Scripts/Test/HitBoxTest.cs b/Assets/Scripts/Test/HitBoxTest.cs
index 87e77b9a..57b0d1af 100644
--- a/Assets/Scripts/Test/HitBoxTest.cs
+++ b/Assets/Scripts/Test/HitBoxTest.cs
@@ -2,11 +2,28 @@
using System.Collections.Generic;
using UnityEngine;
+// AABB hitbox
public class HitBoxTest : MonoBehaviour
{
+ public bool DrawGizmo;
- // Start is called before the first frame update
- void Start()
+ [SerializeField]
+ private bool m_IsActive;
+
+ [SerializeField]
+ private Vector3 m_TopLeft, m_RightBottom;
+
+ private void OnDrawGizmos()
+ {
+ if (!DrawGizmo) return;
+ Gizmos.color = Color.green;
+ Vector3 topleft = transform.position + m_TopLeft;
+ Vector3 rightbottom = transform.position + m_RightBottom;
+ Gizmos.DrawCube((topleft + rightbottom) / 2, rightbottom - topleft);
+ }
+
+ // Start is called before the first frame update
+ void Start()
{
}