コード例 #1
0
void UGAEffectExecution::ExecuteEffect(const FGAGameEffectHandle& HandleIn, FGAEffectMod& ModIn, FGAExecutionContext& Context)
{
	UE_LOG(GameAttributesEffects, Log, TEXT("Sample execution class implementation"));
	
	FGAAttributeBase* TargetAttribute = Context.GetTargetAttribute(ModIn.Attribute);
	if (TargetAttribute)
	{
		switch (ModIn.ChangeType)
		{
		case EGAAttributeChangeType::Damage:
			UE_LOG(GameAttributesEffects, Log, TEXT("Sample execution::Damage Value = %f"), ModIn.Value);
			TargetAttribute->Subtract(ModIn.Value);
			break;
		case EGAAttributeChangeType::DamagePercentage:
			break;
		case EGAAttributeChangeType::Heal:
			TargetAttribute->Add(ModIn.Value);
			break;
		case EGAAttributeChangeType::HealPercentage:
			break;
		}
	}
}