diff options
author | chai <chaifix@163.com> | 2020-10-15 19:05:22 +0800 |
---|---|---|
committer | chai <chaifix@163.com> | 2020-10-15 19:05:22 +0800 |
commit | f049177e20a276049c61edbad631c1b2bbdd5706 (patch) | |
tree | 7d1a1cd9b690a5d9a8b9a65554a191d6ec769601 /Assets/Scripts/Physics/PhysicsBox.cs | |
parent | 6990a0d1fbdcbbf404f40713363ac1a148c8840a (diff) |
-advanced inspector
+odin
Diffstat (limited to 'Assets/Scripts/Physics/PhysicsBox.cs')
-rw-r--r-- | Assets/Scripts/Physics/PhysicsBox.cs | 29 |
1 files changed, 20 insertions, 9 deletions
diff --git a/Assets/Scripts/Physics/PhysicsBox.cs b/Assets/Scripts/Physics/PhysicsBox.cs index b273cb3d..657aea71 100644 --- a/Assets/Scripts/Physics/PhysicsBox.cs +++ b/Assets/Scripts/Physics/PhysicsBox.cs @@ -2,17 +2,28 @@ using System.Collections.Generic;
using UnityEngine;
+/// <summary>
+/// AABB碰撞盒
+/// </summary>
public class PhysicsBox : PhysicsPrimitive
{
- /// <summary>
- /// 中心点
- /// </summary>
- public Vector3 m_Center;
+ public override PrimitiveType Type
+ {
+ get
+ {
+ return PrimitiveType.Box;
+ }
+ }
- /// <summary>
- /// 长宽高
- /// </summary>
- public Vector3 m_Size;
+ [SerializeField]
+ private Vector3 m_Size;
+ public Vector3 Size
+ {
+ get
+ {
+ return m_Size;
+ }
+ }
public float Long { get { return m_Size.x; } }
public float Wide { get { return m_Size.y; } }
@@ -22,7 +33,7 @@ public class PhysicsBox : PhysicsPrimitive {
if (!m_IsActive)
return;
- Vector3 pos = m_Center + transform.position;
+ Vector3 pos = Position;
Gizmos.color = m_HintColor;
Gizmos.DrawCube(pos, m_Size);
}
|