summaryrefslogtreecommitdiff
path: root/WorldlineKeepers/Assets/Scripts/Physics/PhysicsManager_HurtboxTree.cs
blob: ca139357c05a9e1c36f355cf9a4d469007c5c147 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using mh;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public partial class PhysicsManager : Singleton<PhysicsManager>
{

    private PhysicsQuadtree m_HurtboxQuadtree;

    public Vector4 hurtboxQuadtreeRange
    {
        set
        {
            m_HurtboxQuadtree.quadtreeRange = value;
        }
    }

    public void AddHurtboxes(IQuadTreeObject hurtbox)
    {
        m_HurtboxQuadtree.AddObject(hurtbox);
    }

    public void RemoveHurtbox(IQuadTreeObject hurtbox)
    {
        m_HurtboxQuadtree.RemoveObject(hurtbox);
    }

    public bool RetriveHurtboxes(ref List<IQuadTreeObject> returnObjs, Vector4 bound)
    {
        return m_HurtboxQuadtree.Retrive(ref returnObjs, bound);
    }

    public bool RetriveHurtboxes(Vector4 bound)
    {
        m_SharedRetriveResults.Clear();
        return m_HurtboxQuadtree.Retrive(ref m_SharedRetriveResults, bound);
    }

}