From f049177e20a276049c61edbad631c1b2bbdd5706 Mon Sep 17 00:00:00 2001 From: chai Date: Thu, 15 Oct 2020 19:05:22 +0800 Subject: -advanced inspector +odin --- Assets/Scripts/Physics/PhysicsBox.cs | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) (limited to 'Assets/Scripts/Physics/PhysicsBox.cs') 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; +/// +/// AABB碰撞盒 +/// public class PhysicsBox : PhysicsPrimitive { - /// - /// 中心点 - /// - public Vector3 m_Center; + public override PrimitiveType Type + { + get + { + return PrimitiveType.Box; + } + } - /// - /// 长宽高 - /// - 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); } -- cgit v1.1-26-g67d0