сростил проекты
This commit is contained in:
1 parent
a4573f2d12
commit
dfd44aa129
684 files changed
+152796
-67
No files matched your search
@@ -0,0 +1,17 @@
|
||||
|
||||
using UnityEngine;
|
||||
|
||||
public class SimpleLaneFollowingBehavior : ICarBehavior
|
||||
{
|
||||
|
||||
public static readonly SimpleLaneFollowingBehavior Instance = new SimpleLaneFollowingBehavior();
|
||||
|
||||
public void UpdateBehavior(TrafficCar car)
|
||||
{
|
||||
car.transform.Translate(Vector3.forward * car.forwardSpeed * Time.deltaTime);
|
||||
|
||||
Vector3 newPos = car.transform.position;
|
||||
newPos.x = Mathf.Lerp(newPos.x, car.TargetX, Time.deltaTime * car.laneChangeSpeed);
|
||||
car.transform.position = newPos;
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user