Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void CalculateCarPlaces()
- {
- Array.Sort<int>(this.carPositions, (Comparison<int>) ((a, b) =>
- {
- int index;
- if (this.Cars[a] is AICar)
- index = ((AICar) this.Cars[a]).CurrentWaypoint;
- else
- index = this.CurrentCheckpoint;
- int num1;
- if (this.Cars[b] is AICar)
- num1 = ((AICar) this.Cars[b]).CurrentWaypoint;
- else
- num1 = this.CurrentCheckpoint;
- float num2 = Vector3.Distance(this.Cars[a].Rigidbody.Position, this.Waypoints[index].Position);
- float num3 = Vector3.Distance(this.Cars[b].Rigidbody.Position, this.Waypoints[index].Position);
- if (index > num1)
- return 1;
- if (index < num1)
- return -1;
- if ((double) num2 > (double) num3)
- return 1;
- if ((double) num2 < (double) num3)
- return -1;
- return 0;
- }));
- }
Add Comment
Please, Sign In to add comment