public TracerMaterial GetTracerMaterialByColor(Color32 color) { if (this.tracerColors.Count == 0) { return(null); } TracerMaterial tracerMaterial = null; foreach (TracerMaterial tracerColor in this.tracerColors) { Color32 color32 = tracerColor.color; if (color32.r != color.r || color32.g != color.g || color32.b != color.b) { continue; } tracerMaterial = tracerColor; } return(tracerMaterial); }
public bool AssignTracerColorsToTFlightData(ref List <TFlightData> list, bool useClubName) { string item; string str; if (this.tracerColors.Count <= 0) { return(false); } int num = 0; for (int i = 0; i < list.Count; i++) { if (i != 0) { bool flag = false; int num1 = 0; while (num1 < i) { if (!useClubName) { item = list[num1].clubTypeID; str = list[i].clubTypeID; } else { item = list[num1].clubName; str = list[i].clubName; } if (!item.Equals(str)) { num1++; } else { flag = true; list[i].flightColor = list[num1].flightColor; break; } } if (!flag) { num++; TracerMaterial tracerMaterialByIndex = this.GetTracerMaterialByIndex(num); if (tracerMaterialByIndex != null) { list[i].flightColor = tracerMaterialByIndex.color; } } } else { TracerMaterial tracerMaterial = this.GetTracerMaterialByIndex(i); if (tracerMaterial != null) { list[i].flightColor = tracerMaterial.color; } } } return(true); }