protected virtual void FixedUpdate() { if (_manageBranch && _otherStick == null) { _otherStick = _targetStick as SplineControllerMove; } ManageSplineChange(); if (SplineBase != _otherStick.SplineBase) { _lastPathPosition += _otherStick.SpeedMove * Time.fixedDeltaTime; BasicPositionAndOffset(_lastPathPosition); BasicRotationAndOffset(_lastPathPosition); } //else if (_lerpWhenClosingBranch.IsRunning()) //{ // CalculateOffset(out float offset, out float max); // _lastPathPosition = Mathf.Lerp(_lastPathPosition, offset, _lerpWhenClosingBranch.GetCurrentPercentFromTheEnd()); //} else { AttemptToStick(); } }
private void OnEnable() { _otherStick = _targetStick as SplineControllerMove; }