generated from max/template-unity-project
long ids but not long enough!
- Object and prefab file id loading - Generate grid update - Switched uint to long but should probably be ulong!
This commit is contained in:
@ -14,16 +14,16 @@ namespace VertexColor.ScenePartition.Editor
|
||||
|
||||
public SceneGridDictionary Grid => grid;
|
||||
|
||||
public void Insert(uint id, Vector3 point)
|
||||
public void Insert(long scenePartitionId, Vector3 point)
|
||||
{
|
||||
int gridId = CalculateGridPosition(point, cellSize);
|
||||
if (grid.TryGetValue(gridId, out List<uint> ids))
|
||||
if (grid.TryGetValue(gridId, out List<long> ids))
|
||||
{
|
||||
ids.Add(id);
|
||||
ids.Add(scenePartitionId);
|
||||
}
|
||||
else
|
||||
{
|
||||
grid.Add(gridId, new List<uint> { id });
|
||||
grid.Add(gridId, new List<long> { scenePartitionId });
|
||||
}
|
||||
}
|
||||
|
||||
@ -49,5 +49,20 @@ namespace VertexColor.ScenePartition.Editor
|
||||
|
||||
return (x, y);
|
||||
}
|
||||
|
||||
public static long LongPairToLong(long x, long y)
|
||||
{
|
||||
// Combine x and y components into a single long
|
||||
return (x << 32) | (uint)y;
|
||||
}
|
||||
|
||||
public static (long, long) LongToLongPair(long value)
|
||||
{
|
||||
// Extract x and y components from the combined long
|
||||
long x = value >> 32;
|
||||
long y = (uint)value;
|
||||
|
||||
return (x, y);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user