第一次提交
This commit is contained in:
@@ -0,0 +1,44 @@
|
||||
// Copyright 2025 https://yuewu.dev/en All Rights Reserved.
|
||||
|
||||
|
||||
#include "AbilitySystem/GCS_GameplayEffectContext.h"
|
||||
|
||||
void FGCS_ContextPayload_Combat::SetTaggedValue(const FGameplayTag& Tag, float NewValue)
|
||||
{
|
||||
if (Tag.IsValid())
|
||||
{
|
||||
bool bFound = false;
|
||||
for (FGCS_TaggedValue& TaggedValue : TaggedValues)
|
||||
{
|
||||
if (TaggedValue.Attribute == Tag)
|
||||
{
|
||||
TaggedValue.Value = NewValue;
|
||||
bFound = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (!bFound)
|
||||
{
|
||||
FGCS_TaggedValue Temp;
|
||||
Temp.Attribute = Tag;
|
||||
Temp.Value = NewValue;
|
||||
TaggedValues.Add(Temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
float FGCS_ContextPayload_Combat::GetTaggedValue(const FGameplayTag& Tag) const
|
||||
{
|
||||
if (Tag.IsValid())
|
||||
{
|
||||
for (const FGCS_TaggedValue& TaggedValue : TaggedValues)
|
||||
{
|
||||
if (TaggedValue.Attribute == Tag)
|
||||
{
|
||||
return TaggedValue.Value;
|
||||
}
|
||||
}
|
||||
}
|
||||
return 0.0f;
|
||||
}
|
||||
Reference in New Issue
Block a user