Working on netowrked projectiles
This commit is contained in:
@@ -36,13 +36,13 @@ protected:
|
||||
ClassNames ClassName;
|
||||
|
||||
/*Functions*/
|
||||
UFUNCTION(BlueprintAuthorityOnly, BlueprintCallable, Category = "Health")
|
||||
void TakeDamage(int DamageValue);
|
||||
|
||||
public:
|
||||
/*Properties*/
|
||||
|
||||
/*Functions*/
|
||||
UFUNCTION(BlueprintAuthorityOnly, BlueprintCallable, Category = "Health")
|
||||
void TakeDamage(int DamageValue);
|
||||
|
||||
/*C++ only declarations*/
|
||||
private:
|
||||
|
||||
@@ -9,7 +9,7 @@ struct FHealthSegment : public FTableRowBase
|
||||
GENERATED_BODY()
|
||||
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Health Segments")
|
||||
ClassNames Class;
|
||||
ClassNames Class = ClassNames::Basic;
|
||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Health Segments")
|
||||
TArray<int> SegmentList;
|
||||
|
||||
|
||||
@@ -50,11 +50,10 @@ void ADDICharacter::Tick(float DeltaTime)
|
||||
|
||||
void ADDICharacter::OnHit(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit)
|
||||
{
|
||||
if (OtherActor->Owner == this)
|
||||
return;
|
||||
|
||||
AProjectileBase* Projectile = Cast<AProjectileBase>(OtherActor);
|
||||
|
||||
if (HealthComponent && Projectile)
|
||||
HealthComponent->TakeDamage(10);
|
||||
}
|
||||
|
||||
void ADDICharacter::TakeDamage(int Damage)
|
||||
{
|
||||
HealthComponent->TakeDamage(Damage);
|
||||
}
|
||||
|
||||
@@ -35,6 +35,8 @@ public:
|
||||
UFUNCTION()
|
||||
void OnHit(UPrimitiveComponent* HitComponent, AActor* OtherActor, UPrimitiveComponent* OtherComp, FVector NormalImpulse, const FHitResult& Hit);
|
||||
|
||||
UFUNCTION()
|
||||
void TakeDamage(int Damage);
|
||||
|
||||
/*C++ only declarations*/
|
||||
private:
|
||||
|
||||
Reference in New Issue
Block a user