コード例 #1
0
ファイル: Effect.cpp プロジェクト: RexBaribal/projectanarchy
void RPG_Effect::ThinkFunction()
{
  ClearVisualEffectIfDead();

  if (m_cameraShaking)
  {
    UpdateCameraShake(Vision::GetTimer()->GetTimeDifference());
  }

  DebugDrawEffectPosition();
}
コード例 #2
0
bool UCameraModifier_CameraShake::ModifyCamera(class APlayerCameraManager* Camera, float DeltaTime, FMinimalViewInfo& InOutPOV)
{
	// Update the alpha
	UpdateAlpha(Camera, DeltaTime);

	// Call super where modifier may be disabled
	Super::ModifyCamera(Camera, DeltaTime, InOutPOV);

	// If no alpha, exit early
	if( Alpha <= 0.f )
	{
		return false;
	}

	// Update Screen Shakes array
	if( ActiveShakes.Num() > 0 )
	{
		for(int32 i=0; i<ActiveShakes.Num(); i++)
		{
			UpdateCameraShake(DeltaTime, ActiveShakes[i], InOutPOV);
		}

		// Delete any obsolete shakes
		for(int32 i=ActiveShakes.Num()-1; i>=0; i--)
		{
			FCameraShakeInstance& ShakeInst = ActiveShakes[i];
			if( !ShakeInst.SourceShake
				|| ( (ShakeInst.OscillatorTimeRemaining == 0.f) && 
					 ((ShakeInst.AnimInst == NULL) || (ShakeInst.AnimInst->bFinished == true)) ) )
			{
				ActiveShakes.RemoveAt(i,1);
			}
		}
	}

	// If ModifyCamera returns true, exit loop
	// Allows high priority things to dictate if they are
	// the last modifier to be applied
	// Returning true causes to stop adding another modifier! 
	// Returning false is the right behavior since this is not high priority modifier.
	return false;
}