當前位置: 首頁>>代碼示例>>C++>>正文


C++ GetWorldTimerManager函數代碼示例

本文整理匯總了C++中GetWorldTimerManager函數的典型用法代碼示例。如果您正苦於以下問題:C++ GetWorldTimerManager函數的具體用法?C++ GetWorldTimerManager怎麽用?C++ GetWorldTimerManager使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。


在下文中一共展示了GetWorldTimerManager函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。

示例1: GetWorldTimerManager

// Start the block restore event (Called by weapon)
void ALevelBlock::StartTimedRestore(AWeapon* newParentWeapon, float Time)
{
	if (newParentWeapon)
	{
		ParentWeapon = newParentWeapon;
		if (Time>0)
		{
			FTimerHandle MyHandle;
			GetWorldTimerManager().SetTimer(MyHandle, this, &ALevelBlock::ReturnBlock, Time, false);
		}
	}
}
開發者ID:hoelzl,項目名稱:Rade,代碼行數:13,代碼來源:LevelBlock.cpp

示例2: GetMesh

void ABatteryPickup::WasCollected_Implementation()
{
	Super::WasCollected_Implementation();
	
	ParticleSystem = UGameplayStatics::SpawnEmitterAttached(ParticleSystemTemplate, GetMesh(), NAME_None);
	UpdateBeamTargetPoint();

	FTimerHandle UnusedHandle;
	GetWorldTimerManager().SetTimer(
		UnusedHandle, this, &ABatteryPickup::DestroyAfterDelay, 1, false);

}
開發者ID:SirTrav,項目名稱:Unreal-Projects,代碼行數:12,代碼來源:BatteryPickup.cpp

示例3: StopSimulatingWeaponFire

void ASWeapon::OnBurstFinished()
{
	BurstCounter = 0;

	if (GetNetMode() != NM_DedicatedServer)
	{
		StopSimulatingWeaponFire();
	}

	GetWorldTimerManager().ClearTimer(TimerHandle_HandleFiring);
	bRefiring = false;
}
開發者ID:Raynaron,項目名稱:EpicSurvivalGameSeries,代碼行數:12,代碼來源:SWeapon.cpp

示例4: UpdateTimerDisplay

void ACountdown::AdvanceTimer()
{
	--CountdownTime;
	UpdateTimerDisplay();
	if (CountdownTime < 1)
	{
		// We're done counting down, so stop running the timer.
		GetWorldTimerManager().ClearTimer(CountdownTimerHandle);
		// Perform any special actions we want to do when the timer ends.
		CountdownHasFinished();
	}
}
開發者ID:SRombauts,項目名稱:UE4QuickStart,代碼行數:12,代碼來源:Countdown.cpp

示例5: StopMovement

void ARealmMoveController::GameEnded()
{
	StopMovement();
	GetWorldTimerManager().ClearAllTimersForObject(this);

	AGameCharacter* gc = Cast<AGameCharacter>(GetCharacter());
	if (IsValid(gc))
	{
		gc->StopAutoAttack();
		gc->GetCharacterMovement()->SetMovementMode(MOVE_None);
	}
}
開發者ID:MatrIsCool,項目名稱:Mythos-Realm,代碼行數:12,代碼來源:RealmMoveController.cpp

示例6: GetWorldTimerManager

void ALobbyBeaconState::PostInitializeComponents()
{
	Super::PostInitializeComponents();

	if (Role == ROLE_Authority)
	{
		FTimerDelegate TimerDelegate = FTimerDelegate::CreateUObject(this, &ALobbyBeaconState::OneSecTick);
		GetWorldTimerManager().SetTimer(OneSecTimerHandle, TimerDelegate, 1.0f, true);

		LastTickTime = FPlatformTime::Seconds();
	}
}
開發者ID:frobro98,項目名稱:UnrealSource,代碼行數:12,代碼來源:LobbyBeaconState.cpp

示例7: OnRep_Armed

