public static List <LODGroupGUI.LODInfo> CreateLODInfos(int numLODs, Rect area, Func <int, string> nameGen, Func <int, float> heightGen) { List <LODGroupGUI.LODInfo> list = new List <LODGroupGUI.LODInfo>(); for (int i = 0; i < numLODs; i++) { LODGroupGUI.LODInfo lODInfo = new LODGroupGUI.LODInfo(i, nameGen(i), heightGen(i)); lODInfo.m_ButtonPosition = LODGroupGUI.CalcLODButton(area, lODInfo.ScreenPercent); float startPercent = (i != 0) ? list[i - 1].ScreenPercent : 1f; lODInfo.m_RangePosition = LODGroupGUI.CalcLODRange(area, startPercent, lODInfo.ScreenPercent); list.Add(lODInfo); } return(list); }
public static List <LODGroupGUI.LODInfo> CreateLODInfos(int numLODs, Rect area, Func <int, string> nameGen, Func <int, float> heightGen) { List <LODGroupGUI.LODInfo> lodInfoList = new List <LODGroupGUI.LODInfo>(); for (int lodLevel = 0; lodLevel < numLODs; ++lodLevel) { LODGroupGUI.LODInfo lodInfo = new LODGroupGUI.LODInfo(lodLevel, nameGen(lodLevel), heightGen(lodLevel)); lodInfo.m_ButtonPosition = LODGroupGUI.CalcLODButton(area, lodInfo.ScreenPercent); float startPercent = lodLevel != 0 ? lodInfoList[lodLevel - 1].ScreenPercent : 1f; lodInfo.m_RangePosition = LODGroupGUI.CalcLODRange(area, startPercent, lodInfo.ScreenPercent); lodInfoList.Add(lodInfo); } return(lodInfoList); }