Ejemplo n.º 1
0
        private Vector3 SiteWithHeight(Region region)
        {
            if (region.type.DistIndexFromCoastline <= 0)
            {
                return(MathVert.ToVector3(region.site));
            }

            float dist = (float)region.type.DistIndexFromCoastline;

            dist = Mathf.Clamp(dist - heightSettings.heightOffset, 1, dist);

            float height = Mathf.Round(Mathf.Pow(dist / RegionsInfo.MaxDistIndex * heightSettings.heightValue, 2));

            return(MathVert.ToVector3(region.site) + Vector3.up * height);
        }
Ejemplo n.º 2
0
 /// <summary>
 /// Draw line between two points.
 /// </summary>
 public static void DrawLine(Vector2 point1, Vector2 point2, Vector3 offset, Color color, float duration = float.PositiveInfinity)
 {
     DefDrawLine(MathVert.ToVector3(point1) + offset, MathVert.ToVector3(point2) + offset, color, duration);
 }
Ejemplo n.º 3
0
 /// <summary>
 /// Draw vertical line.
 /// </summary>
 public static void DrawVLine(Vector2 point, Color color, float length, float duration = float.PositiveInfinity)
 {
     DrawVLine(MathVert.ToVector3(point), color, length, duration);
 }