i have noticed that
ApplyDamage
function of AActor takes one particular param as
DamageTypeClass
here is the full signature below:
static ENGINE_API float ApplyDamage(AActor* DamagedActor, float BaseDamage, AController* EventInstigator, AActor* DamageCauser, TSubclassOf<class UDamageType> DamageTypeClass);
now i want to read the values defined in the param DamageTypeClass, treat it as an object, is that possible? or is there any normal way i can get the values of that class, even more, is this a recommend practice?
here is my custom DamageType which hold data i want to read out
class X2_API UX2DamageType : public UDamageType
{
GENERATED_BODY()
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Variable, meta = (AllowPrivateAccess))
FString Name;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Variable, meta = (AllowPrivateAccess))
TObjectPtr<UTexture2D> Icon;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Variable, meta = (AllowPrivateAccess))
TEnumAsByte<EX2DamageEvent> Event;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Variable, meta = (AllowPrivateAccess))
TObjectPtr<USoundWave> HitSound;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Variable, meta = (AllowPrivateAccess))
TObjectPtr<UParticleSystem> HitParticle;
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Variable, meta = (AllowPrivateAccess))
float Duration;
/**
* if this damage is a dot
*/
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = Variable, meta = (AllowPrivateAccess))
float DotInterval;
};