本文整理汇总了C#中System.Collections.Generic.List.RemoveRange方法的典型用法代码示例。如果您正苦于以下问题:C# System.Collections.Generic.List.RemoveRange方法的具体用法?C# System.Collections.Generic.List.RemoveRange怎么用?C# System.Collections.Generic.List.RemoveRange使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类System.Collections.Generic.List
的用法示例。
在下文中一共展示了System.Collections.Generic.List.RemoveRange方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FixSubCalEventOrder
List<List<List<SubCalendarEvent>>> FixSubCalEventOrder(List<List<List<SubCalendarEvent>>> AllPossibleFullTimeLines, TimeLine[] JustFreeSpots)
{
List<List<List<SubCalendarEvent>>> retValue = new System.Collections.Generic.List<System.Collections.Generic.List<System.Collections.Generic.List<SubCalendarEvent>>>();
foreach (List<List<SubCalendarEvent>> PossibleTimeLine in AllPossibleFullTimeLines)
{
int index = 0;
Dictionary<int, List<List<SubCalendarEvent>>> DictOfSubCalEvent = new System.Collections.Generic.Dictionary<int, System.Collections.Generic.List<System.Collections.Generic.List<SubCalendarEvent>>>();
for (; index < JustFreeSpots.Length; index++)
{
DictOfSubCalEvent.Add(index, new System.Collections.Generic.List<System.Collections.Generic.List<SubCalendarEvent>>());
List<SubCalendarEvent> SubCalendarEventsInFreeTimeLine = PossibleTimeLine[index];
SubCalendarEventsInFreeTimeLine = SubCalendarEventsInFreeTimeLine.OrderBy(obj => obj.getCalendarEventRange.End).ToList();
List<List<SubCalendarEvent>> latestPermutations = Pseudo_generateTreeCallsToSnugArray(SubCalendarEventsInFreeTimeLine, JustFreeSpots[index]);
DictOfSubCalEvent[index].AddRange(latestPermutations);
}
retValue.AddRange(SerializeDictionary(DictOfSubCalEvent));
}
retValue.RemoveRange(0, Convert.ToInt32(retValue.Count * 0.9999));
return retValue;
}
示例2: LoadTrees
private void LoadTrees(string xvalue, string yvalue, TerrainData tdata)
{
if (_trees.Count > 0)
{
System.Collections.Generic.List<TreeInstance> treelist = new System.Collections.Generic.List<TreeInstance>();
TreePrototype[] prototypes = new TreePrototype[_trees.Count];
for (int k = 0; k < _trees.Count; k++)
{
TreeMapInfo2 tree = _trees[k];
// Load splatmap file
string treefile = string.Format(tree.Filemask, xvalue, yvalue);
string[] treefiles = System.IO.Directory.GetFiles(_imagesPath, treefile + ".*");
System.Uri uri = new System.Uri(treefiles[0]);
WWW imageloader = new WWW(uri.AbsoluteUri);
treefiles = null;
while (!imageloader.isDone)
{
}
Color[] imagecolors = imageloader.texture.GetPixels();
int imagewidth = imageloader.texture.width;
imageloader.Dispose();
// Create Tree Prototype
TreePrototype tp = new TreePrototype();
tp.prefab = tree.Prefab;
tp.bendFactor = tree.BendFactor;
prototypes[k] = tp;
float treefactor = 0;
for (int u = 0; u < _heightmapsize.x; u++)
{
for (int v = 0; v < _heightmapsize.y; v++)
{
//if (imagecolors[(((imagewidth - 1) - v) * imagewidth) + u].grayscale >= 0.035)
//{
// Get treemap resolution / terrain size bias
float xbias = _terrainsize.x/imagewidth;
float ybias = _terrainsize.z/imagewidth;
// Calculate Tree Position
float terrainheight = tdata.size.y;
float terrainwidth = tdata.size.x;
Vector3 treeposition = new Vector3();
treeposition.x = (v*xbias)/terrainwidth;
treeposition.y = tdata.GetHeight(v, u)/terrainheight;
treeposition.z = (u*ybias)/terrainwidth;
TreeInstance ti = new TreeInstance();
ti.prototypeIndex = k;
ti.position = treeposition;
ti.lightmapColor = new Color(1, 1, 1);
ti.heightScale = (tree.HeightScale/100) +
UnityEngine.Random.Range(-(tree.HeightVariation/100),
(tree.HeightVariation/100));
ti.widthScale = (tree.WidthScale/100) +
UnityEngine.Random.Range(-(tree.WidthVariation/100), (tree.WidthVariation/100));
ti.color = new Color(1, 1, 1);
float treestoplace = imagecolors[((imagewidth - 1) - u)*imagewidth + v].r*tree.MaxDensity;
treefactor += treestoplace;
if (treefactor > (1.0f + UnityEngine.Random.Range(-0.2f, 0.2f)))
{
treelist.Add(ti);
treefactor = 0;
}
}
}
}
tdata.treePrototypes = prototypes;
tdata.treeInstances = treelist.ToArray();
prototypes = null;
treelist.RemoveRange(0, treelist.Count);
treelist = null;
System.GC.Collect(0);
}
}