-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
구조체, 탐색함수
- Loading branch information
Showing
2 changed files
with
64 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Fill out your copyright notice in the Description page of Project Settings. | ||
|
||
|
||
#include "AbilitySystem/Data/AttributeInfo.h" | ||
|
||
FAuraAttributeInfo UAttributeInfo::FindAttributeInfoForTag(const FGameplayTag& AttributeTag, bool bLogNotFound) const | ||
{ | ||
for(const FAuraAttributeInfo& Info : AttributeInformation) | ||
{ | ||
if(Info.AttributeTag==AttributeTag) //배열안에 일치하는 태그가 있으면 그 정보 리턴 | ||
{ | ||
return Info; | ||
} | ||
} | ||
|
||
if(bLogNotFound) | ||
{ | ||
UE_LOG(LogTemp, Error, TEXT("Can`t find Info for AttributeTag [%s] on AttributeInfo [%s]."),*AttributeTag.ToString(),*GetNameSafe(this)); | ||
//속성이름, 이클래스의 이름 | ||
} | ||
|
||
return FAuraAttributeInfo(); // 빈 속성정보 리턴 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
// Fill out your copyright notice in the Description page of Project Settings. | ||
|
||
#pragma once | ||
|
||
#include "CoreMinimal.h" | ||
#include "GameplayTagContainer.h" | ||
#include "Engine/DataAsset.h" | ||
#include "AttributeInfo.generated.h" | ||
|
||
USTRUCT(BlueprintType) | ||
struct FAuraAttributeInfo | ||
{ | ||
GENERATED_BODY() | ||
|
||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly) | ||
FGameplayTag AttributeTag = FGameplayTag(); //초기화 | ||
|
||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly) | ||
FText AttributeName = FText(); //표시될 위젯의 txt | ||
|
||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly) | ||
FText AttributeDescription = FText(); //표시될 위젯의 txt | ||
|
||
UPROPERTY(BlueprintReadOnly) //DA에서 편집금지 | ||
float AttributeValue=0.f; | ||
}; | ||
|
||
/** | ||
* | ||
*/ | ||
UCLASS() | ||
class AURA_API UAttributeInfo : public UDataAsset | ||
{ | ||
GENERATED_BODY() | ||
|
||
public: | ||
FAuraAttributeInfo FindAttributeInfoForTag(const FGameplayTag& AttributeTag, bool bLogNotFound=false) const; | ||
|
||
UPROPERTY(EditDefaultsOnly,BlueprintReadOnly) | ||
TArray<FAuraAttributeInfo> AttributeInformation; //속성 정보들, BP에서 의존성주입 | ||
}; |