Esempio n. 1
0
 public void Display()
 {
     grid.ForEachCell((x, y) => {
         float c = GetInfluence(x, y);
         float a = Mathf.Approximately(c, 0) ? 0 : 1f;
         tex.SetPixel(x, y, new Color(c / visualizedMaxValue, c / visualizedMaxValue, c / visualizedMaxValue, a));
     });
     tex.Apply();
 }
Esempio n. 2
0
    private void OnDrawGizmosSelected()
    {
        if (grid == null)
        {
            return;
        }
        var baseColor = Color.white;

        if (heightObstacleMap != null)
        {
            grid.ForEachCell((x, y) => {
                if (heightObstacleMap[x, y] > 0)
                {
                    var c        = heightObstacleMap[x, y] / visualizedMaxHeight;
                    Gizmos.color = Color.Lerp(new Color(c, c, c), baseColor, 0.5f);
                    Gizmos.DrawWireSphere(grid.GridToWorld(new Vector2Int(x, y)), 0.031f);
                }
            });
        }
    }