diff options
author | chai <215380520@qq.com> | 2023-05-12 10:32:11 +0800 |
---|---|---|
committer | chai <215380520@qq.com> | 2023-05-12 10:32:11 +0800 |
commit | 2fc9585797067730f28b03b0727bf05f9deed091 (patch) | |
tree | 8807e37b85ba922045eaa17ac445dd0a1d2d730c /marching/Assets/Scripts/Physics/FastBoxCollider.cs | |
parent | 2a1cd4fda8a4a8e649910d16b4dfa1ce7ae63543 (diff) |
+ worldline keepers
Diffstat (limited to 'marching/Assets/Scripts/Physics/FastBoxCollider.cs')
-rw-r--r-- | marching/Assets/Scripts/Physics/FastBoxCollider.cs | 90 |
1 files changed, 0 insertions, 90 deletions
diff --git a/marching/Assets/Scripts/Physics/FastBoxCollider.cs b/marching/Assets/Scripts/Physics/FastBoxCollider.cs deleted file mode 100644 index df84e0d..0000000 --- a/marching/Assets/Scripts/Physics/FastBoxCollider.cs +++ /dev/null @@ -1,90 +0,0 @@ -using mh; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class FastBoxCollider : MonoBehaviour, IQuadTreeObject -{ - - [SerializeField] private ColliderType m_Type; - [SerializeField] private Vector2 m_Offset; - [SerializeField] private Vector2 m_Size; - - public Vector2 center - { - get - { - Vector3 pos = transform.position + m_Offset.ToVector3(); - return pos; - } - } - - public Vector2 offset => m_Offset; - public Vector2 size => m_Size; - - public Vector4 bound - { - get - { - Vector3 pos = transform.position + m_Offset.ToVector3(); - Vector4 b = new Vector4(); - b.x = pos.x; - b.y = pos.y; - b.z = size.x; - b.w = size.y; - return b; - } - } - - public Vector4 box - { - get - { - Vector2 c = center; - Vector4 b = new Vector4(); - b.x = c.x; - b.y = c.y; - b.z = size.x; - b.w = size.y; - return b; - } - } - - public void Awake() - { - if (m_Type == ColliderType.Collider) - { - PhysicsManager.Instance.AddCollider(this); - } - else if (m_Type == ColliderType.Hurtbox) - { - PhysicsManager.Instance.AddHurtboxes(this); - } - } - - public void OnDestroy() - { - if (m_Type == ColliderType.Collider) - { - PhysicsManager.Instance.RemoveCollider(this); - } - else if (m_Type == ColliderType.Hurtbox) - { - PhysicsManager.Instance.RemoveHurtbox(this); - } - } - - private void OnDrawGizmos() - { - Color c = Gizmos.color; - - if(m_Type == ColliderType.Hurtbox) - { - Gizmos.color = Color.red; - } - Gizmos.DrawWireCube(transform.position + m_Offset.ToVector3(), m_Size.ToVector3()); - - Gizmos.color = c; - } - -}
\ No newline at end of file |