• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ GetWorldTimerManager函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中GetWorldTimerManager函数的典型用法代码示例。如果您正苦于以下问题:C++ GetWorldTimerManager函数的具体用法?C++ GetWorldTimerManager怎么用?C++ GetWorldTimerManager使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了GetWorldTimerManager函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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


示例16: StopFire

void ASWeapon::OnUnEquip()
{
	bIsEquipped = false;
	StopFire();

	if (bPendingEquip)
	{
		StopWeaponAnimation(EquipAnim);
		bPendingEquip = false;

		GetWorldTimerManager().ClearTimer(EquipFinishedTimerHandle);
	}
	if (bPendingReload)
	{
		StopWeaponAnimation(ReloadAnim);
		bPendingReload = false;

		GetWorldTimerManager().ClearTimer(TimerHandle_ReloadWeapon);
	}

	DetermineWeaponState();
}
开发者ID:Raynaron,项目名称:EpicSurvivalGameSeries,代码行数:22,代码来源:SWeapon.cpp


示例17: SetConnectionState

void AOnlineBeaconClient::DestroyBeacon()
{
	SetConnectionState(EBeaconConnectionState::Closed);

	UWorld* World = GetWorld();
	if (World)
	{
		// Fail safe for connection to server but no client connection RPC
		GetWorldTimerManager().ClearTimer(TimerHandle_OnFailure);
	}

	Super::DestroyBeacon();
}
开发者ID:frobro98,项目名称:UnrealSource,代码行数:13,代码来源:OnlineBeaconClient.cpp


示例18: GetWorldTimerManager

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

	if (Role == ROLE_Authority)
	{
		// Set a timer to increment hunger every interval
		FTimerHandle Handle;
		GetWorldTimerManager().SetTimer(Handle, this, &ASCharacter::IncrementHunger, IncrementHungerInterval, true);

		SpawnDefaultInventory();
	}
}
开发者ID:MarcioGeremia,项目名称:EpicSurvivalGameSeries,代码行数:13,代码来源:SCharacter.cpp


示例19: SaveArrayToFile

void AHeatmapDataCollector::CollectData()
{
	//if (!FPlatformFileManager::Get().GetPlatformFile().DirectoryExists(*SaveDir))											// Dir exist?
	//{
	//	FPlatformFileManager::Get().GetPlatformFile().CreateDirectory(*SaveDir);											// create if it not exist
	//	if (!FPlatformFileManager::Get().GetPlatformFile().DirectoryExists(*SaveDir))										//still could not make directory?
	//	{
	//		return false;																									//Could not make the specified directory
	//	}
	//	auto FileToSave = SaveDir + "/" + FileName;
	//	if (!FPlatformFileManager::Get().GetPlatformFile().FileExists(*FileToSave))	return false;
	//}
	if (bCollectData)
	{
		if (CharCurrentPtr)
		{
			FVector CALoc = CharCurrentPtr->GetActorLocation();

			/*if (SplineDataSwitcher == ESplineDataSwitcher::ES_ArrayData)
			{
				auto FileToSaveArr = SaveDir + "/" + "ArrayLocationLogs.txt";
				static TArray<int16> ArrayToFile;
				ArrayToFile.Add(CALoc.X);
				ArrayToFile.Add(CALoc.Y);
				ArrayToFile.Add(CALoc.Z);
				SaveArrayToFile(ArrayToFile, *FileToSaveArr);
				return true;
			}*/
			if (SplineDataSwitcher == ESplineDataSwitcher::ES_StringData)
			{
				auto FileToSaveArr = SaveDirectoryPath + "/" + LogFileName + "_" + FString::FromInt(CharNumberInWorld) + ".txt";

				const FString& loc = CALoc.ToString();
				const TCHAR* StrPtr = *loc;

				StringOfCoords.Append(" line");
				StringOfCoords.Append(FString::FromInt(it));
				StringOfCoords.Append(" ");
				StringOfCoords.Append(StrPtr);
				StringOfCoords.Append("\n");
				it++;
				FFileHelper::SaveStringToFile(*StringOfCoords, *FileToSaveArr);//FFileHelper::EEncodingOptions::ForceUTF8WithoutBOM

			}
		}
	}
	if (CharCurrentPtr)
	{
		GetWorldTimerManager().SetTimer(ChekTimeHandler, this, &AHeatmapDataCollector::CollectData, UpdateTimeBetweenChek, true);
	}
}
开发者ID:Dredfort,项目名称:TDown,代码行数:51,代码来源:HeatmapDataCollector.cpp


示例20: GetWorldTimerManager

void ACSUEBomb::checkOverlap() {
	TArray<AActor*> nearbyT;
	//UE_LOG(LogTemp, Warning, TEXT("FOUND ACTOR"));
	
	bombMesh->GetOverlappingActors(nearbyT);

	for (int32 i = 0; i < nearbyT.Num(); i++) {
		//UE_LOG(LogTemp, Warning, TEXT("FOUND ACTOR"));

		auto terrorist = Cast<ACSUETerrorist>(nearbyT[i]);
		auto ct = Cast<ACSUECounterTerrorist>(nearbyT[i]);
		auto player = Cast<ACSUECharacter>(nearbyT[i]);
		if (terrorist) {
			//UE_LOG(LogTemp, Warning, TEXT("FOUND TERRORIST"));
			//start bomb timer
			if (!planted) {
				GetWorldTimerManager().SetTimer(bombTimer, this, &ACSUEBomb::bombExplode, 2.f, false);
				planted = true;
				UE_LOG(LogTemp, Warning, TEXT("bomb planted"));

			}

		}

		if (player && player->getEnemyTeam() == FString(TEXT("ct"))) {
			//UE_LOG(LogTemp, Warning, TEXT("FOUND TERRORIST"));
			if (!planted) {
				GetWorldTimerManager().SetTimer(bombTimer, this, &ACSUEBomb::bombExplode, 10.f, false);
				planted = true;
				UE_LOG(LogTemp, Warning, TEXT("bomb planted"));

			}


		}
		else if (ct) {
			//defuse shit

			//timer not started yet?
			if (!GetWorldTimerManager().IsTimerActive(defuseTimer)) {
				GetWorldTimerManager().SetTimer(defuseTimer, this, &ACSUEBomb::bombDefused, 3.f, false);

				
			}
			
		}
		else {
			//if defuse timer is active, turn it off
			if (GetWorldTimerManager().IsTimerActive(defuseTimer)) {
				GetWorldTimerManager().ClearTimer(defuseTimer);
			}

		}
	

	}

}
开发者ID:narmour,项目名称:CSUE,代码行数:58,代码来源:CSUEBomb.cpp



注:本文中的GetWorldTimerManager函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ GetWorldTransform函数代码示例发布时间:2022-05-30
下一篇:
C++ GetWorldStateFromGateEntry函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap