internal static dfList <T> Obtain(int capacity) { dfList <T> ts = dfList <T> .Obtain(); ts.EnsureCapacity(capacity); return(ts); }
internal static dfList <T> Obtain(int capacity) { dfList <T> list = dfList <T> .Obtain(); list.EnsureCapacity(capacity); return(list); }
private void addQuadColors(dfList <Color32> colors) { colors.EnsureCapacity(colors.Count + 4); Color32 item = base.ApplyOpacity(!base.IsEnabled ? base.disabledColor : base.color); for (int i = 0; i < 4; i++) { colors.Add(item); } }
private void addQuadColors(dfList <Color32> colors) { colors.EnsureCapacity(colors.Count + 4); Color32 color32 = base.ApplyOpacity((!base.IsEnabled ? this.disabledColor : this.color)); for (int i = 0; i < 4; i++) { colors.Add(color32); } }
private void addQuadColors(dfList <Color32> colors) { colors.EnsureCapacity(colors.Count + 4); var color = ApplyOpacity(IsEnabled ? this.color : this.disabledColor); for (int i = 0; i < 4; i++) { colors.Add(color); } }
private static void rebuildTriangles(dfRenderData renderData, RenderOptions options) { int baseIndex = options.baseIndex; dfList <int> triangles = renderData.Triangles; triangles.EnsureCapacity(triangles.Count + TRIANGLE_INDICES.Length); for (int i = 0; i < TRIANGLE_INDICES.Length; i++) { triangles.Add(baseIndex + TRIANGLE_INDICES[i]); } }
/// <summary> /// Ensures that the lists have enough memory allocated to store /// the number of elements indicated by <paramref name="capacity"/>, /// to reduce memory thrashing /// </summary> /// <param name="capacity"></param> public void EnsureCapacity(int capacity) { Vertices.EnsureCapacity(capacity); Triangles.EnsureCapacity(Mathf.CeilToInt(capacity * 1.5f)); UV.EnsureCapacity(capacity); Colors.EnsureCapacity(capacity); if (Normals != null) { Normals.EnsureCapacity(capacity); } if (Tangents != null) { Tangents.EnsureCapacity(capacity); } }
private void addQuadColors( dfList<Color32> colors ) { colors.EnsureCapacity( colors.Count + 4 ); var color = ApplyOpacity( IsEnabled ? this.color : this.disabledColor ); for( int i = 0; i < 4; i++ ) { colors.Add( color ); } }
private void addQuadColors(dfList<Color32> colors) { colors.EnsureCapacity(colors.Count + 4); Color32 color32 = base.ApplyOpacity((!base.IsEnabled ? this.disabledColor : this.color)); for (int i = 0; i < 4; i++) { colors.Add(color32); } }