Move OnDamagedAnimationMontages to NakatomiCharacter
This commit is contained in:
parent
ad2034b15d
commit
3c69fc2289
|
@ -275,6 +275,13 @@ void ANakatomiCharacter::PlayOnFireAnimations()
|
||||||
|
|
||||||
void ANakatomiCharacter::OnDamaged()
|
void ANakatomiCharacter::OnDamaged()
|
||||||
{
|
{
|
||||||
|
int32 randomAnimMontage = FMath::RandRange(0,OnDamagedHitAnimMontages.Num()-1);
|
||||||
|
|
||||||
|
if (OnDamagedHitAnimMontages[randomAnimMontage] != nullptr)
|
||||||
|
{
|
||||||
|
//TODO: Disable movement while playing animation montage
|
||||||
|
PlayAnimMontage(OnDamagedHitAnimMontages[randomAnimMontage]);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void ANakatomiCharacter::OnDeath()
|
void ANakatomiCharacter::OnDeath()
|
||||||
|
|
|
@ -42,6 +42,9 @@ public:
|
||||||
UPROPERTY(EditDefaultsOnly)
|
UPROPERTY(EditDefaultsOnly)
|
||||||
UAnimMontage* FireWeaponAnimMontage;
|
UAnimMontage* FireWeaponAnimMontage;
|
||||||
|
|
||||||
|
UPROPERTY(EditDefaultsOnly)
|
||||||
|
TArray<UAnimMontage*> OnDamagedHitAnimMontages;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Meta = (AllowPrivateAccess = "true"))
|
UPROPERTY(EditDefaultsOnly, BlueprintReadOnly, Meta = (AllowPrivateAccess = "true"))
|
||||||
UNakatomiCMC* NakatomiCMC;
|
UNakatomiCMC* NakatomiCMC;
|
||||||
|
|
|
@ -460,14 +460,6 @@ void APlayerCharacter::PlayOnFireAnimations()
|
||||||
void APlayerCharacter::OnDamaged()
|
void APlayerCharacter::OnDamaged()
|
||||||
{
|
{
|
||||||
Super::OnDamaged();
|
Super::OnDamaged();
|
||||||
|
|
||||||
int32 randomAnimMontage = FMath::RandRange(0,OnDamagedHitAnimMontages.Num()-1);
|
|
||||||
|
|
||||||
if (OnDamagedHitAnimMontages[randomAnimMontage] != nullptr)
|
|
||||||
{
|
|
||||||
//TODO: Disable movement while playing animation montage
|
|
||||||
PlayAnimMontage(OnDamagedHitAnimMontages[randomAnimMontage]);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void APlayerCharacter::OnDeath()
|
void APlayerCharacter::OnDeath()
|
||||||
|
|
|
@ -88,9 +88,6 @@ public:
|
||||||
|
|
||||||
UPROPERTY(EditDefaultsOnly)
|
UPROPERTY(EditDefaultsOnly)
|
||||||
UAnimMontage* ThrowExplosiveAnimMontage;
|
UAnimMontage* ThrowExplosiveAnimMontage;
|
||||||
|
|
||||||
UPROPERTY(EditDefaultsOnly)
|
|
||||||
TArray<UAnimMontage*> OnDamagedHitAnimMontages;
|
|
||||||
|
|
||||||
UPROPERTY(EditDefaultsOnly)
|
UPROPERTY(EditDefaultsOnly)
|
||||||
UAnimMontage* FireWeaponADSAnimMontage;
|
UAnimMontage* FireWeaponADSAnimMontage;
|
||||||
|
|
Loading…
Reference in New Issue