Beispiel #1
0
void UCameraShake::StopShake()
{
	// stop cam anim if playing
	if ((AnimInst != nullptr) && !AnimInst->bFinished)
	{
		CameraOwner->StopCameraAnimInst(AnimInst, true);
		AnimInst = nullptr;
	}

	ReceiveStopShake();
}
void UCameraShake::StopShake(bool bImmediately)
{
	if (bImmediately)
	{
		// stop cam anim if playing
		if (AnimInst && !AnimInst->bFinished)
		{
			if (CameraOwner)
			{
				CameraOwner->StopCameraAnimInst(AnimInst, true);
			}
			else
			{
				AnimInst->Stop(true);
			}
		}

		AnimInst = nullptr;

		// stop oscillation
		OscillatorTimeRemaining = 0.f;
	}
	else
	{
		// advance to the blend out time
		OscillatorTimeRemaining = FMath::Min(OscillatorTimeRemaining, OscillationBlendOutTime);

		if (AnimInst && !AnimInst->bFinished)
		{
			if (CameraOwner)
			{
				CameraOwner->StopCameraAnimInst(AnimInst, false);
			}
			else
			{
				// playing without a cameramanager, stop it ourselves
				AnimInst->Stop(false);
			}
		}
	}

	ReceiveStopShake(bImmediately);
}