public bool MapEmpty(Vector2Int direction) { foreach (var collisionArea in directionCollisionCheckMap[direction]) { if (mapController.map.GetMapUnit(Vector2Util.RoundToInt(LocalToMap(collisionArea))) != null) { return(false); } } return(true); }
public void Update() { if (mapController != null) { mapPosition = mapController.map.WorldToMapPoint(Position); if (clamped) { mapPosition = mapController.map.ClampPosition(mapPosition); } if (rounded) { mapPosition = Vector2Util.RoundToInt(mapPosition); } Position = mapController.map.MapToWorldPoint(mapPosition); } }
public Vector2Int MapToLocalInt(Vector2 pos) { return(Vector2Util.RoundToInt(pos) - unitController.mapUnit.GetOriginPointInt()); }
public Vector2Int GetOriginPointInt() { return(Vector2Util.RoundToInt(ActualOriginPosition)); }
public void SetPositionInt(Vector2Int originPoint) { SetPosition(Vector2Util.RoundToInt(originPoint)); }
public Vector2Int WorldToMapPointClampedRounded(Vector2 worldPoint) { Vector2 result = WorldToMapPointClamped(worldPoint); return(Vector2Util.RoundToInt(result)); }