mirror of
https://github.com/Ed94/Cog.git
synced 2026-08-05 15:18:47 +00:00
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:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user