FK v1.0.0 (build errors)
This commit is contained in:
BIN
Content/Assets/Chainer/M_ChainerMesh.uasset
Normal file
BIN
Content/Assets/Chainer/M_ChainerMesh.uasset
Normal file
Binary file not shown.
BIN
Content/Assets/Chainer/SM_Chainer.uasset
Normal file
BIN
Content/Assets/Chainer/SM_Chainer.uasset
Normal file
Binary file not shown.
BIN
Content/Assets/Firecrackers/InstantDeath/M_Glass.uasset
Normal file
BIN
Content/Assets/Firecrackers/InstantDeath/M_Glass.uasset
Normal file
Binary file not shown.
BIN
Content/Assets/Firecrackers/InstantDeath/M_Main.uasset
Normal file
BIN
Content/Assets/Firecrackers/InstantDeath/M_Main.uasset
Normal file
Binary file not shown.
BIN
Content/Assets/Firecrackers/InstantDeath/SM_InstantDeath2.uasset
Normal file
BIN
Content/Assets/Firecrackers/InstantDeath/SM_InstantDeath2.uasset
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Content/Assets/Hand/Anim/Anim_Hand_InstantDeath2.uasset
Normal file
BIN
Content/Assets/Hand/Anim/Anim_Hand_InstantDeath2.uasset
Normal file
Binary file not shown.
BIN
Content/Assets/SM_GuideSphere.uasset
Normal file
BIN
Content/Assets/SM_GuideSphere.uasset
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Content/Materials/M_GuideSphere.uasset
Normal file
BIN
Content/Materials/M_GuideSphere.uasset
Normal file
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -15,6 +15,7 @@ void ABuildingBlock::TakeHit() {
|
||||
HitsRemaining -= 1;
|
||||
|
||||
if (HitsRemaining <= 0) {
|
||||
Ripple();
|
||||
DestroyBlock();
|
||||
}
|
||||
}
|
||||
@@ -54,10 +55,34 @@ TArray<ABuildingBlock*> ABuildingBlock::GetSameVariantNeighbours() {
|
||||
}
|
||||
|
||||
void ABuildingBlock::DestroyBlock_Implementation() {
|
||||
if (!IsBeingDestroyed) {
|
||||
IsBeingDestroyed = true;
|
||||
OnBlockDestroyed.ExecuteIfBound();
|
||||
}
|
||||
}
|
||||
|
||||
void ABuildingBlock::DestroyWithDelay_Implementation() {
|
||||
IsBeingDestroyed = true;
|
||||
OnBlockDestroyed.ExecuteIfBound();
|
||||
}
|
||||
|
||||
void ABuildingBlock::Ripple() {
|
||||
|
||||
TArray<TEnumAsByte<EObjectTypeQuery>> TraceObjectTypes;
|
||||
TraceObjectTypes.Add(UEngineTypes::ConvertToObjectType(ECC_Visibility));
|
||||
|
||||
TArray<AActor*> IgnoreActors;
|
||||
IgnoreActors.Add(this);
|
||||
|
||||
TArray<AActor*> OutActors;
|
||||
|
||||
UKismetSystemLibrary::SphereOverlapActors(GetWorld(), this->GetActorLocation(), RippleRadius, TraceObjectTypes, ABuildingBlock::StaticClass(), IgnoreActors, OutActors);
|
||||
|
||||
for (AActor* OverlappedActor : OutActors) {
|
||||
ABuildingBlock* ThisBlock = Cast<ABuildingBlock>(OverlappedActor);
|
||||
if (ThisBlock && !ThisBlock->IsBeingDestroyed) {
|
||||
float ThisDistance = UKismetMathLibrary::Vector_Distance(this->GetActorLocation(), ThisBlock->GetActorLocation());
|
||||
ThisBlock->RippleEffects(ThisDistance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,8 @@
|
||||
#include "CoreMinimal.h"
|
||||
#include "Components/StaticMeshComponent.h"
|
||||
#include "DrawDebugHelpers.h"
|
||||
#include "Kismet/KismetSystemLibrary.h"
|
||||
#include "Kismet/KismetMathLibrary.h"
|
||||
#include "BuildingBlock.generated.h"
|
||||
|
||||
DECLARE_DELEGATE(FBlockDestroyed);
|
||||
@@ -37,6 +39,9 @@ public:
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
||||
int32 Variant = 0;
|
||||
|
||||
UPROPERTY(EditDefaultsOnly, BlueprintReadWrite)
|
||||
float RippleRadius = 200.f;
|
||||
|
||||
UPROPERTY(BlueprintReadOnly)
|
||||
bool IsBeingDestroyed = false;
|
||||
|
||||
@@ -54,6 +59,12 @@ public:
|
||||
UFUNCTION(BlueprintNativeEvent, BlueprintCallable)
|
||||
void DestroyWithDelay();
|
||||
|
||||
UFUNCTION()
|
||||
void Ripple();
|
||||
|
||||
UFUNCTION(BlueprintImplementableEvent)
|
||||
void RippleEffects(float Distance);
|
||||
|
||||
// Get neighbouring Blocks with same color variant
|
||||
UFUNCTION(BlueprintCallable)
|
||||
TArray<ABuildingBlock*> GetSameVariantNeighbours();
|
||||
|
||||
Reference in New Issue
Block a user