/// <summary> /// Sets the transform to xPos and yPos positions on the road. /// </summary> /// <param name="trans">Trans.</param> /// <param name="xPos">X position.</param> /// <param name="yPos">Y position.</param> public void setTransform(Transform trans, float xPos, float yPos) { Vector3 positionOfPlayer = Fx.Pos(xPos); trans.position = positionOfPlayer + Fx.Right(xPos) * (fxRoad.roadWidth / 2) * yPos; trans.LookAt(positionOfPlayer + Fx.Dir(xPos) + Fx.Right(xPos) * (fxRoad.roadWidth / 2) * yPos , Fx.Norm(xPos + 0.1f)); }
/// <summary> /// Sets the transform of the Trans to the local (x,y) position. /// </summary> /// <param name="trans">Trans.</param> public void setTransform(Transform trans) { Vector3 positionOfPlayer = Fx.Pos(x); trans.position = positionOfPlayer + Fx.Right(x) * (fxRoad.roadWidth / 2) * y; trans.LookAt(positionOfPlayer + Fx.Dir(x) + Fx.Right(x) * (fxRoad.roadWidth / 2) * y , Fx.Norm(x + 0.1f)); }