コード例 #1
0
float UARAttributeStatics::ReduceDamageByArmor(AActor* DamageTarget, AActor* Instigator, float DamageIn)
{
	if (!DamageTarget && !Instigator)
		return 0;

	TWeakObjectPtr<UARAttributeBaseComponent> tarAttr = DamageTarget->FindComponentByClass<UARAttributeBaseComponent>();
	TWeakObjectPtr<UARAttributeBaseComponent> instAttr = Instigator->FindComponentByClass<UARAttributeBaseComponent>();

	float Armor = tarAttr->GetFloatValue("Armor");

	return DamageIn -= Armor;
}