using Unity.Collections; using Unity.Mathematics; namespace DanieleMarotta.RiversongCodeShowcase { public class WaterMap : NativeGrid { 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; } } }