game(ai): linq the foreach in Steering()
This commit is contained in:
parent
e38602910d
commit
327d51a7e3
|
@ -6,6 +6,7 @@
|
|||
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
/// <summary>
|
||||
|
@ -102,8 +103,7 @@ public void Brake()
|
|||
/// </summary>
|
||||
public void Steering()
|
||||
{
|
||||
foreach (var wheel in wheels)
|
||||
if (wheel.axel == Axel.Front)
|
||||
foreach (var wheel in wheels.Where(wheel => wheel.axel == Axel.Front))
|
||||
wheel.wheelCollider.steerAngle = _currentTurn;
|
||||
}
|
||||
|
||||
|
|
Reference in a new issue