protected:
UPROPERTY(VisibleAnywhere)
USkeletalMeshComponent* SkeletalMeshComponent;//枪骨骼
UPROPERTY(EditAnywhere)
USoundCue* FireSound;//开火声音
UPROPERTY(EditAnywhere)
UParticleSystem* FireEffect;//开火特效
void AWeaponBaseActor::MakeEffect()
{
if(FireSound)
{
UGameplayStatics::PlaySoundAtLocation(GetWorld(),FireSound,GetActorLocation());
}
if(FireEffect && SkeletalMeshComponent)
{
UGameplayStatics::SpawnEmitterAttached(FireEffect,SkeletalMeshComponent,TEXT("Muzzle"));
}
}