[박치영] Shield 추가작업
parent
1af7482513
commit
34180c0ebf
|
@ -150,4 +150,5 @@ ManualIPAddress=
|
||||||
+PropertyRedirects=(OldName="/Script/D1.MasterAI.MainWeaponCollisionComponent",NewName="/Script/D1.MasterAI.RightWeaponCollisionComponent")
|
+PropertyRedirects=(OldName="/Script/D1.MasterAI.MainWeaponCollisionComponent",NewName="/Script/D1.MasterAI.RightWeaponCollisionComponent")
|
||||||
+PropertyRedirects=(OldName="/Script/D1.MasterAI.RightWeaponCollisionComponent",NewName="/Script/D1.MasterAI.MainCollisionComponent")
|
+PropertyRedirects=(OldName="/Script/D1.MasterAI.RightWeaponCollisionComponent",NewName="/Script/D1.MasterAI.MainCollisionComponent")
|
||||||
+PropertyRedirects=(OldName="/Script/D1.MasterAI.LeftWeaponCollisionComponent",NewName="/Script/D1.MasterAI.SubCollisionComponent")
|
+PropertyRedirects=(OldName="/Script/D1.MasterAI.LeftWeaponCollisionComponent",NewName="/Script/D1.MasterAI.SubCollisionComponent")
|
||||||
|
+PropertyRedirects=(OldName="/Script/D1.CombatPlayerCharacter.Weapon",NewName="/Script/D1.CombatPlayerCharacter.StartingEquipment")
|
||||||
|
|
||||||
|
|
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
@ -3,3 +3,34 @@
|
||||||
|
|
||||||
#include "Actor/BaseShield.h"
|
#include "Actor/BaseShield.h"
|
||||||
|
|
||||||
|
#include "Components/CollisionComponent.h"
|
||||||
|
#include "Components/CombatComponent.h"
|
||||||
|
#include "GameFramework/Character.h"
|
||||||
|
|
||||||
|
void ABaseShield::OnEquipped()
|
||||||
|
{
|
||||||
|
SetIsEquipped(true);
|
||||||
|
AActor* owner = GetOwner();
|
||||||
|
if (!owner)
|
||||||
|
return;
|
||||||
|
CombatComponent = owner->GetComponentByClass<UCombatComponent>();
|
||||||
|
CombatComponent->OnCombatToggled.BindUObject(this, &ABaseWeapon::ToggleWeaponCombat);
|
||||||
|
|
||||||
|
OwnerStateManager = owner->GetComponentByClass<UStateManagerComponent>();
|
||||||
|
|
||||||
|
if (CombatComponent->GetCombatEnabled())
|
||||||
|
AttachActor(HandSocketName);
|
||||||
|
else
|
||||||
|
AttachActor(AttachSocketName);
|
||||||
|
|
||||||
|
CombatComponent->SetShieldWeapon(this);
|
||||||
|
|
||||||
|
CollisionComponent->SetCollisionMeshComponent(GetItemMesh());
|
||||||
|
CollisionComponent->AddActorToIgnore(GetOwner());
|
||||||
|
}
|
||||||
|
|
||||||
|
void ABaseShield::OnUnequipped()
|
||||||
|
{
|
||||||
|
Super::OnUnequipped();
|
||||||
|
CombatComponent->SetShieldWeapon(nullptr);
|
||||||
|
}
|
||||||
|
|
|
@ -13,5 +13,8 @@ UCLASS()
|
||||||
class D1_API ABaseShield : public ABaseWeapon
|
class D1_API ABaseShield : public ABaseWeapon
|
||||||
{
|
{
|
||||||
GENERATED_BODY()
|
GENERATED_BODY()
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual void OnEquipped() override;
|
||||||
|
virtual void OnUnequipped() override;
|
||||||
};
|
};
|
||||||
|
|
|
@ -55,7 +55,7 @@ void ABaseWeapon::OnEquipped()
|
||||||
|
|
||||||
OwnerStateManager = owner->GetComponentByClass<UStateManagerComponent>();
|
OwnerStateManager = owner->GetComponentByClass<UStateManagerComponent>();
|
||||||
|
|
||||||
if (CombatComponent->GetCombatEnabled())
|
if (CombatComponent->GetCombatEnabled()) //TODO : 방패 착용 후 Toggle Event 시 Weapon의 소켓이 안바뀌는 버그
|
||||||
AttachActor(HandSocketName);
|
AttachActor(HandSocketName);
|
||||||
else
|
else
|
||||||
AttachActor(AttachSocketName);
|
AttachActor(AttachSocketName);
|
||||||
|
|
|
@ -24,7 +24,7 @@ public:
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//override
|
//override
|
||||||
void OnEquipped() override;
|
virtual void OnEquipped() override;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
//Delegate
|
//Delegate
|
||||||
|
|
|
@ -20,7 +20,10 @@ void UCombatAnimInstance::NativeInitializeAnimation()
|
||||||
UCombatComponent* CombatComponent = Character->GetComponentByClass<UCombatComponent>();
|
UCombatComponent* CombatComponent = Character->GetComponentByClass<UCombatComponent>();
|
||||||
ensure(CombatComponent);
|
ensure(CombatComponent);
|
||||||
if(IsValid(CombatComponent))
|
if(IsValid(CombatComponent))
|
||||||
|
{
|
||||||
CombatComponent->OnCombatToggled.BindUObject(this, &UCombatAnimInstance::UpdateCombatEnabled);
|
CombatComponent->OnCombatToggled.BindUObject(this, &UCombatAnimInstance::UpdateCombatEnabled);
|
||||||
|
CombatComponent->OnBlockingSet.BindUObject(this, &UCombatAnimInstance::OnBlockingSet_Event);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -51,3 +54,8 @@ void UCombatAnimInstance::UpdateCombatEnabled(bool combatEnabled)
|
||||||
{
|
{
|
||||||
CombatEnabled = combatEnabled;
|
CombatEnabled = combatEnabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void UCombatAnimInstance::OnBlockingSet_Event(bool bIsBlock)
|
||||||
|
{
|
||||||
|
IsBlocking = bIsBlock;
|
||||||
|
}
|
||||||
|
|
|
@ -25,7 +25,8 @@ public:
|
||||||
|
|
||||||
public: //Delegate
|
public: //Delegate
|
||||||
void UpdateCombatEnabled(bool combatEnabled);
|
void UpdateCombatEnabled(bool combatEnabled);
|
||||||
|
void OnBlockingSet_Event(bool bIsBlock);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="References", meta=(AllowPrivateAccess="true"))
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="References", meta=(AllowPrivateAccess="true"))
|
||||||
TObjectPtr<class ACharacter> Character;
|
TObjectPtr<class ACharacter> Character;
|
||||||
|
@ -47,4 +48,7 @@ private:
|
||||||
ECombatType CombatType;
|
ECombatType CombatType;
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (AllowPrivateAccess = "true"))
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (AllowPrivateAccess = "true"))
|
||||||
bool CombatEnabled;
|
bool CombatEnabled;
|
||||||
|
|
||||||
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, meta = (AllowPrivateAccess = "true"))
|
||||||
|
bool IsBlocking;
|
||||||
};
|
};
|
||||||
|
|
|
@ -124,9 +124,12 @@ void ACombatPlayerCharacter::BeginPlay()
|
||||||
FActorSpawnParameters spawnParam;
|
FActorSpawnParameters spawnParam;
|
||||||
spawnParam.Owner = this;
|
spawnParam.Owner = this;
|
||||||
spawnParam.Instigator = this;
|
spawnParam.Instigator = this;
|
||||||
ABaseEquippable* SpawnItem = Cast<ABaseEquippable>(GetWorld()->SpawnActor(Weapon, &GetActorTransform(), spawnParam));
|
for (auto Equipment : StartingEquipment)
|
||||||
if (SpawnItem)
|
{
|
||||||
SpawnItem->OnEquipped();
|
ABaseEquippable* SpawnItem = Cast<ABaseEquippable>(GetWorld()->SpawnActor(Equipment, &GetActorTransform(), spawnParam));
|
||||||
|
if (SpawnItem)
|
||||||
|
SpawnItem->OnEquipped();
|
||||||
|
}
|
||||||
|
|
||||||
//Setting Timeline - if you set on Constructor, Can not get Curve
|
//Setting Timeline - if you set on Constructor, Can not get Curve
|
||||||
FOnTimelineFloat TimelineFloatCallback;
|
FOnTimelineFloat TimelineFloatCallback;
|
||||||
|
@ -945,6 +948,8 @@ bool ACombatPlayerCharacter::CanPerformBlock()
|
||||||
inputContainer.AddTag(FCombatGameplayTags::Get().Character_State_GeneralActionState);
|
inputContainer.AddTag(FCombatGameplayTags::Get().Character_State_GeneralActionState);
|
||||||
|
|
||||||
ReturnValue &= !StateManagerComponent->IsCurrentStateEqualToAny(inputContainer);
|
ReturnValue &= !StateManagerComponent->IsCurrentStateEqualToAny(inputContainer);
|
||||||
|
ReturnValue &= CombatComponent->GetCombatEnabled();
|
||||||
|
ReturnValue &= IsValid(CombatComponent->GetShieldWeapon());
|
||||||
|
|
||||||
return ReturnValue;
|
return ReturnValue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -203,9 +203,10 @@ public:
|
||||||
TObjectPtr<UStatsComponent> StatsComponent;
|
TObjectPtr<UStatsComponent> StatsComponent;
|
||||||
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category="Components", meta=(AllowPrivateAccess="true"))
|
UPROPERTY(VisibleAnywhere, BlueprintReadWrite, Category="Components", meta=(AllowPrivateAccess="true"))
|
||||||
TObjectPtr<UTargetingComponent> TargetingComponent;
|
TObjectPtr<UTargetingComponent> TargetingComponent;
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Weapon", meta = (AllowPrivateAccess = "true"))
|
//TODO : 방패 착용 후 Toggle Event 시 Weapon의 소켓이 안바뀌는 버그
|
||||||
TSubclassOf<class ABaseEquippable> Weapon;
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category="Equipment", meta = (AllowPrivateAccess = "true"))
|
||||||
|
TArray<TSubclassOf<class ABaseEquippable>> StartingEquipment;
|
||||||
|
|
||||||
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hit", meta = (AllowPrivateAccess = "true"))
|
UPROPERTY(EditAnywhere, BlueprintReadWrite, Category = "Hit", meta = (AllowPrivateAccess = "true"))
|
||||||
FName PelvisBoneName;
|
FName PelvisBoneName;
|
||||||
|
|
|
@ -57,7 +57,7 @@ void UCombatComponent::SetBlockingState(bool enableBlocking)
|
||||||
if(enableBlocking != bIsBlocking)
|
if(enableBlocking != bIsBlocking)
|
||||||
{
|
{
|
||||||
bIsBlocking = enableBlocking;
|
bIsBlocking = enableBlocking;
|
||||||
|
OnBlockingSet.Execute(bIsBlocking);
|
||||||
}
|
}
|
||||||
onBlockingSet.Execute(bIsBlocking); // TODO : 이거 맞나?
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -62,5 +62,5 @@ private:
|
||||||
|
|
||||||
public: //Delegate
|
public: //Delegate
|
||||||
FOnCombatToggled OnCombatToggled;
|
FOnCombatToggled OnCombatToggled;
|
||||||
FOnBlockingSet onBlockingSet;
|
FOnBlockingSet OnBlockingSet;
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue