Exemple #1
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);
                }
            });
        }
    }
Exemple #2
0
 public Vector3 GetVelocity()
 {
     return((transform.position + grid.GridToWorld(nextPos)).normalized * speed);
 }