/// <summary> /// Constructor /// </summary> /// <param name="index"></param> /// <param name="heights"></param> public tp_Height(int index, tp_Heights heights) { m_index = index; if (heights.Count < 1) { // First range Range = new Vector2(0.0f, TP.Instance.TerrainData.heightmapScale.y); return; } // Create Range tp_Height last = heights[heights.Count - 1]; float max = last.y; float v = last.y - last.x; v /= 3.0f; last.y -= 2.0f * v; // Set range Range = new Vector2(last.y + v, max); }
/// <summary> /// Add an item to end of the list /// </summary> /// <param name="h"></param> public void Add(tp_Height h) { m_heights.Add(h); }