public override void Apply() { //Notifier.AddMessage(StepCountTotal.ToString()); var f = Mathf.SmoothStep(0, 1, DurationCurrent / Duration); //var f = (float)_step / _steps; var l = Mathf.Lerp(beginLength, endLength, f); var d = Vector3.Lerp(valueBegin.GetPosition(), valueEnd.GetPosition(), f); d.Normalize(); d *= l; ValueCurrent = MatrixUtilities.CreateRotationMatrix(Quaternion.Slerp(ValueOriginal.GetRotation(), ValueTarget.GetRotation(), f)) * MatrixUtilities.CreateTranslationMatrix(d); transform.position = d; transform.rotation = Quaternion.Slerp(ValueOriginal.GetRotation(), ValueTarget.GetRotation(), f); }
public override void Revert() { transform.position = ValueOriginal.GetPosition(); transform.rotation = ValueOriginal.GetRotation(); }
public override void Revert() { transform.SetPosition(ValueOriginal.GetPosition(), SetGlobal); transform.SetRotation(ValueOriginal.GetRotation(), SetGlobal); }