private static bool IsInsideParallelogramXZ(FlatTriPoint point, int width, int height) { return (point.X >= 0 && point.X < width && point.Z >= 0 && point.Z < height); }
public void Update() { if (Input.GetMouseButtonDown(0)) { Vector2 worldPosition = GridBuilderUtils.ScreenToWorld(root, Input.mousePosition); FlatTriPoint triPoint = map[worldPosition]; if (grid.Contains(triPoint)) { grid[triPoint].HighlightOn = !grid[triPoint].HighlightOn; } } }
private static bool IsInsideDownTriangle(FlatTriPoint point, int side) { if (point.X >= side) { return(false); } if (point.Y >= 0) { return(false); } if (point.Z > 0) { return(false); } //if () return(true); }
private static bool IsInsideUpTriangle(FlatTriPoint point, int side) { int x = 2 * (point.X + point.Y) + point.I; return(point.X >= 0 && x < 2 * side - 1 && point.Y >= 0); }