[Fix] 레페로 오브젝트 애니메이션 수정
This commit is contained in:
@@ -42,7 +42,8 @@ HRESULT CRandomNpc::Initialize(void* pArg)
|
||||
m_pCharacter_Controller->Set_Position(vPos);
|
||||
m_pTransformCom->Rotation(XMConvertToRadians(pDesc->vRotQ.x), XMConvertToRadians(pDesc->vRotQ.y), XMConvertToRadians(pDesc->vRotQ.z));
|
||||
|
||||
m_pModelCom->Set_AnimationIndex(1, true);
|
||||
_int iRandom = m_pGameInstance->Real_Random_Int(0, 12);
|
||||
m_pModelCom->Set_AnimationIndex(iRandom, false);
|
||||
m_pCallBack_Behavior->Initialize(m_pCharacter_Controller);
|
||||
m_pCallBack_HitReport->Initialize(m_pCharacter_Controller);
|
||||
m_bNpc = true;
|
||||
@@ -67,8 +68,18 @@ void CRandomNpc::Update(_float fTimeDelta)
|
||||
if (!m_pGameInstance->IsIn_WorldFrustum(m_pTransformCom->Get_State(STATE::POSITION), m_pTransformCom->Get_Radius())) {
|
||||
return;
|
||||
}
|
||||
|
||||
BattleObserve_Anim();
|
||||
|
||||
if (m_pModelCom->IsFinishedAnim())
|
||||
{
|
||||
if (false == m_bBattle)
|
||||
{
|
||||
_int iRandom = m_pGameInstance->Real_Random_Int(0, 12);
|
||||
m_pModelCom->Set_AnimationIndex(iRandom, false, 1.f, false, 1.f, false);
|
||||
}
|
||||
}
|
||||
|
||||
m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom);
|
||||
__super::Update(fTimeDelta);
|
||||
#ifdef _DEBUG
|
||||
@@ -91,28 +102,6 @@ void CRandomNpc::Update(_float fTimeDelta)
|
||||
SAFE_RELEASE(m_pTarget);
|
||||
m_fTargetDistance = { FLT_MAX };
|
||||
}
|
||||
|
||||
/*if (m_fTargetDistance <= 5.f && m_bInteract == false)
|
||||
{
|
||||
m_pInfoInstance->Event_CallBack(TEXT("NPCDialogue"), m_pNpcStat);
|
||||
m_bInteract = true;
|
||||
}
|
||||
|
||||
if (m_bInteract != m_bPreviousInteract)
|
||||
{
|
||||
m_bPreviousInteract = m_bInteract;
|
||||
m_fInteractTime = 0.f;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_fInteractTime += fTimeDelta;
|
||||
}
|
||||
|
||||
if (m_fInteractTime >= 5.f)
|
||||
{
|
||||
m_bInteract = false;
|
||||
m_fInteractTime = 0.f;
|
||||
}*/
|
||||
}
|
||||
|
||||
void CRandomNpc::Late_Update(_float fTimeDelta)
|
||||
@@ -444,15 +433,15 @@ void CRandomNpc::BattleObserve_Anim()
|
||||
_float fRandX = 0.f;
|
||||
if (iRand == 0)
|
||||
{
|
||||
fRandX = m_pGameInstance->Real_Random_Float(1002.f, 1004.f);
|
||||
fRandX = m_pGameInstance->Real_Random_Float(1003.f, 1005.f);
|
||||
}
|
||||
else {
|
||||
fRandX = m_pGameInstance->Real_Random_Float(1010.f, 1012.f);
|
||||
fRandX = m_pGameInstance->Real_Random_Float(1009.f, 1011.f);
|
||||
}
|
||||
|
||||
_float fRandY = m_pGameInstance->Real_Random_Float(1008.f, 1016.f);
|
||||
_float fRandZ = m_pGameInstance->Real_Random_Float(1008.f, 1016.f);
|
||||
|
||||
m_pCharacter_Controller->Set_Position(XMVectorSet(fRandX, 2.f, fRandY, 1.f));
|
||||
m_pCharacter_Controller->Set_Position(XMVectorSet(fRandX, 2.f, fRandZ, 1.f));
|
||||
|
||||
_vector vPos = Get_WorldPostion();
|
||||
_vector vForward = XMVectorZero();
|
||||
@@ -463,6 +452,8 @@ void CRandomNpc::BattleObserve_Anim()
|
||||
vForward = XMVectorSet(-1.f, 0.f, 0.f, 0.f);
|
||||
}
|
||||
|
||||
_int iRandIndex = m_pGameInstance->Real_Random_Int(14, 21);
|
||||
m_pModelCom->Set_AnimationIndex(iRandIndex, false, 1.f, false, 1.f, false);
|
||||
|
||||
m_pTransformCom->LookAt(vPos + vForward);
|
||||
|
||||
@@ -474,7 +465,7 @@ void CRandomNpc::BattleObserve_Anim()
|
||||
if (m_pModelCom->IsFinishedAnim())
|
||||
{
|
||||
_int iRand = m_pGameInstance->Real_Random_Int(14, 21);
|
||||
m_pModelCom->Set_AnimationIndex(iRand, false,1.f,false,1.f,false);
|
||||
m_pModelCom->Set_AnimationIndex(iRand, false, 1.f, false, 1.f, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user