void ABomb::OnProjectileBounce(const FHitResult& ImpactResult, const FVector& ImpactVelocity)
{
	if (Role == ROLE_Authority)
	{
		Armed = true;

		// You must call the rep function yourself for the server or it will never change color.
		OnRep_Armed();

		GetWorldTimerManager().SetTimer(BombTimerHandle, this, &ABomb::OnFuseExpired,FuseTime, false);
	}
}
開發者ID:marcthenarc,項目名稱:NetGameCPP,代碼行數:12,代碼來源:Bomb.cpp

示例8: GetWorldTimerManager

void ALevelBounds::SubscribeToUpdateEvents()
{
	if (bSubscribedToEvents == false && GIsEditor && !GetWorld()->IsPlayInEditor())
	{
		GetWorldTimerManager().SetTimer(this, &ALevelBounds::OnTimerTick, 1, true);
		GEngine->OnActorMoved().AddUObject(this, &ALevelBounds::OnLevelActorMoved);
		GEngine->OnLevelActorDeleted().AddUObject(this, &ALevelBounds::OnLevelActorAddedRemoved);
		GEngine->OnLevelActorAdded().AddUObject(this, &ALevelBounds::OnLevelActorAddedRemoved);
		
		bSubscribedToEvents = true;
	}
}
開發者ID:1vanK,項目名稱:AHRUnrealEngine,代碼行數:12,代碼來源:LevelBounds.cpp

示例9: GetWorldTimerManager

void ARageHUD::PostBeginPlay()
{
	if (GetOwningPawn() && Cast<ARagePlayerCar>(GetOwningPawn()))
	{
		Cast<ARagePlayerCar>(GetOwningPawn())->TheHUD = this;
	}
	else 
	{
		FTimerHandle MyHandle;
		GetWorldTimerManager().SetTimer(MyHandle, this, &ARageHUD::PostBeginPlay, PostDelay, false);
	}
}
開發者ID:vagenv,項目名稱:RageRacing,代碼行數:12,代碼來源:RageHUD.cpp

示例10: toggleCastOngoing

void AManaJourneyCharacter::useShell()
{
	if (characterClasses.Contains("whiteMageClass") && whiteMageClassRef && !castOngoing)
	{
		toggleCastOngoing();
		bool bCastedShell = false;
		bCastedShell = whiteMageClassRef->castShell(*this, GetMesh());
		if (bCastedShell)
		{
			toggleCharacterMovement();
			updatePhysicProtection();
			castShellAnimation(level);
			toggleCastOngoing();

			//NOTE remove shell effect after fadeTimeForEffect has set to false (so add slight delay for beeing sure) 
			FTimerHandle UpdatePhysicProtectionTimer;
			GetWorldTimerManager().ClearTimer(UpdatePhysicProtectionTimer);
			FTimerDelegate UpdatePhysicProtectionTimerDelegate = FTimerDelegate::CreateUObject(this, &AManaJourneyCharacter::updatePhysicProtection);
			GetWorldTimerManager().SetTimer(UpdatePhysicProtectionTimer, UpdatePhysicProtectionTimerDelegate, fadeTimeForEffect + 0.2f, false);

			FTimerHandle EnableMovementTimer;
			GetWorldTimerManager().ClearTimer(EnableMovementTimer);
			FTimerDelegate updateCharacterMovementDelegate = FTimerDelegate::CreateUObject(this, &AManaJourneyCharacter::toggleCharacterMovement);
			GetWorldTimerManager().SetTimer(EnableMovementTimer, updateCharacterMovementDelegate, 1.50f, false);

			// timer for setting cast to false
			FTimerHandle CastOngoingHandler;
			GetWorldTimerManager().ClearTimer(CastOngoingHandler);
			FTimerDelegate CastOngoingHandlerDelegate = FTimerDelegate::CreateUObject(this, &AManaJourneyCharacter::toggleCastOngoing);
			GetWorldTimerManager().SetTimer(CastOngoingHandler, CastOngoingHandlerDelegate, whiteMageClassRef->fShellTimer, false);
		}
	}
}
開發者ID:xhallix,項目名稱:UnrealEngine_Manajourney,代碼行數:33,代碼來源:ManaJourneyCharacter.cpp

