Cog Sample: Adding more gameplay

Cog Sample: Make Area a component instead of an actor
Cog Sample: Add Basic actor for Projectiles, Areas, etc...
Cog Sample: Start to add Projectile
Cog Sample: Start to add SpawnPrediction
This commit is contained in:
Arnaud Jamin
2023-10-26 12:33:50 -04:00
parent 07e9db10af
commit 42ca1afc6a
67 changed files with 2462 additions and 669 deletions
@@ -48,6 +48,24 @@ void UCogAbilityWindow_Cheats::ResetConfig()
void UCogAbilityWindow_Cheats::SetAsset(const UCogAbilityDataAsset* Value)
{
Asset = Value;
}
//--------------------------------------------------------------------------------------------------------------------------
void UCogAbilityWindow_Cheats::GameTick(float DeltaTime)
{
Super::GameTick(DeltaTime);
TryReapplyCheats();
}
//--------------------------------------------------------------------------------------------------------------------------
void UCogAbilityWindow_Cheats::TryReapplyCheats()
{
if (bHasReappliedCheats)
{
return;
}
if (bReapplyCheatsBetweenPlays == false)
{
@@ -78,7 +96,7 @@ void UCogAbilityWindow_Cheats::SetAsset(const UCogAbilityDataAsset* Value)
return;
}
TArray<AActor*> Targets{ LocalPawn };
TArray<AActor*> Targets { LocalPawn };
for (const FString& AppliedCheatName : AppliedCheats)
{
@@ -88,6 +106,8 @@ void UCogAbilityWindow_Cheats::SetAsset(const UCogAbilityDataAsset* Value)
Replicator->ApplyCheat(LocalPawn, Targets, *Cheat);
}
}
bHasReappliedCheats = true;
}
//--------------------------------------------------------------------------------------------------------------------------
@@ -23,17 +23,19 @@ public:
protected:
virtual void GameTick(float DeltaTime);
virtual void ResetConfig() override;
virtual void RenderHelp() override;
virtual void RenderContent() override;
private:
bool AddCheat(AActor* ControlledActor, AActor* TargetActor, const FCogAbilityCheat& CheatEffect, bool IsPersistent);
virtual void TryReapplyCheats();
void RequestCheat(AActor* ControlledActor, AActor* TargetActor, const FCogAbilityCheat& CheatEffect);
virtual bool AddCheat(AActor* ControlledActor, AActor* TargetActor, const FCogAbilityCheat& CheatEffect, bool IsPersistent);
virtual void RequestCheat(AActor* ControlledActor, AActor* TargetActor, const FCogAbilityCheat& CheatEffect);
UPROPERTY(Config)
bool bReapplyCheatsBetweenPlays = true;
@@ -46,4 +48,6 @@ private:
UPROPERTY()
TObjectPtr<const UCogAbilityDataAsset> Asset = nullptr;
bool bHasReappliedCheats = false;
};