1
This commit is contained in:
@@ -6,7 +6,8 @@
|
||||
"GUID:508392158bd966c4d9c21e19661a441d",
|
||||
"GUID:d525ad6bd40672747bde77962f1c401e",
|
||||
"GUID:49b49c76ee64f6b41bf28ef951cb0e50",
|
||||
"GUID:d8b63aba1907145bea998dd612889d6b"
|
||||
"GUID:d8b63aba1907145bea998dd612889d6b",
|
||||
"GUID:1193c2664d97cc049a6e4c486c6bce71"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
|
@@ -3,6 +3,8 @@ using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Windows.Forms;
|
||||
using Quadtree;
|
||||
using Quadtree.Items;
|
||||
using UnityEngine;
|
||||
|
||||
namespace BITKit.WorldNodes
|
||||
@@ -32,9 +34,19 @@ namespace BITKit.WorldNodes
|
||||
[ExecuteInEditMode]
|
||||
public class WorldNodeService : MonoBehaviour,IWorldNodeService
|
||||
{
|
||||
private class WorldNodeProxy : IItem<WorldNodeProxy, Node<WorldNodeProxy>>
|
||||
{
|
||||
public Bounds Bounds;
|
||||
public Bounds GetBounds()=>Bounds;
|
||||
public Node<WorldNodeProxy> ParentNode { get; set; }
|
||||
public void QuadTree_Root_Initialized(IQuadtreeRoot<WorldNodeProxy, Node<WorldNodeProxy>> root)
|
||||
{
|
||||
}
|
||||
}
|
||||
public static event Action OnDrawGizmo;
|
||||
public static readonly CacheList<IWorldNode> WorldNodeList = new();
|
||||
public static IWorldNode[] WorldNodes => WorldNodeList.ValueArray;
|
||||
private static QuadtreeRoot<WorldNodeProxy, Node<WorldNodeProxy>> _QuadtreeRoot;
|
||||
public static IWorldNode[] GetNodes(Vector3 position, float radius)
|
||||
{
|
||||
return WorldNodes.Where(node => InRange(position, node, radius))
|
||||
@@ -77,6 +89,13 @@ namespace BITKit.WorldNodes
|
||||
{
|
||||
WorldNodeList.Clear();
|
||||
}
|
||||
|
||||
[SerializeField] private Vector3 size;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
_QuadtreeRoot = new QuadtreeRoot<WorldNodeProxy, Node<WorldNodeProxy>>(transform.position,size);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Reference in New Issue
Block a user