38. Instant Gameplay Effects
This commit is contained in:
		
							
								
								
									
										
											BIN
										
									
								
								Project/Binaries/Win64/UnrealEditor-GasaEditor.dll
									 (Stored with Git LFS)
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Project/Binaries/Win64/UnrealEditor-GasaEditor.dll
									 (Stored with Git LFS)
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Project/Content/Core/Pickups/BP_HealthPotion_RawEffect.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Project/Content/Core/Pickups/BP_HealthPotion_RawEffect.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										
											BIN
										
									
								
								Project/Content/Core/Pickups/BP_ManaPotion_RawEffect.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
							
						
						
									
										
											BIN
										
									
								
								Project/Content/Core/Pickups/BP_ManaPotion_RawEffect.uasset
									 (Stored with Git LFS)
									
									
									
									
								
							
										
											Binary file not shown.
										
									
								
							| @@ -19,5 +19,6 @@ void AGasaEffectActor::ApplyEffectToActor(AActor* Actor, TSubclassOf<UGameplayEf | |||||||
| 	Context.AddSourceObject(Actor); | 	Context.AddSourceObject(Actor); | ||||||
| 	 | 	 | ||||||
| 	FGameplayEffectSpecHandle Spec = AS->MakeOutgoingSpec( EffectClass, 1.0f, Context ); | 	FGameplayEffectSpecHandle Spec = AS->MakeOutgoingSpec( EffectClass, 1.0f, Context ); | ||||||
| 	AS->ApplyGameplayEffectSpecToSelf( * Spec.Data ); | 	if (Spec.IsValid()) | ||||||
|  | 		AS->ApplyGameplayEffectSpecToSelf( * Spec.Data ); | ||||||
| } | } | ||||||
|   | |||||||
| @@ -29,7 +29,6 @@ AGasaGameState::AGasaGameState() | |||||||
| void AGasaGameState::OnGameFrameworkInitialized() | void AGasaGameState::OnGameFrameworkInitialized() | ||||||
| { | { | ||||||
| 	NetLog("Received gameplay framework initialization."); | 	NetLog("Received gameplay framework initialization."); | ||||||
|  |  | ||||||
| 	if (IsServer()) | 	if (IsServer()) | ||||||
| 	{ | 	{ | ||||||
| 		if (PlayerArray.Num() > 0) | 		if (PlayerArray.Num() > 0) | ||||||
| @@ -41,7 +40,6 @@ void AGasaGameState::OnGameFrameworkInitialized() | |||||||
| 			NetLog("Was not able to assign HostingPlayer!", ELogV::Error); | 			NetLog("Was not able to assign HostingPlayer!", ELogV::Error); | ||||||
| 		} | 		} | ||||||
| 	} | 	} | ||||||
|  |  | ||||||
| 	BP_OnGameFrameworkInitialized(); | 	BP_OnGameFrameworkInitialized(); | ||||||
| } | } | ||||||
| #pragma endregion GameFramework | #pragma endregion GameFramework | ||||||
| @@ -71,7 +69,6 @@ void AGasaGameState::HandleBeginPlay() | |||||||
| void AGasaGameState::SeamlessTravelTransitionCheckpoint(bool bToTransitionMap) | void AGasaGameState::SeamlessTravelTransitionCheckpoint(bool bToTransitionMap) | ||||||
| { | { | ||||||
| 	Super::SeamlessTravelTransitionCheckpoint(bToTransitionMap); | 	Super::SeamlessTravelTransitionCheckpoint(bToTransitionMap); | ||||||
|  |  | ||||||
| 	NetLog("SeamlessTravelTransitionCheckpoint"); | 	NetLog("SeamlessTravelTransitionCheckpoint"); | ||||||
| 	NetLog(FString("ToTransitionMap: ") + FString(bToTransitionMap ? "true" : "false")); | 	NetLog(FString("ToTransitionMap: ") + FString(bToTransitionMap ? "true" : "false")); | ||||||
|  |  | ||||||
| @@ -90,7 +87,6 @@ void AGasaGameState::SeamlessTravelTransitionCheckpoint(bool bToTransitionMap) | |||||||
| void AGasaGameState::BeginPlay() | void AGasaGameState::BeginPlay() | ||||||
| { | { | ||||||
| 	Super::BeginPlay(); | 	Super::BeginPlay(); | ||||||
|  |  | ||||||
| 	NetLog("BeginPlay"); | 	NetLog("BeginPlay"); | ||||||
|  |  | ||||||
| 	// Notified as initialized here as any possible components should also be initialized by this point. | 	// Notified as initialized here as any possible components should also be initialized by this point. | ||||||
| @@ -100,18 +96,20 @@ void AGasaGameState::BeginPlay() | |||||||
| 	GI->NotifyGameFrameworkClassReady(EGameFrameworkClassFlag::GameState); | 	GI->NotifyGameFrameworkClassReady(EGameFrameworkClassFlag::GameState); | ||||||
| 	 | 	 | ||||||
| #if ENABLE_COG | #if ENABLE_COG | ||||||
|     CogWindowManager = NewObject<UCogWindowManager>(this); | 	for (local_persist int32 do_once = 0; do_once == 0; ++ do_once ) | ||||||
|     CogWindowManagerRef = CogWindowManager; | 	{ | ||||||
|  | 		CogWindowManager = NewObject<UCogWindowManager>(this); | ||||||
|  | 		CogWindowManagerRef = CogWindowManager; | ||||||
|  |  | ||||||
|     // Add all the built-in windows | 		// Add all the built-in windows | ||||||
|     Cog::AddAllWindows(*CogWindowManager); | 		Cog::AddAllWindows(*CogWindowManager); | ||||||
|  | 	} | ||||||
| #endif //ENABLE_COG | #endif //ENABLE_COG | ||||||
| } | } | ||||||
|  |  | ||||||
| void AGasaGameState::PostInitializeComponents() | void AGasaGameState::PostInitializeComponents() | ||||||
| { | { | ||||||
| 	NetLog("PostInitializeComponents"); | 	NetLog("PostInitializeComponents"); | ||||||
|  |  | ||||||
| 	Super::PostInitializeComponents(); | 	Super::PostInitializeComponents(); | ||||||
|  |  | ||||||
| 	if ( ! GetWorld()->IsEditorWorld() && IsServer()) | 	if ( ! GetWorld()->IsEditorWorld() && IsServer()) | ||||||
| @@ -135,7 +133,8 @@ void AGasaGameState::Tick(float DeltaSeconds) | |||||||
| 	Super::Tick(DeltaSeconds); | 	Super::Tick(DeltaSeconds); | ||||||
|  |  | ||||||
| #if ENABLE_COG | #if ENABLE_COG | ||||||
|     CogWindowManager->Tick(DeltaSeconds); | 	if (CogWindowManager) | ||||||
|  | 		CogWindowManager->Tick(DeltaSeconds); | ||||||
| #endif //ENABLE_COG | #endif //ENABLE_COG | ||||||
| } | } | ||||||
| #pragma endregion Actor | #pragma endregion Actor | ||||||
|   | |||||||
| @@ -52,7 +52,7 @@ public: | |||||||
|  |  | ||||||
| #pragma region Actor | #pragma region Actor | ||||||
|     void BeginPlay() override; |     void BeginPlay() override; | ||||||
| #pragma region endActor | #pragma endregion endActor | ||||||
| }; | }; | ||||||
|  |  | ||||||
| namespace Gasa | namespace Gasa | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user