[박치영] Potion UI 버그 수정
parent
390c1c84a9
commit
c88a633391
Binary file not shown.
|
@ -94,7 +94,6 @@ void AGruntlingEnemy::OnCombatToggled(bool IsCombatEnabled)
|
|||
|
||||
void AGruntlingEnemy::PerformDeath()
|
||||
{
|
||||
//TODO : 죽었을 때 무기에 Collision이 남아있는 버그 있음
|
||||
Super::PerformDeath();
|
||||
SimulateWeaponPhysics();
|
||||
GetCharacterMovement()->SetMovementMode(MOVE_None);
|
||||
|
|
|
@ -130,7 +130,7 @@ void ACombatPlayerCharacter::BeginPlay()
|
|||
}
|
||||
}
|
||||
|
||||
EquipmentComponent->InitializeEquipment();
|
||||
EquipmentComponent->InitializeEquipment(PotionUI);
|
||||
|
||||
//Setting Timeline - if you set on Constructor, Can not get Curve
|
||||
FOnTimelineFloat TimelineFloatCallback;
|
||||
|
@ -368,7 +368,6 @@ float ACombatPlayerCharacter::PerformAttack(FGameplayTag AttackType, int32 Attac
|
|||
|
||||
bool ACombatPlayerCharacter::PerformCustomAction(FGameplayTag ActionTag, FGameplayTag StateTag, UAnimMontage* InMontage, float fMontagePlayRate, bool bAutoReset)
|
||||
{
|
||||
|
||||
UAnimMontage* actionMontage = InMontage;
|
||||
if (IsValid(actionMontage))
|
||||
{
|
||||
|
|
|
@ -242,7 +242,8 @@ public:
|
|||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Montage|Death", meta = (AllowPrivateAccess = "true"))
|
||||
TArray<TObjectPtr<UAnimMontage>> DeathAnimations;
|
||||
|
||||
TObjectPtr<class UUserWidget> PotionUI;
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
|
||||
TObjectPtr<UUserWidget> PotionUI;
|
||||
|
||||
private: //Timeline
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category = "Timeline", meta = (AllowPrivateAccess = "true"))
|
||||
|
|
|
@ -34,8 +34,10 @@ void UEquipmentComponent::TickComponent(float DeltaTime, ELevelTick TickType, FA
|
|||
// ...
|
||||
}
|
||||
|
||||
void UEquipmentComponent::InitializeEquipment()
|
||||
void UEquipmentComponent::InitializeEquipment(UUserWidget* potionUI)
|
||||
{
|
||||
EquippedPotionUI = potionUI;
|
||||
|
||||
for (auto item : EquippedItems)
|
||||
UnequipItem(item);
|
||||
|
||||
|
@ -91,6 +93,12 @@ bool UEquipmentComponent::EquipItem(TSubclassOf<ABaseEquippable> InEquipment)
|
|||
{
|
||||
SpawnItem->OnEquipped();
|
||||
EquippedItems.AddUnique(SpawnItem);
|
||||
|
||||
if(ABaseConsumable* consumableItem = Cast<ABaseConsumable>(SpawnItem))
|
||||
{
|
||||
if(UUI_PotionAmountText* PotionAmountText = Cast<UUI_PotionAmountText>(EquippedPotionUI))
|
||||
PotionAmountText->InitializePotionData(consumableItem); //TODO : [UMG] 관련 부분 구조 변경 필요
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
|
|
@ -27,7 +27,7 @@ public:
|
|||
virtual void TickComponent(float DeltaTime, ELevelTick TickType, FActorComponentTickFunction* ThisTickFunction) override;
|
||||
|
||||
public:
|
||||
void InitializeEquipment();
|
||||
void InitializeEquipment(UUserWidget* potionUI);
|
||||
bool PerformActionFromItem(FGameplayTag ItemTag);
|
||||
bool EquipItem(TSubclassOf<ABaseEquippable> InEquipment);
|
||||
void UnequipItem(ABaseEquippable* EquipmentToUnequip);
|
||||
|
@ -41,4 +41,7 @@ public:
|
|||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category="Default")
|
||||
TArray<TObjectPtr<ABaseEquippable>> EquippedItems;
|
||||
|
||||
UPROPERTY(VisibleAnywhere, BlueprintReadWrite)
|
||||
TObjectPtr<UUserWidget> EquippedPotionUI;
|
||||
};
|
||||
|
|
Loading…
Reference in New Issue