Files
riversong-code-showcase/Source/Riversong/Game/World/WaterMap.cs
2026-05-21 16:04:49 +02:00

22 lines
472 B
C#

using Unity.Collections;
using Unity.Mathematics;
namespace DanieleMarotta.RiversongCodeShowcase
{
public class WaterMap : NativeGrid<int>
{
public WaterMap(int2 size) : base(size, Allocator.Persistent)
{
}
public bool IsWater(int2 tile)
{
return GetValue(tile) == 0;
}
public bool IsNearWater(int2 tile)
{
return GetValue(tile) is > 0 and < int.MaxValue;
}
}
}