From dcaad8044384bce4f4358522108bf9a2481ee4e0 Mon Sep 17 00:00:00 2001 From: chai Date: Wed, 14 Oct 2020 12:44:29 +0800 Subject: *physics --- Assets/Scripts/Physics/PhysicsBox.cs | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 Assets/Scripts/Physics/PhysicsBox.cs (limited to 'Assets/Scripts/Physics/PhysicsBox.cs') diff --git a/Assets/Scripts/Physics/PhysicsBox.cs b/Assets/Scripts/Physics/PhysicsBox.cs new file mode 100644 index 00000000..93f2a45f --- /dev/null +++ b/Assets/Scripts/Physics/PhysicsBox.cs @@ -0,0 +1,32 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class PhysicsBox : PhysicsPrimitive +{ + /// + /// 中心点 + /// + public Vector3 m_Center; + + /// + /// 长宽高 + /// + public Vector3 m_Size; + + public float Long { get { return m_Size.x; } } + public float Wide { get { return m_Size.y; } } + public float Height { get { return m_Size.z; } } + + public void OnDrawGizmos() + { + Vector3 pos = m_Center + transform.position; + Gizmos.DrawCube(pos, m_Size); + } + + private void Start() + { + base.OnInit(); + } + +} -- cgit v1.1-26-g67d0