@@ -284,7 +284,8 @@ namespace Dreamteck.Splines
|
||||
splineLocalPosition.y = applyPositionY ? 0f : splineLocalPosition.y;
|
||||
splineLocalPosition.z = applyPositionZ ? 0f : splineLocalPosition.z;
|
||||
inputPosition = matrix.MultiplyPoint3x4(splineLocalPosition);
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
if (applyPositionX) inputPosition.x = position.x;
|
||||
if (applyPositionY) inputPosition.y = position.y;
|
||||
@@ -295,7 +296,9 @@ namespace Dreamteck.Splines
|
||||
|
||||
private Quaternion GetRotation(Quaternion inputRotation)
|
||||
{
|
||||
|
||||
rotation = Quaternion.LookRotation(_splineResult.forward * (direction == Spline.Direction.Forward ? 1f : -1f), _splineResult.up);
|
||||
//Debug.Log(_splineResult.forward * (direction == Spline.Direction.Forward ? 1f : -1f) + " " + _splineResult.up);
|
||||
if (_2dMode)
|
||||
{
|
||||
if (applyRotation2D)
|
||||
@@ -321,7 +324,8 @@ namespace Dreamteck.Splines
|
||||
targetEuler.y = applyRotationY ? 0f : targetEuler.y;
|
||||
targetEuler.z = applyRotationZ ? 0f : targetEuler.z;
|
||||
inputRotation = rotation * Quaternion.Euler(targetEuler);
|
||||
} else
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!applyRotationX || !applyRotationY || !applyRotationZ)
|
||||
{
|
||||
@@ -332,7 +336,7 @@ namespace Dreamteck.Splines
|
||||
if (!applyRotationZ) targetEuler.z = sourceEuler.z;
|
||||
inputRotation.eulerAngles = targetEuler;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
inputRotation = rotation;
|
||||
}
|
||||
@@ -351,7 +355,7 @@ namespace Dreamteck.Splines
|
||||
|
||||
public void OnBeforeSerialize()
|
||||
{
|
||||
|
||||
|
||||
}
|
||||
|
||||
public void OnAfterDeserialize()
|
||||
|
||||
Reference in New Issue
Block a user