This commit is contained in:
CortexCore
2024-04-16 04:06:46 +08:00
parent 37e7fcea51
commit c798b224be
67 changed files with 1305 additions and 425 deletions

View File

@@ -13,7 +13,8 @@ namespace BITKit.OpenWorld
[SerializeField,ReadOnly] private int id;
[SerializeField] protected Vector3 size = Vector3.one;
[SerializeField] protected Vector3 offset = Vector3.one * 0.5f;
public Bounds GetBounds()=>new Bounds(transform.position+transform.rotation * offset,transform.rotation * size);
public Bounds GetBounds() => _bounds;
private Bounds _bounds;
public Node<IWorldChunkObject> ParentNode { get; set; }
public void QuadTree_Root_Initialized(IQuadtreeRoot<IWorldChunkObject, Node<IWorldChunkObject>> root)
{
@@ -30,6 +31,7 @@ namespace BITKit.OpenWorld
}
protected virtual void Start()
{
_bounds= new Bounds(transform.position+transform.rotation * offset,transform.rotation * size);
UnityWorldChunkService.Singleton.Register(this);
destroyCancellationToken.Register(Dispose);
}