Variants / Chaining / Icons / ...

This commit is contained in:
2023-07-22 17:01:54 +02:00
parent 77bb47aeb9
commit 224154e100
110 changed files with 97 additions and 27 deletions

View File

@@ -4,6 +4,7 @@
#include "CoreMinimal.h"
#include "Components/StaticMeshComponent.h"
#include "DrawDebugHelpers.h"
#include "BuildingBlock.generated.h"
UCLASS()
@@ -18,22 +19,33 @@ public:
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
UStaticMeshComponent* StaticMesh;
// How many hits can this block take before getting destroyed
UPROPERTY(BlueprintReadWrite, EditAnywhere)
float Health = 100.0f;
int32 HitsRemaining = 1;
UPROPERTY(BlueprintReadOnly)
int32 Index = 0;
UPROPERTY(BlueprintReadOnly)
float InitialHealth;
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
bool HasVariants = false;
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
int32 Variant = 0;
UFUNCTION(BlueprintCallable)
void DepleteHealth(float Amount);
void TakeHit();
UFUNCTION(BlueprintImplementableEvent)
void UpdateDestructionLevel(uint8 Level);
UFUNCTION(BlueprintImplementableEvent)
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
void DestroyBlock();
UFUNCTION(BlueprintImplementableEvent)
void FadeIn();
UFUNCTION(BlueprintImplementableEvent, BlueprintCallable)
void DestroyWithDelay();
// Get neighbouring Blocks with same color variant
UFUNCTION(BlueprintCallable)
TArray<ABuildingBlock*> GetSameVariantNeighbours();
};