Skip to content

Commit ca45430

Browse files
committed
feat : 줍기 매너니즘 변경.
1 parent a969633 commit ca45430

File tree

2 files changed

+20
-8
lines changed

2 files changed

+20
-8
lines changed

VisionpredatorProcess/AutoPickSystem.cpp

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
#include <limits>
66
#include <cmath>
77
#include <algorithm>
8-
AutoPickSystem::AutoPickSystem(std::shared_ptr<SceneManager> scenemnager):System(scenemnager)
8+
AutoPickSystem::AutoPickSystem(std::shared_ptr<SceneManager> scenemnager) :System(scenemnager)
99
{
1010
EventManager::GetInstance().Subscribe("OnAutoPickup", CreateSubscriber(&AutoPickSystem::OnAutoPickup));
1111
}
@@ -40,7 +40,7 @@ void AutoPickSystem::AddPickup(AutoPickComponent* autopick, GunComponent* pickup
4040
}
4141
}
4242

43-
void AutoPickSystem::ReleasePickup(AutoPickComponent* autopick, GunComponent* pickuped)
43+
void AutoPickSystem::ReleasePickup(AutoPickComponent* autopick, GunComponent* pickuped)
4444
{
4545
auto it = std::find(autopick->PickUps.begin(), autopick->PickUps.end(), pickuped->GetEntityID());
4646
if (it != autopick->PickUps.end())
@@ -60,15 +60,22 @@ void AutoPickSystem::OnAutoPickup(std::any pcomp)
6060
void AutoPickSystem::FixedUpdate(float deltaTime)
6161
{
6262

63-
COMPLOOP(AutoPickComponent, pickupcomp)
63+
COMPLOOP(AutoPickComponent, pickupcomp)
6464
{
6565
if (pickupcomp.ParentPlayer
6666
&& pickupcomp.IsAuto
6767
&& !pickupcomp.ParentPlayer->HasGun
6868
&& !pickupcomp.ParentPlayer->IsVPMode
69-
&& pickupcomp.ParentPlayer->HandEntity.lock()->GetComponent<AnimationComponent>()->curAni == static_cast<int>(VisPred::Game::PlayerAni::ToIdle02_Sword)
69+
&& (pickupcomp.ParentPlayer->HandEntity.lock()->GetComponent<AnimationComponent>()->curAni == static_cast<int>(VisPred::Game::PlayerAni::ToIdle02_Sword)
70+
|| pickupcomp.ParentPlayer->HandEntity.lock()->GetComponent<AnimationComponent>()->curAni == static_cast<int>(VisPred::Game::PlayerAni::ToIdle01_Sword)
71+
|| pickupcomp.ParentPlayer->HandEntity.lock()->GetComponent<AnimationComponent>()->curAni == static_cast<int>(VisPred::Game::PlayerAni::ToAttack1_Sword)
72+
|| pickupcomp.ParentPlayer->HandEntity.lock()->GetComponent<AnimationComponent>()->curAni == static_cast<int>(VisPred::Game::PlayerAni::ToAttack2_Sword)
73+
|| pickupcomp.ParentPlayer->HandEntity.lock()->GetComponent<AnimationComponent>()->curAni == static_cast<int>(VisPred::Game::PlayerAni::ToAttack3_Sword) )
7074
&& !pickupcomp.ParentPlayer->HandEntity.lock()->GetComponent<AnimationComponent>()->IsBlending)
7175
{
76+
77+
pickupcomp.ParentPlayer->IsAttacking = false;
78+
7279
AutoPickUp(&pickupcomp);
7380
}
7481
}
@@ -148,7 +155,7 @@ void AutoPickSystem::RemoveInvalidEntities(AutoPickComponent* autopick)
148155
{
149156
it = autopick->PickUps.erase(it);
150157
}
151-
else if (entity->HasComponent<GunComponent>()&& entity->GetComponent<GunComponent>()->IsEmpty)
158+
else if (entity->HasComponent<GunComponent>() && entity->GetComponent<GunComponent>()->IsEmpty)
152159
{
153160
it = autopick->PickUps.erase(it);
154161
}
@@ -161,7 +168,7 @@ void AutoPickSystem::RemoveInvalidEntities(AutoPickComponent* autopick)
161168
bool AutoPickSystem::IsValidPickupEntity(uint32_t entityID)
162169
{
163170
auto entity = GetSceneManager()->GetEntity(entityID);
164-
if (!entity || !m_PhysicsEngine->IsDynamic(entityID))
171+
if (!entity || !m_PhysicsEngine->IsDynamic(entityID))
165172
return false;
166173

167174
auto guncomp = entity->GetComponent<GunComponent>();

VisionpredatorProcess/GunSystem.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ void GunSystem::Update(float deltaTime)
1212
{
1313
COMPLOOP(GunComponent, guncomp)
1414
{
15-
if (guncomp.CurrentBullet==0)
15+
if (guncomp.CurrentBullet == 0)
1616
guncomp.IsEmpty = true;
1717
}
1818
}
@@ -115,6 +115,11 @@ void GunSystem::Interected_Gun(GunComponent& guncomp, PlayerComponent& playercom
115115
&& anicomp->PlayerCurAni != VisPred::Game::PlayerAni::ToAttack1_Sword
116116
&& anicomp->PlayerCurAni != VisPred::Game::PlayerAni::ToAttack2_Sword
117117
&& anicomp->PlayerCurAni != VisPred::Game::PlayerAni::ToAttack3_Sword
118+
&& anicomp->PlayerCurAni != VisPred::Game::PlayerAni::ToIdle01_Sword
119+
&& anicomp->PlayerCurAni != VisPred::Game::PlayerAni::ToIdle01_Pistol
120+
&& anicomp->PlayerCurAni != VisPred::Game::PlayerAni::ToIdle01_Rifle
121+
&& anicomp->PlayerCurAni != VisPred::Game::PlayerAni::ToIdle01_ShotGun
122+
118123
)
119124
return;
120125

@@ -168,6 +173,6 @@ void GunSystem::Interected_Gun(GunComponent& guncomp, PlayerComponent& playercom
168173
EventManager::GetInstance().ImmediateEvent("OnChangeAnimation", data);
169174
GetSceneManager()->SpawnSoundEntity(soundcomp->SoundKey_GunDraw, soundcomp->Volume_GunDraw, true, false, {});
170175
EventManager::GetInstance().ImmediateEvent("OnUpdateWeaponUI");
171-
176+
172177
}
173178

0 commit comments

Comments
 (0)