BITFALL/Assets/BITKit/Unity/Scripts/WorldChunk/WorldChunkManager.cs

39 lines
950 B
C#
Raw Normal View History

2024-03-12 21:54:29 +08:00
using System;
2023-06-08 14:09:50 +08:00
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using System.Linq;
2024-03-12 21:54:29 +08:00
using NativeQuadTree;
using Unity.Mathematics;
2023-06-08 14:09:50 +08:00
namespace BITKit.WorldChunk
{
public class WorldChunkManager : MonoBehaviour
{
2024-03-12 21:54:29 +08:00
[SerializeField] private int2 worldSize;
[SerializeField] private int2 playerSize;
2023-11-21 18:05:18 +08:00
private Rect playerRect;
2024-03-12 21:54:29 +08:00
private void Start()
{
var quadTree = new NativeQuadTree<int>(new AABB2D(default, worldSize));
}
2023-11-21 18:05:18 +08:00
private void FixedUpdate()
2023-06-08 14:09:50 +08:00
{
var cameraPos = Camera.main.transform.position;
Vector2 position = new()
{
x = cameraPos.x - playerSize.x / 2,
y = cameraPos.z - playerSize.y / 2,
};
OnUpdate();
//ThreadHelper.Add(OnUpdate);
}
2023-11-21 18:05:18 +08:00
private void OnUpdate()
2023-06-08 14:09:50 +08:00
{
2024-03-12 21:54:29 +08:00
2023-06-08 14:09:50 +08:00
}
}
}