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