示例11: OnRep_ElapsedTime

void AGameState::DefaultTimer()
{
	if (IsMatchInProgress())
	{
		++ElapsedTime;
		if (GetNetMode() != NM_DedicatedServer)
		{
			OnRep_ElapsedTime();
		}
	}

	GetWorldTimerManager().SetTimer(TimerHandle_DefaultTimer, this, &AGameState::DefaultTimer, 1.0f / GetWorldSettings()->GetEffectiveTimeDilation(), true);
}
開發者ID:colwalder,項目名稱:unrealengine,代碼行數:13,代碼來源:GameState.cpp

示例12: GetWorld

void ABaseWeapon::HandleFiring()
{
	const float GameTime = GetWorld()->GetTimeSeconds();

	if (LastFireTime > 0 && WeaponConfig.TimeBetweenShots > 0 && LastFireTime + WeaponConfig.TimeBetweenShots > GameTime)
	{
		GetWorldTimerManager().SetTimer(time_handler, this, &ABaseWeapon::Fire, LastFireTime + WeaponConfig.TimeBetweenShots - GameTime, false);
	}
	else
	{
		Fire();
	}
}
開發者ID:ZerosGames,項目名稱:FightKillWin,代碼行數:13,代碼來源:BaseWeapon.cpp

示例13: GetWorld

void ASWeapon::OnBurstStarted()
{
	const float GameTime = GetWorld()->GetTimeSeconds();
	if ((LastFireTime > 0.0f) && (TimeBetweenShots > 0.0f) &&
		(LastFireTime + TimeBetweenShots > GameTime))
	{
		GetWorldTimerManager().SetTimer(HandleFiringTimerHandle, this, &ASWeapon::HandleFiring, LastFireTime + TimeBetweenShots - GameTime, false);
	}
	else
	{
		HandleFiring();
	}
}
開發者ID:enki390,項目名稱:SurvivalGameStudy,代碼行數:13,代碼來源:SWeapon.cpp

示例14: SlowEnemy

void AIceSpell::DealUniqueSpellFunctionality(ABBotCharacter* enemyPlayer)
{
  if (HasAuthority())
  {
	  // Slow the enemy movement speed
	  SlowEnemy(enemyPlayer);
	
	  // Bind enemy player to SlowEnemyEnd delegate
	  slowMovementDelegate.BindUObject(this, &AIceSpell::SlowEnemyEnd, (ABBotCharacter*)enemyPlayer);
	  // Remove the slow effect after the slow duration
	  GetWorldTimerManager().SetTimer(slowMovementHandler, slowMovementDelegate, slowDuration, false);
  }
}
開發者ID:Lawrence-Abadier,項目名稱:UEProject,代碼行數:13,代碼來源:IceSpell.cpp

示例15: ServerSetAnimID

// Unequip curent weapon
void ARadeCharacter::UnEquipStart()
{
	// Set Animation State
	ServerSetAnimID(EAnimState::UnEquip);


	if (TheWeapon)
	{
		// Set Delay of current weapon
		FTimerHandle myHandle;
		GetWorldTimerManager().SetTimer(myHandle, this, &ARadeCharacter::UnEquipEnd, TheWeapon->EquipTime, false);
	}
	else 
	{
		// Set Default Delay
		FTimerHandle myHandle;
		GetWorldTimerManager().SetTimer(myHandle, this, &ARadeCharacter::UnEquipEnd, DefaultWeaponEquipDelay, false);
	}

	UpdateComponentsVisibility();

}
開發者ID:dcyoung,項目名稱:Rade,代碼行數:23,代碼來源:RadeCharacter.cpp


注:本文中的GetWorldTimerManager函數示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。