[Add] 유닛 추가
[Fix] FSM
This commit is contained in:
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
Binary file not shown.
|
After Width: | Height: | Size: 14 MiB |
BIN
Binary file not shown.
|
After Width: | Height: | Size: 6.2 MiB |
@@ -202,6 +202,7 @@
|
|||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\Public\Effect_Editor.h" />
|
<ClInclude Include="..\Public\Effect_Editor.h" />
|
||||||
<ClInclude Include="..\Public\EditEffect.h" />
|
<ClInclude Include="..\Public\EditEffect.h" />
|
||||||
|
<ClInclude Include="..\Public\Goblin.h" />
|
||||||
<ClInclude Include="..\Public\Information.h" />
|
<ClInclude Include="..\Public\Information.h" />
|
||||||
<ClInclude Include="..\public\Land.h" />
|
<ClInclude Include="..\public\Land.h" />
|
||||||
<ClInclude Include="..\public\Level_MapViewer.h" />
|
<ClInclude Include="..\public\Level_MapViewer.h" />
|
||||||
@@ -220,9 +221,15 @@
|
|||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\Public\Player.h" />
|
<ClInclude Include="..\Public\Player.h" />
|
||||||
|
<ClInclude Include="..\Public\State_Cast.h" />
|
||||||
|
<ClInclude Include="..\Public\State_Combat.h" />
|
||||||
<ClInclude Include="..\Public\State_Dodge.h" />
|
<ClInclude Include="..\Public\State_Dodge.h" />
|
||||||
<ClInclude Include="..\Public\State_Idle.h" />
|
<ClInclude Include="..\Public\State_Idle.h" />
|
||||||
<ClInclude Include="..\Public\State_Jump.h" />
|
<ClInclude Include="..\Public\State_Jump.h" />
|
||||||
|
<ClInclude Include="..\Public\State_Land.h" />
|
||||||
|
<ClInclude Include="..\Public\State_LightAttack.h" />
|
||||||
|
<ClInclude Include="..\Public\State_Move.h" />
|
||||||
|
<ClInclude Include="..\Public\State_Skill.h" />
|
||||||
<ClInclude Include="..\Public\State_Sprint.h" />
|
<ClInclude Include="..\Public\State_Sprint.h" />
|
||||||
<ClInclude Include="..\Public\State_Walk.h" />
|
<ClInclude Include="..\Public\State_Walk.h" />
|
||||||
<ClInclude Include="..\public\Spell_Image.h" />
|
<ClInclude Include="..\public\Spell_Image.h" />
|
||||||
@@ -306,6 +313,7 @@
|
|||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\Private\Effect_Editor.cpp" />
|
<ClCompile Include="..\Private\Effect_Editor.cpp" />
|
||||||
<ClCompile Include="..\Private\EditEffect.cpp" />
|
<ClCompile Include="..\Private\EditEffect.cpp" />
|
||||||
|
<ClCompile Include="..\Private\Goblin.cpp" />
|
||||||
<ClCompile Include="..\Private\Information.cpp" />
|
<ClCompile Include="..\Private\Information.cpp" />
|
||||||
<ClCompile Include="..\private\Land.cpp" />
|
<ClCompile Include="..\private\Land.cpp" />
|
||||||
<ClCompile Include="..\private\Level_MapViewer.cpp" />
|
<ClCompile Include="..\private\Level_MapViewer.cpp" />
|
||||||
@@ -324,9 +332,15 @@
|
|||||||
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
|
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Release|x64'">false</ExcludedFromBuild>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\Private\Player.cpp" />
|
<ClCompile Include="..\Private\Player.cpp" />
|
||||||
|
<ClCompile Include="..\Private\State_Cast.cpp" />
|
||||||
|
<ClCompile Include="..\Private\State_Combat.cpp" />
|
||||||
<ClCompile Include="..\Private\State_Dodge.cpp" />
|
<ClCompile Include="..\Private\State_Dodge.cpp" />
|
||||||
<ClCompile Include="..\Private\State_Idle.cpp" />
|
<ClCompile Include="..\Private\State_Idle.cpp" />
|
||||||
<ClCompile Include="..\Private\State_Jump.cpp" />
|
<ClCompile Include="..\Private\State_Jump.cpp" />
|
||||||
|
<ClCompile Include="..\Private\State_Land.cpp" />
|
||||||
|
<ClCompile Include="..\Private\State_LightAttack.cpp" />
|
||||||
|
<ClCompile Include="..\Private\State_Move.cpp" />
|
||||||
|
<ClCompile Include="..\Private\State_Skill.cpp" />
|
||||||
<ClCompile Include="..\Private\State_Sprint.cpp" />
|
<ClCompile Include="..\Private\State_Sprint.cpp" />
|
||||||
<ClCompile Include="..\Private\State_Walk.cpp" />
|
<ClCompile Include="..\Private\State_Walk.cpp" />
|
||||||
<ClCompile Include="..\private\Spell_Image.cpp" />
|
<ClCompile Include="..\private\Spell_Image.cpp" />
|
||||||
|
|||||||
@@ -226,18 +226,9 @@
|
|||||||
<Filter Include="80.State">
|
<Filter Include="80.State">
|
||||||
<UniqueIdentifier>{9c21aba5-00c1-4b4c-8a82-dac7a156fd9b}</UniqueIdentifier>
|
<UniqueIdentifier>{9c21aba5-00c1-4b4c-8a82-dac7a156fd9b}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter Include="80.State\State_Dodge">
|
|
||||||
<UniqueIdentifier>{b017e167-f48d-4417-a924-765ab802cff5}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="80.State\State_Idle">
|
<Filter Include="80.State\State_Idle">
|
||||||
<UniqueIdentifier>{d5681f71-af29-4418-bf3a-a1486c6ba171}</UniqueIdentifier>
|
<UniqueIdentifier>{d5681f71-af29-4418-bf3a-a1486c6ba171}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
<Filter Include="80.State\State_Walk">
|
|
||||||
<UniqueIdentifier>{43bc0f97-0b7d-406b-900c-0fae023023ec}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="80.State\State_Sprint">
|
|
||||||
<UniqueIdentifier>{1cac1aa6-ea12-429e-8a84-ca2bf44c2be4}</UniqueIdentifier>
|
|
||||||
</Filter>
|
|
||||||
<Filter Include="80.State\State_Jump">
|
<Filter Include="80.State\State_Jump">
|
||||||
<UniqueIdentifier>{904a7ae5-33fe-49a1-9f31-27443acc9e1a}</UniqueIdentifier>
|
<UniqueIdentifier>{904a7ae5-33fe-49a1-9f31-27443acc9e1a}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
@@ -280,6 +271,36 @@
|
|||||||
<Filter Include="02.GameObjects\Dummys\DummyPhysX\00.Callback\HitReport\Playable">
|
<Filter Include="02.GameObjects\Dummys\DummyPhysX\00.Callback\HitReport\Playable">
|
||||||
<UniqueIdentifier>{83781d7f-b84d-45a3-8361-b6bed2722b74}</UniqueIdentifier>
|
<UniqueIdentifier>{83781d7f-b84d-45a3-8361-b6bed2722b74}</UniqueIdentifier>
|
||||||
</Filter>
|
</Filter>
|
||||||
|
<Filter Include="80.State\State_Land">
|
||||||
|
<UniqueIdentifier>{0b8cac41-419f-48ce-87bc-805b8962b4df}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="02.GameObjects\Monster\Goblin">
|
||||||
|
<UniqueIdentifier>{26e2dcaa-d94a-4c3d-ba39-2916f2a27bac}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="80.State\State_Move">
|
||||||
|
<UniqueIdentifier>{dac78c4e-b898-45dc-8740-794899de0c69}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="80.State\State_Move\State_Sprint">
|
||||||
|
<UniqueIdentifier>{1cac1aa6-ea12-429e-8a84-ca2bf44c2be4}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="80.State\State_Move\State_Walk">
|
||||||
|
<UniqueIdentifier>{43bc0f97-0b7d-406b-900c-0fae023023ec}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="80.State\State_Combat">
|
||||||
|
<UniqueIdentifier>{a56502cb-b0b8-4ea7-bc5e-5482b416fef9}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="80.State\State_Combat\State_Cast">
|
||||||
|
<UniqueIdentifier>{5f6e884b-3ab2-4354-b378-44e8221a4720}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="80.State\State_Combat\State_LightAttack">
|
||||||
|
<UniqueIdentifier>{0aa8e406-d786-4e40-b825-54d5e3f691e2}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="80.State\State_Combat\State_Skill">
|
||||||
|
<UniqueIdentifier>{eb7d24ee-d60e-4062-b974-264409436d81}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
|
<Filter Include="80.State\State_Combat\State_Dodge">
|
||||||
|
<UniqueIdentifier>{b017e167-f48d-4417-a924-765ab802cff5}</UniqueIdentifier>
|
||||||
|
</Filter>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ClInclude Include="Editor.h">
|
<ClInclude Include="Editor.h">
|
||||||
@@ -493,16 +514,16 @@
|
|||||||
<Filter>02.GameObjects\Dummys\DummyPhysX\PhysXWall</Filter>
|
<Filter>02.GameObjects\Dummys\DummyPhysX\PhysXWall</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\Public\State_Dodge.h">
|
<ClInclude Include="..\Public\State_Dodge.h">
|
||||||
<Filter>80.State\State_Dodge</Filter>
|
<Filter>80.State\State_Combat\State_Dodge</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\Public\State_Idle.h">
|
<ClInclude Include="..\Public\State_Idle.h">
|
||||||
<Filter>80.State\State_Idle</Filter>
|
<Filter>80.State\State_Idle</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\Public\State_Walk.h">
|
<ClInclude Include="..\Public\State_Walk.h">
|
||||||
<Filter>80.State\State_Walk</Filter>
|
<Filter>80.State\State_Move\State_Walk</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\Public\State_Sprint.h">
|
<ClInclude Include="..\Public\State_Sprint.h">
|
||||||
<Filter>80.State\State_Sprint</Filter>
|
<Filter>80.State\State_Move\State_Sprint</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
<ClInclude Include="..\Public\State_Jump.h">
|
<ClInclude Include="..\Public\State_Jump.h">
|
||||||
<Filter>80.State\State_Jump</Filter>
|
<Filter>80.State\State_Jump</Filter>
|
||||||
@@ -549,6 +570,27 @@
|
|||||||
<ClInclude Include="..\Public\CallBack_Playable_Behavior.h">
|
<ClInclude Include="..\Public\CallBack_Playable_Behavior.h">
|
||||||
<Filter>02.GameObjects\Dummys\DummyPhysX\00.Callback\Behavior\Playable</Filter>
|
<Filter>02.GameObjects\Dummys\DummyPhysX\00.Callback\Behavior\Playable</Filter>
|
||||||
</ClInclude>
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\Public\State_Skill.h">
|
||||||
|
<Filter>80.State\State_Combat\State_Skill</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\Public\State_LightAttack.h">
|
||||||
|
<Filter>80.State\State_Combat\State_LightAttack</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\Public\State_Land.h">
|
||||||
|
<Filter>80.State\State_Land</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\Public\Goblin.h">
|
||||||
|
<Filter>02.GameObjects\Monster\Goblin</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\Public\State_Cast.h">
|
||||||
|
<Filter>80.State\State_Combat\State_Cast</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\Public\State_Move.h">
|
||||||
|
<Filter>80.State\State_Move</Filter>
|
||||||
|
</ClInclude>
|
||||||
|
<ClInclude Include="..\Public\State_Combat.h">
|
||||||
|
<Filter>80.State\State_Combat</Filter>
|
||||||
|
</ClInclude>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<Image Include="Editor.ico">
|
<Image Include="Editor.ico">
|
||||||
@@ -767,16 +809,16 @@
|
|||||||
<Filter>02.GameObjects\Dummys\DummyPhysX\PhysXDoorSet\PhysXDoorFrame</Filter>
|
<Filter>02.GameObjects\Dummys\DummyPhysX\PhysXDoorSet\PhysXDoorFrame</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\Private\State_Dodge.cpp">
|
<ClCompile Include="..\Private\State_Dodge.cpp">
|
||||||
<Filter>80.State\State_Dodge</Filter>
|
<Filter>80.State\State_Combat\State_Dodge</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\Private\State_Idle.cpp">
|
<ClCompile Include="..\Private\State_Idle.cpp">
|
||||||
<Filter>80.State\State_Idle</Filter>
|
<Filter>80.State\State_Idle</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\Private\State_Walk.cpp">
|
<ClCompile Include="..\Private\State_Walk.cpp">
|
||||||
<Filter>80.State\State_Walk</Filter>
|
<Filter>80.State\State_Move\State_Walk</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\Private\State_Sprint.cpp">
|
<ClCompile Include="..\Private\State_Sprint.cpp">
|
||||||
<Filter>80.State\State_Sprint</Filter>
|
<Filter>80.State\State_Move\State_Sprint</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
<ClCompile Include="..\Private\State_Jump.cpp">
|
<ClCompile Include="..\Private\State_Jump.cpp">
|
||||||
<Filter>80.State\State_Jump</Filter>
|
<Filter>80.State\State_Jump</Filter>
|
||||||
@@ -814,6 +856,27 @@
|
|||||||
<ClCompile Include="..\Private\CallBack_Playable_Behavior.cpp">
|
<ClCompile Include="..\Private\CallBack_Playable_Behavior.cpp">
|
||||||
<Filter>02.GameObjects\Dummys\DummyPhysX\00.Callback\Behavior\Playable</Filter>
|
<Filter>02.GameObjects\Dummys\DummyPhysX\00.Callback\Behavior\Playable</Filter>
|
||||||
</ClCompile>
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\Private\State_Skill.cpp">
|
||||||
|
<Filter>80.State\State_Combat\State_Skill</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\Private\State_LightAttack.cpp">
|
||||||
|
<Filter>80.State\State_Combat\State_LightAttack</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\Private\State_Land.cpp">
|
||||||
|
<Filter>80.State\State_Land</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\Private\Goblin.cpp">
|
||||||
|
<Filter>02.GameObjects\Monster\Goblin</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\Private\State_Cast.cpp">
|
||||||
|
<Filter>80.State\State_Combat\State_Cast</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\Private\State_Move.cpp">
|
||||||
|
<Filter>80.State\State_Move</Filter>
|
||||||
|
</ClCompile>
|
||||||
|
<ClCompile Include="..\Private\State_Combat.cpp">
|
||||||
|
<Filter>80.State\State_Combat</Filter>
|
||||||
|
</ClCompile>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ResourceCompile Include="Editor.rc">
|
<ResourceCompile Include="Editor.rc">
|
||||||
|
|||||||
Binary file not shown.
@@ -8,6 +8,7 @@
|
|||||||
#include "State_Dodge.h"
|
#include "State_Dodge.h"
|
||||||
#include "State_Sprint.h"
|
#include "State_Sprint.h"
|
||||||
#include "State_Jump.h"
|
#include "State_Jump.h"
|
||||||
|
#include "State_Skill.h"
|
||||||
|
|
||||||
CDummyObject::CDummyObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
CDummyObject::CDummyObject(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||||
: CUnit(pDevice, pContext)
|
: CUnit(pDevice, pContext)
|
||||||
@@ -37,11 +38,7 @@ HRESULT CDummyObject::Initialize(void* pArg)
|
|||||||
if (FAILED(Ready_Components()))
|
if (FAILED(Ready_Components()))
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
Add_FSM();
|
m_pModelCom->Set_AnimationIndex(0);
|
||||||
|
|
||||||
Set_Anim();
|
|
||||||
|
|
||||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
@@ -53,10 +50,6 @@ void CDummyObject::Priority_Update(_float fTimeDelta)
|
|||||||
|
|
||||||
void CDummyObject::Update(_float fTimeDelta)
|
void CDummyObject::Update(_float fTimeDelta)
|
||||||
{
|
{
|
||||||
Check_State();
|
|
||||||
|
|
||||||
m_pFSM->Update(fTimeDelta);
|
|
||||||
|
|
||||||
m_pModelCom->Play_Animation(fTimeDelta,m_pTransformCom);
|
m_pModelCom->Play_Animation(fTimeDelta,m_pTransformCom);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -98,42 +91,6 @@ HRESULT CDummyObject::Render()
|
|||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
_bool CDummyObject::IsWalking()
|
|
||||||
{
|
|
||||||
if (m_pGameInstance->Key_Pressing(DIK_UP) || m_pGameInstance->Key_Pressing(DIK_DOWN))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
_bool CDummyObject::IsDodge()
|
|
||||||
{
|
|
||||||
if (m_pGameInstance->Key_Down(DIK_LCONTROL))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
_bool CDummyObject::IsSprint()
|
|
||||||
{
|
|
||||||
if (m_pGameInstance->Key_Pressing(DIK_LSHIFT) && m_pGameInstance->Key_Pressing(DIK_UP))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
_bool CDummyObject::IsJump()
|
|
||||||
{
|
|
||||||
if (m_pGameInstance->Key_Down(DIK_SPACE))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
HRESULT CDummyObject::Ready_Components()
|
HRESULT CDummyObject::Ready_Components()
|
||||||
{
|
{
|
||||||
CTransform::TRANSFORM_DESC Desc = {};
|
CTransform::TRANSFORM_DESC Desc = {};
|
||||||
@@ -175,34 +132,6 @@ HRESULT CDummyObject::Bind_ShaderResources()
|
|||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void CDummyObject::Add_FSM()
|
|
||||||
{
|
|
||||||
m_pFSM->Add_State(FSMSTATE::IDLE, new CState_Idle());
|
|
||||||
m_pFSM->Add_State(FSMSTATE::WALK, new CState_Walk());
|
|
||||||
m_pFSM->Add_State(FSMSTATE::DODGE, new CState_Dodge());
|
|
||||||
m_pFSM->Add_State(FSMSTATE::SPRINT, new CState_Sprint());
|
|
||||||
m_pFSM->Add_State(FSMSTATE::JUMP, new CState_Jump());
|
|
||||||
}
|
|
||||||
|
|
||||||
void CDummyObject::Set_Anim()
|
|
||||||
{
|
|
||||||
m_Animation[FSMSTATE::IDLE] = { 41,true };
|
|
||||||
m_Animation[FSMSTATE::DODGE] = { 802,false };
|
|
||||||
m_Animation[FSMSTATE::WALK_FWD] = { 167,true };
|
|
||||||
m_Animation[FSMSTATE::WALK_BWD] = { 166,true };
|
|
||||||
m_Animation[FSMSTATE::SPRINT] = { 599,true };
|
|
||||||
m_Animation[FSMSTATE::JUMP] = { 205,false };
|
|
||||||
}
|
|
||||||
|
|
||||||
void CDummyObject::Check_State()
|
|
||||||
{
|
|
||||||
IsWalking();
|
|
||||||
|
|
||||||
IsDodge();
|
|
||||||
|
|
||||||
IsSprint();
|
|
||||||
}
|
|
||||||
|
|
||||||
CDummyObject* CDummyObject::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
CDummyObject* CDummyObject::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||||
{
|
{
|
||||||
CDummyObject* pInstance = new CDummyObject(pDevice, pContext);
|
CDummyObject* pInstance = new CDummyObject(pDevice, pContext);
|
||||||
|
|||||||
@@ -0,0 +1,152 @@
|
|||||||
|
#include "pch.h"
|
||||||
|
#include "Goblin.h"
|
||||||
|
|
||||||
|
#include "GameInstance.h"
|
||||||
|
#include "Player.h"
|
||||||
|
|
||||||
|
CGoblin::CGoblin(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||||
|
: CMonster(pDevice, pContext)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
CGoblin::CGoblin(const CGoblin& Prototype)
|
||||||
|
: CMonster(Prototype)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT CGoblin::Initialize_Prototype()
|
||||||
|
{
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT CGoblin::Initialize(void* pArg)
|
||||||
|
{
|
||||||
|
if (FAILED(__super::Initialize(pArg)))
|
||||||
|
return E_FAIL;
|
||||||
|
|
||||||
|
if (FAILED(Ready_Components()))
|
||||||
|
return E_FAIL;
|
||||||
|
|
||||||
|
m_pModelCom->Set_AnimationIndex(1);
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CGoblin::Priority_Update(_float fTimeDelta)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CGoblin::Update(_float fTimeDelta)
|
||||||
|
{
|
||||||
|
m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CGoblin::Late_Update(_float fTimeDelta)
|
||||||
|
{
|
||||||
|
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this);
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT CGoblin::Render()
|
||||||
|
{
|
||||||
|
if (FAILED(Bind_ShaderResources())) {
|
||||||
|
return E_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
_uint iNumMeshes = m_pModelCom->Get_NumMeshes();
|
||||||
|
|
||||||
|
for (_uint i = 0; i < iNumMeshes; i++)
|
||||||
|
{
|
||||||
|
if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) {
|
||||||
|
return E_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) {
|
||||||
|
return E_FAIL;
|
||||||
|
}
|
||||||
|
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_NormalTexture", aiTextureType_NORMALS, 0))) {
|
||||||
|
return E_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT)))) {
|
||||||
|
return E_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (FAILED(m_pModelCom->Render(i))) {
|
||||||
|
return E_FAIL;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT CGoblin::Ready_Components()
|
||||||
|
{
|
||||||
|
CTransform::TRANSFORM_DESC Desc = {};
|
||||||
|
|
||||||
|
Desc.fSpeedPerSec = 10.f;
|
||||||
|
Desc.fRotationPerSec = XMConvertToRadians(180.0f);
|
||||||
|
Desc.fRadius = 10.f;
|
||||||
|
|
||||||
|
__super::Ready_Components(&Desc);
|
||||||
|
|
||||||
|
m_strModelPrototypeTag = TEXT("Prototype_Component_Goblin_Model");
|
||||||
|
|
||||||
|
/* Com_Model */
|
||||||
|
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_strModelPrototypeTag,
|
||||||
|
reinterpret_cast<CComponent**>(&m_pModelCom))))
|
||||||
|
return E_FAIL;
|
||||||
|
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
HRESULT CGoblin::Bind_ShaderResources()
|
||||||
|
{
|
||||||
|
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) {
|
||||||
|
return E_FAIL;
|
||||||
|
}
|
||||||
|
if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) {
|
||||||
|
return E_FAIL;
|
||||||
|
}
|
||||||
|
if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) {
|
||||||
|
return E_FAIL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
|
||||||
|
return E_FAIL;
|
||||||
|
}
|
||||||
|
return S_OK;
|
||||||
|
}
|
||||||
|
|
||||||
|
CGoblin* CGoblin::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||||
|
{
|
||||||
|
CGoblin* pInstance = new CGoblin(pDevice, pContext);
|
||||||
|
|
||||||
|
if (FAILED(pInstance->Initialize_Prototype()))
|
||||||
|
{
|
||||||
|
MSG_BOX("Failed to Created : CGoblin");
|
||||||
|
SAFE_RELEASE(pInstance);
|
||||||
|
}
|
||||||
|
return pInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
CGameObject* CGoblin::Clone(void* pArg, CGameObject* pOwner)
|
||||||
|
{
|
||||||
|
CGoblin* pInstance = new CGoblin(*this);
|
||||||
|
|
||||||
|
if (FAILED(pInstance->Initialize(pArg)))
|
||||||
|
{
|
||||||
|
MSG_BOX("Failed to Cloned : CGoblin");
|
||||||
|
SAFE_RELEASE(pInstance);
|
||||||
|
}
|
||||||
|
return pInstance;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CGoblin::Free()
|
||||||
|
{
|
||||||
|
__super::Free();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CGoblin::Describe_Entity()
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -16,6 +16,7 @@
|
|||||||
#include "MainLight.h"
|
#include "MainLight.h"
|
||||||
#include "Terrain.h"
|
#include "Terrain.h"
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
|
#include "Goblin.h"
|
||||||
|
|
||||||
CLevel_ObjectViewer::CLevel_ObjectViewer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
|
CLevel_ObjectViewer::CLevel_ObjectViewer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID)
|
||||||
: CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) }
|
: CLevel{ pDevice, pContext, ENUM_CLASS(eLevelID) }
|
||||||
@@ -56,6 +57,8 @@ void CLevel_ObjectViewer::Update(_float fTimeDelta)
|
|||||||
Parts_Object_Setting();
|
Parts_Object_Setting();
|
||||||
|
|
||||||
Find_Anim();
|
Find_Anim();
|
||||||
|
|
||||||
|
m_Test->Describe_Entity();
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT CLevel_ObjectViewer::Render()
|
HRESULT CLevel_ObjectViewer::Render()
|
||||||
@@ -384,7 +387,10 @@ void CLevel_ObjectViewer::Dummy_Object_Setting()
|
|||||||
GUI::Text(label);
|
GUI::Text(label);
|
||||||
|
|
||||||
_float AnimTrack = pModel->Get_CurrentTrackPosition();
|
_float AnimTrack = pModel->Get_CurrentTrackPosition();
|
||||||
GUI::DragFloat("AnimTrack", &AnimTrack);
|
if (GUI::DragFloat("AnimTrack", &AnimTrack))
|
||||||
|
{
|
||||||
|
pModel->Set_CurrentTrackPosition(AnimTrack);
|
||||||
|
}
|
||||||
|
|
||||||
_float AnimSpeed = pModel->Get_AnimSpeed();
|
_float AnimSpeed = pModel->Get_AnimSpeed();
|
||||||
GUI::DragFloat("AnimSpeed", &AnimSpeed, 0.1f);
|
GUI::DragFloat("AnimSpeed", &AnimSpeed, 0.1f);
|
||||||
@@ -414,8 +420,7 @@ void CLevel_ObjectViewer::Dummy_Object_Setting()
|
|||||||
if (pModel)
|
if (pModel)
|
||||||
{
|
{
|
||||||
_float fKeyFrame = pModel->Get_CurrentTrackPosition();
|
_float fKeyFrame = pModel->Get_CurrentTrackPosition();
|
||||||
m_KeyFrame.push_back(fKeyFrame);
|
m_KeyFrames.emplace(EventName, fKeyFrame);
|
||||||
m_Events.emplace_back(EventName);
|
|
||||||
|
|
||||||
_char szDir[MAX_PATH] = {};
|
_char szDir[MAX_PATH] = {};
|
||||||
|
|
||||||
@@ -428,16 +433,16 @@ void CLevel_ObjectViewer::Dummy_Object_Setting()
|
|||||||
fopen_s(&fp, Path.c_str(), "wb");
|
fopen_s(&fp, Path.c_str(), "wb");
|
||||||
if (!fp) return;
|
if (!fp) return;
|
||||||
|
|
||||||
_uint KeyFrameSize = (_uint)m_KeyFrame.size();
|
_uint KeyFrameSize = (_uint)m_KeyFrames.size();
|
||||||
|
|
||||||
fwrite(&KeyFrameSize, sizeof(_uint), 1, fp);
|
fwrite(&KeyFrameSize, sizeof(_uint), 1, fp);
|
||||||
|
|
||||||
for (size_t i = 0; i < m_KeyFrame.size(); i++)
|
for (auto& iter : m_KeyFrames)
|
||||||
{
|
{
|
||||||
_uint EventSize = (_uint)m_Events[i].size() + 1;
|
_uint EventSize = (_uint)iter.first.size();
|
||||||
fwrite(&m_KeyFrame[i], sizeof(_float), 1, fp);
|
fwrite(&iter.second, sizeof(_float), 1, fp);
|
||||||
fwrite(&EventSize, sizeof(_uint), 1, fp);
|
fwrite(&EventSize, sizeof(_uint), 1, fp);
|
||||||
fwrite(m_Events[i].c_str(), sizeof(_char), EventSize, fp);
|
fwrite(iter.first.c_str(), sizeof(_char), EventSize, fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -447,21 +452,21 @@ void CLevel_ObjectViewer::Dummy_Object_Setting()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (_uint i = 0; i < m_KeyFrame.size(); ++i)
|
for (auto& iter : m_KeyFrames)
|
||||||
{
|
{
|
||||||
ImDrawList* draw = ImGui::GetForegroundDrawList();
|
ImDrawList* draw = ImGui::GetForegroundDrawList();
|
||||||
ImVec2 center = ImGui::GetMainViewport()->GetCenter();
|
ImVec2 center = ImGui::GetMainViewport()->GetCenter();
|
||||||
float scale = 50.f;
|
float scale = 50.f;
|
||||||
|
|
||||||
GUI::DragFloat(m_Events[i].c_str(), &m_KeyFrame[i]);
|
GUI::DragFloat(iter.first.c_str(), &iter.second);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (GUI::Button("Delete"))
|
if (GUI::Button("Delete"))
|
||||||
{
|
{
|
||||||
m_pGameInstance->Get_Layer(NEXT_LEVEL, m_wszPreLayer)->Clear_Layer();
|
m_pGameInstance->Get_Layer(NEXT_LEVEL, m_wszPreLayer)->Clear_Layer();
|
||||||
m_Objects.pop_back();
|
m_Objects.pop_back();
|
||||||
m_Events.clear();
|
|
||||||
m_KeyFrame.clear();
|
m_KeyFrames.clear();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GUI::End();
|
GUI::End();
|
||||||
@@ -517,38 +522,37 @@ void CLevel_ObjectViewer::Parts_Object_Setting()
|
|||||||
if (m_HumanRoot && m_HumanRoot->Get_MainModel())
|
if (m_HumanRoot && m_HumanRoot->Get_MainModel())
|
||||||
{
|
{
|
||||||
_float fKeyFrame = m_HumanRoot->Get_MainModel()->Get_CurrentTrackPosition();
|
_float fKeyFrame = m_HumanRoot->Get_MainModel()->Get_CurrentTrackPosition();
|
||||||
m_KeyFrame.push_back(fKeyFrame);
|
m_KeyFrames.emplace(EventName, fKeyFrame);
|
||||||
m_Events.emplace_back(EventName);
|
|
||||||
|
|
||||||
FILE* fp = nullptr;
|
FILE* fp = nullptr;
|
||||||
fopen_s(&fp, "../Bin/Resources/Models/Human/KeyFrame.bin", "wb");
|
fopen_s(&fp, "../Bin/Resources/Models/Human/KeyFrame.bin", "wb");
|
||||||
if (!fp) return;
|
if (!fp) return;
|
||||||
|
|
||||||
_uint KeyFrameSize = (_uint)m_KeyFrame.size() + 1;
|
_uint KeyFrameSize = (_uint)m_KeyFrames.size();
|
||||||
|
|
||||||
fwrite(&KeyFrameSize, sizeof(_uint), 1, fp);
|
fwrite(&KeyFrameSize, sizeof(_uint), 1, fp);
|
||||||
|
|
||||||
for (size_t i = 0; i < m_KeyFrame.size(); i++)
|
for (auto& iter : m_KeyFrames)
|
||||||
{
|
{
|
||||||
_uint EventSize = (_uint)m_Events[i].size() + 1;
|
_uint EventSize = (_uint)iter.first.size();
|
||||||
fwrite(&m_KeyFrame[i], sizeof(_float), 1, fp);
|
fwrite(&iter.second, sizeof(_float), 1, fp);
|
||||||
fwrite(&EventSize, sizeof(_uint), 1, fp);
|
fwrite(&EventSize, sizeof(_uint), 1, fp);
|
||||||
fwrite(m_Events[i].c_str(), sizeof(_char), EventSize, fp);
|
fwrite(iter.first.c_str(), sizeof(_char), EventSize, fp);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
|
|
||||||
EventName[0] = '\0';
|
EventName[0] = '\0';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
for (auto& iter : m_KeyFrames)
|
||||||
for (_uint i = 0; i < m_KeyFrame.size(); ++i)
|
|
||||||
{
|
{
|
||||||
ImDrawList* draw = ImGui::GetForegroundDrawList();
|
ImDrawList* draw = ImGui::GetForegroundDrawList();
|
||||||
ImVec2 center = ImGui::GetMainViewport()->GetCenter();
|
ImVec2 center = ImGui::GetMainViewport()->GetCenter();
|
||||||
float scale = 50.f;
|
float scale = 50.f;
|
||||||
|
|
||||||
GUI::DragFloat(m_Events[i].c_str(), &m_KeyFrame[i]);
|
GUI::DragFloat(iter.first.c_str(), &iter.second);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -556,8 +560,7 @@ void CLevel_ObjectViewer::Parts_Object_Setting()
|
|||||||
{
|
{
|
||||||
m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_Root"))->Clear_Layer();
|
m_pGameInstance->Get_Layer(NEXT_LEVEL, TEXT("Layer_Root"))->Clear_Layer();
|
||||||
m_HumanRoot = nullptr;
|
m_HumanRoot = nullptr;
|
||||||
m_Events.clear();
|
m_KeyFrames.clear();
|
||||||
m_KeyFrame.clear();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -621,9 +624,7 @@ void CLevel_ObjectViewer::Load_KeyFrame(const _char* Name)
|
|||||||
str.resize(EventLen);
|
str.resize(EventLen);
|
||||||
|
|
||||||
fread(str.data(), sizeof(_char), EventLen, fp);
|
fread(str.data(), sizeof(_char), EventLen, fp);
|
||||||
|
m_KeyFrames.emplace(str, fKey);
|
||||||
m_KeyFrame.push_back(fKey);
|
|
||||||
m_Events.push_back(str);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fclose(fp);
|
fclose(fp);
|
||||||
@@ -693,8 +694,11 @@ HRESULT CLevel_ObjectViewer::Ready_Layer_Dummy(const _wstring& strLayerTag)
|
|||||||
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CTerrain>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
|
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CTerrain>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
/*if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CPlayer>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
|
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CPlayer>(g_iStaticLevel, NEXT_LEVEL, strLayerTag,nullptr,nullptr, &m_Test)))
|
||||||
return E_FAIL;*/
|
return E_FAIL;
|
||||||
|
|
||||||
|
if (FAILED(m_pGameInstance->Add_GameObject_ToLayer<CGoblin>(g_iStaticLevel, NEXT_LEVEL, strLayerTag)))
|
||||||
|
return E_FAIL;
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,6 +21,7 @@
|
|||||||
#include "DummySkyBox.h"
|
#include "DummySkyBox.h"
|
||||||
#include "DummyObject.h"
|
#include "DummyObject.h"
|
||||||
#include "Player.h"
|
#include "Player.h"
|
||||||
|
#include "Goblin.h"
|
||||||
#include <filesystem>
|
#include <filesystem>
|
||||||
|
|
||||||
#pragma endregion
|
#pragma endregion
|
||||||
@@ -1025,6 +1026,10 @@ HRESULT CLoader::Loading_For_ObjectViewer()
|
|||||||
|
|
||||||
#pragma region MONSTER
|
#pragma region MONSTER
|
||||||
|
|
||||||
|
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Goblin_Model"),
|
||||||
|
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/Goblin/Goblin.bin", XMMatrixIdentity()))))
|
||||||
|
return E_FAIL;
|
||||||
|
|
||||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_TombProtector_Model"),
|
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_TombProtector_Model"),
|
||||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/TombProtector/TombProtector.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity()))))
|
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Monster/TombProtector/TombProtector.bin", XMMatrixScaling(0.0001f, 0.0001f, 0.0001f) * XMMatrixIdentity()))))
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
@@ -1040,7 +1045,7 @@ HRESULT CLoader::Loading_For_ObjectViewer()
|
|||||||
#pragma endregion
|
#pragma endregion
|
||||||
|
|
||||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Npc_Model"),
|
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Npc_Model"),
|
||||||
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Npc/Npc.bin", XMMatrixIdentity()))))
|
CModel::Create(m_pDevice, m_pContext, MODEL::ANIM, "../Bin/Resources/Models/Human/Npc/Npc.bin",XMMatrixIdentity()))))
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Broom_Model"),
|
if (FAILED(m_pGameInstance->Add_Asset_Prototype(ENUM_CLASS(LEVEL::STATIC), TEXT("Prototype_Component_Broom_Model"),
|
||||||
@@ -1107,6 +1112,10 @@ HRESULT CLoader::Loading_For_ObjectViewer()
|
|||||||
if (FAILED(m_pGameInstance->Add_Prototype<CPlayer>(g_iStaticLevel, CPlayer::Create(m_pDevice, m_pContext))))
|
if (FAILED(m_pGameInstance->Add_Prototype<CPlayer>(g_iStaticLevel, CPlayer::Create(m_pDevice, m_pContext))))
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
|
/* For.Prototype_GameObject_Goblin */
|
||||||
|
if (FAILED(m_pGameInstance->Add_Prototype<CGoblin>(g_iStaticLevel, CGoblin::Create(m_pDevice, m_pContext))))
|
||||||
|
return E_FAIL;
|
||||||
|
|
||||||
m_strMessage = TEXT("Loading Success!");
|
m_strMessage = TEXT("Loading Success!");
|
||||||
|
|
||||||
m_isFinished = true;
|
m_isFinished = true;
|
||||||
|
|||||||
@@ -2,15 +2,14 @@
|
|||||||
#include "Monster.h"
|
#include "Monster.h"
|
||||||
|
|
||||||
#include "GameInstance.h"
|
#include "GameInstance.h"
|
||||||
#include "DebugCamera.h"
|
|
||||||
|
|
||||||
CMonster::CMonster(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
CMonster::CMonster(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||||
: CGameObject(pDevice, pContext)
|
: CUnit(pDevice, pContext)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
CMonster::CMonster(const CMonster& Prototype)
|
CMonster::CMonster(const CMonster& Prototype)
|
||||||
: CGameObject(Prototype)
|
: CUnit(Prototype)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21,19 +20,9 @@ HRESULT CMonster::Initialize_Prototype()
|
|||||||
|
|
||||||
HRESULT CMonster::Initialize(void* pArg)
|
HRESULT CMonster::Initialize(void* pArg)
|
||||||
{
|
{
|
||||||
PARTS_OBJECT_DESC* pDesc = static_cast<PARTS_OBJECT_DESC*>(pArg);
|
|
||||||
|
|
||||||
m_strModelPrototypeTag = pDesc->pModelPrototypeTag;
|
|
||||||
|
|
||||||
if (FAILED(__super::Initialize(pArg)))
|
if (FAILED(__super::Initialize(pArg)))
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
|
|
||||||
if (FAILED(Ready_Components()))
|
|
||||||
return E_FAIL;
|
|
||||||
|
|
||||||
m_pModelCom->Set_AnimationIndex(0);
|
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -44,57 +33,20 @@ void CMonster::Priority_Update(_float fTimeDelta)
|
|||||||
|
|
||||||
void CMonster::Update(_float fTimeDelta)
|
void CMonster::Update(_float fTimeDelta)
|
||||||
{
|
{
|
||||||
m_pModelCom->Play_Animation(fTimeDelta, m_pTransformCom);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMonster::Late_Update(_float fTimeDelta)
|
void CMonster::Late_Update(_float fTimeDelta)
|
||||||
{
|
{
|
||||||
if (m_pGameInstance->isIn_WorldFrustum(Get_WorldPostion(), m_pTransformCom->Get_Radius())) {
|
|
||||||
m_pGameInstance->Add_RenderGroup(RENDER::BLEND, this);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT CMonster::Render()
|
HRESULT CMonster::Render()
|
||||||
{
|
{
|
||||||
if (FAILED(Bind_ShaderResources())) {
|
|
||||||
return E_FAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
_uint iNumMeshes = m_pModelCom->Get_NumMeshes();
|
|
||||||
|
|
||||||
for (_uint i = 0; i < iNumMeshes; i++)
|
|
||||||
{
|
|
||||||
if (FAILED(m_pModelCom->Bind_BoneMatrices(i, m_pShaderCom, "g_BoneMatrices"))) {
|
|
||||||
return E_FAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_DiffuseTexture", aiTextureType_DIFFUSE, 0))) {
|
|
||||||
return E_FAIL;
|
|
||||||
}
|
|
||||||
if (FAILED(m_pModelCom->Bind_Material(i, m_pShaderCom, "g_NormalTexture", aiTextureType_NORMALS, 0))) {
|
|
||||||
return E_FAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (FAILED(m_pShaderCom->Begin(ENUM_CLASS(SHADER_PASS_ANIM::DEFAULT)))) {
|
|
||||||
return E_FAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (FAILED(m_pModelCom->Render(i))) {
|
|
||||||
return E_FAIL;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
HRESULT CMonster::Ready_Components()
|
HRESULT CMonster::Ready_Components(void*pArg)
|
||||||
{
|
{
|
||||||
__super::Ready_Components(nullptr);
|
__super::Ready_Components(pArg);
|
||||||
|
|
||||||
/* Com_Model */
|
|
||||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_strModelPrototypeTag,
|
|
||||||
reinterpret_cast<CComponent**>(&m_pModelCom))))
|
|
||||||
return E_FAIL;
|
|
||||||
|
|
||||||
/* Com_Shader */
|
/* Com_Shader */
|
||||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_ANIMMESH,
|
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, FX_ANIMMESH,
|
||||||
@@ -106,56 +58,13 @@ HRESULT CMonster::Ready_Components()
|
|||||||
|
|
||||||
HRESULT CMonster::Bind_ShaderResources()
|
HRESULT CMonster::Bind_ShaderResources()
|
||||||
{
|
{
|
||||||
if (FAILED(m_pTransformCom->Bind_ShaderResource(m_pShaderCom, "g_WorldMatrix"))) {
|
|
||||||
return E_FAIL;
|
|
||||||
}
|
|
||||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ViewMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::VIEW)))) {
|
|
||||||
return E_FAIL;
|
|
||||||
}
|
|
||||||
if (FAILED(m_pShaderCom->Bind_Matrix("g_ProjMatrix", m_pGameInstance->Get_Transform_Float4x4(D3DTS::PROJ)))) {
|
|
||||||
return E_FAIL;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (FAILED(m_pShaderCom->Bind_RawValue("g_fFar", m_pGameInstance->Get_CurrentCameraFar(), sizeof(_float)))) {
|
|
||||||
return E_FAIL;
|
|
||||||
}
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
CMonster* CMonster::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
|
||||||
{
|
|
||||||
CMonster* pInstance = new CMonster(pDevice, pContext);
|
|
||||||
|
|
||||||
if (FAILED(pInstance->Initialize_Prototype()))
|
|
||||||
{
|
|
||||||
MSG_BOX("Failed to Created : CMonster");
|
|
||||||
SAFE_RELEASE(pInstance);
|
|
||||||
}
|
|
||||||
|
|
||||||
return pInstance;
|
|
||||||
}
|
|
||||||
|
|
||||||
CGameObject* CMonster::Clone(void* pArg, CGameObject* pOwner)
|
|
||||||
{
|
|
||||||
CMonster* pInstance = new CMonster(*this);
|
|
||||||
|
|
||||||
if (FAILED(pInstance->Initialize(pArg)))
|
|
||||||
{
|
|
||||||
MSG_BOX("Failed to Cloned : CMonster");
|
|
||||||
SAFE_RELEASE(pInstance);
|
|
||||||
}
|
|
||||||
|
|
||||||
return pInstance;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
void CMonster::Free()
|
void CMonster::Free()
|
||||||
{
|
{
|
||||||
__super::Free();
|
__super::Free();
|
||||||
|
|
||||||
SAFE_RELEASE(m_pShaderCom);
|
|
||||||
SAFE_RELEASE(m_pModelCom);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CMonster::Describe_Entity()
|
void CMonster::Describe_Entity()
|
||||||
|
|||||||
@@ -3,11 +3,20 @@
|
|||||||
|
|
||||||
#include "GameInstance.h"
|
#include "GameInstance.h"
|
||||||
#include "DebugCamera.h"
|
#include "DebugCamera.h"
|
||||||
|
|
||||||
|
#pragma region STATE
|
||||||
#include "State_Idle.h"
|
#include "State_Idle.h"
|
||||||
#include "State_Walk.h"
|
#include "State_Walk.h"
|
||||||
#include "State_Dodge.h"
|
#include "State_Dodge.h"
|
||||||
#include "State_Sprint.h"
|
#include "State_Sprint.h"
|
||||||
#include "State_Jump.h"
|
#include "State_Jump.h"
|
||||||
|
#include "State_Skill.h"
|
||||||
|
#include "State_LightAttack.h"
|
||||||
|
#include "State_Land.h"
|
||||||
|
#include "State_Cast.h"
|
||||||
|
#include "State_Move.h"
|
||||||
|
#include "State_Combat.h"
|
||||||
|
#pragma endregion
|
||||||
|
|
||||||
CPlayer::CPlayer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
CPlayer::CPlayer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||||
: CUnit(pDevice, pContext)
|
: CUnit(pDevice, pContext)
|
||||||
@@ -29,14 +38,19 @@ HRESULT CPlayer::Initialize(void* pArg)
|
|||||||
if (FAILED(__super::Initialize(pArg)))
|
if (FAILED(__super::Initialize(pArg)))
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
|
|
||||||
if (FAILED(Ready_Components()))
|
if (FAILED(Ready_Components()))
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
|
Load_KeyFrame();
|
||||||
|
|
||||||
Add_FSM();
|
Add_FSM();
|
||||||
|
|
||||||
|
Set_FSM();
|
||||||
|
|
||||||
Set_Anim();
|
Set_Anim();
|
||||||
|
|
||||||
|
Setup_InputConditions();
|
||||||
|
|
||||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||||
|
|
||||||
return S_OK;
|
return S_OK;
|
||||||
@@ -49,7 +63,7 @@ void CPlayer::Priority_Update(_float fTimeDelta)
|
|||||||
|
|
||||||
void CPlayer::Update(_float fTimeDelta)
|
void CPlayer::Update(_float fTimeDelta)
|
||||||
{
|
{
|
||||||
Check_State();
|
Key_Input(fTimeDelta);
|
||||||
|
|
||||||
m_pFSM->Update(fTimeDelta);
|
m_pFSM->Update(fTimeDelta);
|
||||||
|
|
||||||
@@ -94,54 +108,20 @@ HRESULT CPlayer::Render()
|
|||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
_bool CPlayer::IsWalking()
|
|
||||||
{
|
|
||||||
if (m_pGameInstance->Key_Pressing(DIK_UP) || m_pGameInstance->Key_Pressing(DIK_DOWN))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
_bool CPlayer::IsDodge()
|
|
||||||
{
|
|
||||||
if (m_pGameInstance->Key_Down(DIK_LCONTROL))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
_bool CPlayer::IsSprint()
|
|
||||||
{
|
|
||||||
if (m_pGameInstance->Key_Pressing(DIK_LSHIFT) && m_pGameInstance->Key_Pressing(DIK_UP))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
_bool CPlayer::IsJump()
|
|
||||||
{
|
|
||||||
if (m_pGameInstance->Key_Down(DIK_SPACE))
|
|
||||||
{
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
HRESULT CPlayer::Ready_Components()
|
HRESULT CPlayer::Ready_Components()
|
||||||
{
|
{
|
||||||
CTransform::TRANSFORM_DESC Desc = {};
|
CTransform::TRANSFORM_DESC Desc = {};
|
||||||
|
|
||||||
Desc.fSpeedPerSec = 10.f;
|
Desc.fSpeedPerSec = 10.f;
|
||||||
Desc.fRotationPerSec = 10.f;
|
Desc.fRotationPerSec = XMConvertToRadians(180.0f);
|
||||||
Desc.fRadius = 10.f;
|
Desc.fRadius = 10.f;
|
||||||
|
|
||||||
__super::Ready_Components(&Desc);
|
__super::Ready_Components(&Desc);
|
||||||
|
|
||||||
|
m_strModelPrototypeTag = TEXT("Prototype_Component_Npc_Model");
|
||||||
|
|
||||||
/* Com_Model */
|
/* Com_Model */
|
||||||
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, TEXT("Prototype_Component_Npc_Model"),
|
if (FAILED(__super::Add_Asset_Component(g_iStaticLevel, m_strModelPrototypeTag,
|
||||||
reinterpret_cast<CComponent**>(&m_pModelCom))))
|
reinterpret_cast<CComponent**>(&m_pModelCom))))
|
||||||
return E_FAIL;
|
return E_FAIL;
|
||||||
|
|
||||||
@@ -171,32 +151,93 @@ HRESULT CPlayer::Bind_ShaderResources()
|
|||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CPlayer::Setup_InputConditions()
|
||||||
|
{
|
||||||
|
m_InputConditions =
|
||||||
|
{
|
||||||
|
{ FSMSTATE::MOVE, [&]() {return Check(FSMSTATE::WALK) && Check(FSMSTATE::SPRINT) && Check(FSMSTATE::JOG); }},
|
||||||
|
{ FSMSTATE::WALK, [&]() { return m_pGameInstance->Key_Pressing(DIK_UP)
|
||||||
|
|| m_pGameInstance->Key_Pressing(DIK_DOWN); }},
|
||||||
|
{ FSMSTATE::WALK_FWD, [&]() { return m_pGameInstance->Key_Pressing(DIK_UP); }},
|
||||||
|
{ FSMSTATE::WALK_BWD, [&]() { return m_pGameInstance->Key_Pressing(DIK_DOWN); }},
|
||||||
|
{ FSMSTATE::SPRINT, [&]() { return m_pGameInstance->Key_Pressing(DIK_LSHIFT)
|
||||||
|
&& m_pGameInstance->Key_Pressing(DIK_UP); }},
|
||||||
|
|
||||||
|
{ FSMSTATE::COMBAT, [&]() {return Check(FSMSTATE::DODGE) && Check(FSMSTATE::SKILL) && Check(FSMSTATE::LIGHT_ATTACK) && Check(FSMSTATE::CAST); }},
|
||||||
|
{ FSMSTATE::DODGE, [&]() { return m_pGameInstance->Key_Down(DIK_LCONTROL); }},
|
||||||
|
{ FSMSTATE::SKILL, [&]() { return m_pGameInstance->Key_Down(DIK_R); }},
|
||||||
|
{ FSMSTATE::LIGHT_ATTACK,[&]() { return m_pGameInstance->Mouse_Up(ENUM_CLASS(MOUSEKEYSTATE::LBUTTON)); }},
|
||||||
|
{ FSMSTATE::CAST, [&]() { return m_pGameInstance->Key_Down(DIK_1); }},
|
||||||
|
|
||||||
|
{ FSMSTATE::JUMP, [&]() { return m_pGameInstance->Key_Down(DIK_SPACE); } }
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPlayer::Key_Input(_float fTimeDelta)
|
||||||
|
{
|
||||||
|
if (m_pFSM->Get_CurrState() == FSMSTATE::WALK ||
|
||||||
|
m_pFSM->Get_CurrState() == FSMSTATE::SPRINT||
|
||||||
|
m_pFSM->Get_CurrState() == FSMSTATE::DODGE)
|
||||||
|
{
|
||||||
|
if (m_pGameInstance->Key_Pressing(DIK_LEFT))
|
||||||
|
m_pTransformCom->Turn(-m_pTransformCom->Get_State(STATE::UP), fTimeDelta);
|
||||||
|
|
||||||
|
if (m_pGameInstance->Key_Pressing(DIK_RIGHT))
|
||||||
|
m_pTransformCom->Turn(m_pTransformCom->Get_State(STATE::UP), fTimeDelta);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void CPlayer::Add_FSM()
|
void CPlayer::Add_FSM()
|
||||||
{
|
{
|
||||||
m_pFSM->Add_State(FSMSTATE::IDLE, new CState_Idle());
|
#pragma region MOVE
|
||||||
|
m_pFSM->Add_State(FSMSTATE::MOVE, new CState_Move());
|
||||||
m_pFSM->Add_State(FSMSTATE::WALK, new CState_Walk());
|
m_pFSM->Add_State(FSMSTATE::WALK, new CState_Walk());
|
||||||
m_pFSM->Add_State(FSMSTATE::DODGE, new CState_Dodge());
|
|
||||||
m_pFSM->Add_State(FSMSTATE::SPRINT, new CState_Sprint());
|
m_pFSM->Add_State(FSMSTATE::SPRINT, new CState_Sprint());
|
||||||
|
#pragma endregion
|
||||||
|
|
||||||
|
#pragma region COMBAT
|
||||||
|
m_pFSM->Add_State(FSMSTATE::COMBAT, new CState_Combat());
|
||||||
|
m_pFSM->Add_State(FSMSTATE::SKILL, new CState_Skill());
|
||||||
|
m_pFSM->Add_State(FSMSTATE::LIGHT_ATTACK, new CState_LightAttack());
|
||||||
|
m_pFSM->Add_State(FSMSTATE::CAST, new CState_Cast());
|
||||||
|
m_pFSM->Add_State(FSMSTATE::DODGE, new CState_Dodge());
|
||||||
|
#pragma endregion
|
||||||
|
m_pFSM->Add_State(FSMSTATE::IDLE, new CState_Idle());
|
||||||
m_pFSM->Add_State(FSMSTATE::JUMP, new CState_Jump());
|
m_pFSM->Add_State(FSMSTATE::JUMP, new CState_Jump());
|
||||||
|
m_pFSM->Add_State(FSMSTATE::LAND, new CState_Land());
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CPlayer::Set_FSM()
|
||||||
|
{
|
||||||
|
#pragma region MOVE
|
||||||
|
m_pFSM->Set_Parent(FSMSTATE::WALK, FSMSTATE::MOVE);
|
||||||
|
m_pFSM->Set_Parent(FSMSTATE::WALK_BWD, FSMSTATE::MOVE);
|
||||||
|
m_pFSM->Set_Parent(FSMSTATE::WALK_FWD, FSMSTATE::MOVE);
|
||||||
|
m_pFSM->Set_Parent(FSMSTATE::JOG, FSMSTATE::MOVE);
|
||||||
|
m_pFSM->Set_Parent(FSMSTATE::SPRINT, FSMSTATE::MOVE);
|
||||||
|
#pragma endregion
|
||||||
|
|
||||||
|
#pragma region COMBAT
|
||||||
|
m_pFSM->Set_Parent(FSMSTATE::SKILL, FSMSTATE::COMBAT);
|
||||||
|
m_pFSM->Set_Parent(FSMSTATE::LIGHT_ATTACK, FSMSTATE::COMBAT);
|
||||||
|
m_pFSM->Set_Parent(FSMSTATE::CAST, FSMSTATE::COMBAT);
|
||||||
|
m_pFSM->Set_Parent(FSMSTATE::DODGE, FSMSTATE::COMBAT);
|
||||||
|
#pragma endregion
|
||||||
}
|
}
|
||||||
|
|
||||||
void CPlayer::Set_Anim()
|
void CPlayer::Set_Anim()
|
||||||
{
|
{
|
||||||
m_Animation[FSMSTATE::IDLE] = { 41,true };
|
m_Animation[FSMSTATE::IDLE] = { 266,true };
|
||||||
m_Animation[FSMSTATE::DODGE] = { 802,false };
|
m_Animation[FSMSTATE::DODGE] = { 802,false };
|
||||||
m_Animation[FSMSTATE::WALK_FWD] = { 167,true };
|
m_Animation[FSMSTATE::WALK_FWD] = { 167,true };
|
||||||
m_Animation[FSMSTATE::WALK_BWD] = { 166,true };
|
m_Animation[FSMSTATE::WALK_BWD] = { 166,true };
|
||||||
m_Animation[FSMSTATE::SPRINT] = { 599,true };
|
m_Animation[FSMSTATE::SPRINT] = { 599,true };
|
||||||
m_Animation[FSMSTATE::JUMP] = { 205,false };
|
m_Animation[FSMSTATE::JUMP] = { 205,false };
|
||||||
}
|
m_Animation[FSMSTATE::SKILL] = { 593,false };
|
||||||
|
m_Animation[FSMSTATE::LIGHT_ATTACK] = { 413,false };
|
||||||
void CPlayer::Check_State()
|
m_Animation[FSMSTATE::LAND] = { 259,false };
|
||||||
{
|
m_Animation[FSMSTATE::CAST] = { 696,false };
|
||||||
IsWalking();
|
|
||||||
|
|
||||||
IsDodge();
|
|
||||||
|
|
||||||
IsSprint();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
CPlayer* CPlayer::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
CPlayer* CPlayer::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||||
@@ -230,4 +271,22 @@ void CPlayer::Free()
|
|||||||
|
|
||||||
void CPlayer::Describe_Entity()
|
void CPlayer::Describe_Entity()
|
||||||
{
|
{
|
||||||
|
_char label[256];
|
||||||
|
for (auto& iter : m_KeyFrames)
|
||||||
|
{
|
||||||
|
sprintf_s(label, "%s %.2f", iter.first.c_str(), iter.second);
|
||||||
|
|
||||||
|
GUI::Text(label);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
_bool CPlayer::Check(FSMSTATE::ESTATE state)
|
||||||
|
{
|
||||||
|
for (auto& cond : m_InputConditions)
|
||||||
|
{
|
||||||
|
if (cond.state == state)
|
||||||
|
return cond.checker();
|
||||||
|
}
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,75 @@
|
|||||||
|
#include "pch.h"
|
||||||
|
#include "State_Cast.h"
|
||||||
|
#include "Unit.h"
|
||||||
|
|
||||||
|
|
||||||
|
CState_Cast::CState_Cast()
|
||||||
|
:CState()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void CState_Cast::Enter()
|
||||||
|
{
|
||||||
|
if (m_pFSM->Get_PrevState() == FSMSTATE::CAST)
|
||||||
|
return;
|
||||||
|
|
||||||
|
auto anim = m_pOwner->Get_AnimInfo(FSMSTATE::CAST);
|
||||||
|
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CState_Cast::Update(_float fTimeDelta)
|
||||||
|
{
|
||||||
|
if (CheckExitState())
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CState_Cast::Exit()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
_bool CState_Cast::CheckExitState()
|
||||||
|
{
|
||||||
|
if (m_pOwner->Check(FSMSTATE::WALK))
|
||||||
|
{
|
||||||
|
m_pOwner->Reset_LightCombo();
|
||||||
|
m_pFSM->Change_State(FSMSTATE::WALK);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_pModel->IsFinishedAnim())
|
||||||
|
{
|
||||||
|
m_pOwner->Reset_LightCombo();
|
||||||
|
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_pOwner->Check(FSMSTATE::CAST))
|
||||||
|
{
|
||||||
|
_uint combo = m_pOwner->Next_LightCombo();
|
||||||
|
m_pOwner->Set_LightCombo(combo);
|
||||||
|
if (combo >= 3)
|
||||||
|
{
|
||||||
|
m_pOwner->Reset_LightCombo();
|
||||||
|
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto anim = m_pOwner->Get_AnimInfo(FSMSTATE::CAST);
|
||||||
|
m_pModel->Set_AnimationIndex(anim.first + combo, anim.second);
|
||||||
|
|
||||||
|
m_pFSM->Change_State(FSMSTATE::CAST);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CState_Cast::Free()
|
||||||
|
{
|
||||||
|
__super::Free();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CState_Cast::Describe_Entity()
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
#include "pch.h"
|
||||||
|
#include "State_Combat.h"
|
||||||
|
#include "Unit.h"
|
||||||
|
|
||||||
|
|
||||||
|
CState_Combat::CState_Combat()
|
||||||
|
:CState()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void CState_Combat::Enter()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CState_Combat::Update(_float fTimeDelta)
|
||||||
|
{
|
||||||
|
if (CheckExitState())
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CState_Combat::Exit()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
_bool CState_Combat::CheckExitState()
|
||||||
|
{
|
||||||
|
if (m_pOwner->Check(FSMSTATE::MOVE))
|
||||||
|
{
|
||||||
|
m_pFSM->Change_State(FSMSTATE::MOVE);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CState_Combat::Free()
|
||||||
|
{
|
||||||
|
__super::Free();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CState_Combat::Describe_Entity()
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -29,7 +29,7 @@ _bool CState_Dodge::CheckExitState()
|
|||||||
if (m_pModel->IsFinishedAnim())
|
if (m_pModel->IsFinishedAnim())
|
||||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||||
|
|
||||||
if (m_pOwner->IsWalking())
|
if (m_pOwner->Check(FSMSTATE::WALK) && m_pOwner->IsCurrentKeyFrame("Dodge"))
|
||||||
m_pFSM->Change_State(FSMSTATE::WALK);
|
m_pFSM->Change_State(FSMSTATE::WALK);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -25,18 +25,27 @@ void CState_Idle::Exit()
|
|||||||
|
|
||||||
_bool CState_Idle::CheckExitState()
|
_bool CState_Idle::CheckExitState()
|
||||||
{
|
{
|
||||||
if (m_pOwner->IsWalking())
|
if (m_pOwner->Check(FSMSTATE::WALK))
|
||||||
m_pFSM->Change_State(FSMSTATE::WALK);
|
m_pFSM->Change_State(FSMSTATE::WALK);
|
||||||
|
|
||||||
if (m_pOwner->IsDodge())
|
if (m_pOwner->Check(FSMSTATE::DODGE))
|
||||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||||
|
|
||||||
if (m_pOwner->IsSprint())
|
if (m_pOwner->Check(FSMSTATE::SPRINT))
|
||||||
m_pFSM->Change_State(FSMSTATE::SPRINT);
|
m_pFSM->Change_State(FSMSTATE::SPRINT);
|
||||||
|
|
||||||
if (m_pOwner->IsJump())
|
if (m_pOwner->Check(FSMSTATE::JUMP))
|
||||||
m_pFSM->Change_State(FSMSTATE::JUMP);
|
m_pFSM->Change_State(FSMSTATE::JUMP);
|
||||||
|
|
||||||
|
if (m_pOwner->Check(FSMSTATE::SKILL))
|
||||||
|
m_pFSM->Change_State(FSMSTATE::SKILL);
|
||||||
|
|
||||||
|
if (m_pOwner->Check(FSMSTATE::LIGHT_ATTACK))
|
||||||
|
m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK);
|
||||||
|
|
||||||
|
if (m_pOwner->Check(FSMSTATE::CAST))
|
||||||
|
m_pFSM->Change_State(FSMSTATE::CAST);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -26,8 +26,8 @@ void CState_Jump::Exit()
|
|||||||
|
|
||||||
_bool CState_Jump::CheckExitState()
|
_bool CState_Jump::CheckExitState()
|
||||||
{
|
{
|
||||||
if (m_pModel->IsFinishedAnim())
|
if (m_pOwner->IsCurrentKeyFrame("Jump"))
|
||||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
m_pFSM->Change_State(FSMSTATE::LAND);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,45 @@
|
|||||||
|
#include "pch.h"
|
||||||
|
#include "State_Land.h"
|
||||||
|
#include "Unit.h"
|
||||||
|
|
||||||
|
|
||||||
|
CState_Land::CState_Land()
|
||||||
|
:CState()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void CState_Land::Enter()
|
||||||
|
{
|
||||||
|
auto anim = m_pOwner->Get_AnimInfo(FSMSTATE::LAND);
|
||||||
|
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CState_Land::Update(_float fTimeDelta)
|
||||||
|
{
|
||||||
|
if (CheckExitState())
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CState_Land::Exit()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
_bool CState_Land::CheckExitState()
|
||||||
|
{
|
||||||
|
if (m_pModel->IsFinishedAnim())
|
||||||
|
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||||
|
|
||||||
|
if (m_pOwner->Check(FSMSTATE::WALK))
|
||||||
|
m_pFSM->Change_State(FSMSTATE::WALK);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CState_Land::Free()
|
||||||
|
{
|
||||||
|
__super::Free();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CState_Land::Describe_Entity()
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -0,0 +1,76 @@
|
|||||||
|
#include "pch.h"
|
||||||
|
#include "State_LightAttack.h"
|
||||||
|
#include "Unit.h"
|
||||||
|
|
||||||
|
|
||||||
|
CState_LightAttack::CState_LightAttack()
|
||||||
|
:CState()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void CState_LightAttack::Enter()
|
||||||
|
{
|
||||||
|
if (m_pFSM->Get_PrevState() == FSMSTATE::LIGHT_ATTACK)
|
||||||
|
return;
|
||||||
|
|
||||||
|
auto anim = m_pOwner->Get_AnimInfo(FSMSTATE::LIGHT_ATTACK);
|
||||||
|
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CState_LightAttack::Update(_float fTimeDelta)
|
||||||
|
{
|
||||||
|
if (CheckExitState())
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CState_LightAttack::Exit()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
_bool CState_LightAttack::CheckExitState()
|
||||||
|
{
|
||||||
|
if (m_pOwner->Check(FSMSTATE::WALK))
|
||||||
|
{
|
||||||
|
m_pOwner->Reset_LightCombo();
|
||||||
|
m_pFSM->Change_State(FSMSTATE::WALK);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
if (m_pModel->IsFinishedAnim())
|
||||||
|
{
|
||||||
|
m_pOwner->Reset_LightCombo();
|
||||||
|
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_pOwner->Check(FSMSTATE::LIGHT_ATTACK))
|
||||||
|
{
|
||||||
|
_uint combo = m_pOwner->Next_LightCombo();
|
||||||
|
m_pOwner->Set_LightCombo(combo);
|
||||||
|
if (combo >= 4)
|
||||||
|
{
|
||||||
|
m_pOwner->Reset_LightCombo();
|
||||||
|
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
auto anim = m_pOwner->Get_AnimInfo(FSMSTATE::LIGHT_ATTACK);
|
||||||
|
m_pModel->Set_AnimationIndex(anim.first + combo, anim.second);
|
||||||
|
|
||||||
|
m_pFSM->Change_State(FSMSTATE::LIGHT_ATTACK);
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CState_LightAttack::Free()
|
||||||
|
{
|
||||||
|
__super::Free();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CState_LightAttack::Describe_Entity()
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
#include "pch.h"
|
||||||
|
#include "State_Move.h"
|
||||||
|
#include "Unit.h"
|
||||||
|
|
||||||
|
|
||||||
|
CState_Move::CState_Move()
|
||||||
|
:CState()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void CState_Move::Enter()
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
void CState_Move::Update(_float fTimeDelta)
|
||||||
|
{
|
||||||
|
if (CheckExitState())
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CState_Move::Exit()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
_bool CState_Move::CheckExitState()
|
||||||
|
{
|
||||||
|
if (m_pOwner->Check(FSMSTATE::COMBAT))
|
||||||
|
{
|
||||||
|
m_pFSM->Change_State(FSMSTATE::COMBAT);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void CState_Move::Free()
|
||||||
|
{
|
||||||
|
__super::Free();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CState_Move::Describe_Entity()
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -0,0 +1,42 @@
|
|||||||
|
#include "pch.h"
|
||||||
|
#include "State_Skill.h"
|
||||||
|
#include "Unit.h"
|
||||||
|
|
||||||
|
|
||||||
|
CState_Skill::CState_Skill()
|
||||||
|
:CState()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
void CState_Skill::Enter()
|
||||||
|
{
|
||||||
|
auto anim = m_pOwner->Get_AnimInfo(FSMSTATE::SKILL);
|
||||||
|
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||||
|
}
|
||||||
|
|
||||||
|
void CState_Skill::Update(_float fTimeDelta)
|
||||||
|
{
|
||||||
|
if (CheckExitState())
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CState_Skill::Exit()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
_bool CState_Skill::CheckExitState()
|
||||||
|
{
|
||||||
|
if (m_pModel->IsFinishedAnim())
|
||||||
|
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
void CState_Skill::Free()
|
||||||
|
{
|
||||||
|
__super::Free();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CState_Skill::Describe_Entity()
|
||||||
|
{
|
||||||
|
}
|
||||||
@@ -18,13 +18,6 @@ void CState_Sprint::Update(_float fTimeDelta)
|
|||||||
if (CheckExitState())
|
if (CheckExitState())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto Transform = m_pOwner->Get_Component<CTransform>();
|
|
||||||
|
|
||||||
if (m_pGameInstance->Key_Pressing(DIK_LEFT))
|
|
||||||
Transform->Turn(-Transform->Get_State(STATE::UP), fTimeDelta);
|
|
||||||
|
|
||||||
if (m_pGameInstance->Key_Pressing(DIK_RIGHT))
|
|
||||||
Transform->Turn(Transform->Get_State(STATE::UP), fTimeDelta);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CState_Sprint::Exit()
|
void CState_Sprint::Exit()
|
||||||
@@ -33,9 +26,10 @@ void CState_Sprint::Exit()
|
|||||||
|
|
||||||
_bool CState_Sprint::CheckExitState()
|
_bool CState_Sprint::CheckExitState()
|
||||||
{
|
{
|
||||||
if (!m_pOwner->IsSprint())
|
if (!m_pOwner->Check(FSMSTATE::SPRINT))
|
||||||
m_pFSM->Change_State(FSMSTATE::WALK);
|
m_pFSM->Change_State(FSMSTATE::WALK);
|
||||||
else if (!m_pOwner->IsWalking())
|
|
||||||
|
else if (!m_pOwner->Check(FSMSTATE::WALK))
|
||||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -9,14 +9,13 @@ CState_Walk::CState_Walk()
|
|||||||
|
|
||||||
void CState_Walk::Enter()
|
void CState_Walk::Enter()
|
||||||
{
|
{
|
||||||
if (m_pGameInstance->Key_Down(DIK_UP))
|
if(m_pOwner->Check(FSMSTATE::WALK_FWD))
|
||||||
{
|
{
|
||||||
auto anim = m_pOwner->Get_AnimInfo(FSMSTATE::WALK_FWD);
|
auto anim = m_pOwner->Get_AnimInfo(FSMSTATE::WALK_FWD);
|
||||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_pGameInstance->Key_Down(DIK_DOWN))
|
if (m_pOwner->Check(FSMSTATE::WALK_BWD))
|
||||||
{
|
{
|
||||||
auto anim = m_pOwner->Get_AnimInfo(FSMSTATE::WALK_BWD);
|
auto anim = m_pOwner->Get_AnimInfo(FSMSTATE::WALK_BWD);
|
||||||
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
m_pModel->Set_AnimationIndex(anim.first, anim.second);
|
||||||
@@ -27,14 +26,6 @@ void CState_Walk::Update(_float fTimeDelta)
|
|||||||
{
|
{
|
||||||
if (CheckExitState())
|
if (CheckExitState())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
auto Transform = m_pOwner->Get_Component<CTransform>();
|
|
||||||
|
|
||||||
if (m_pGameInstance->Key_Pressing(DIK_LEFT))
|
|
||||||
Transform->Turn(-Transform->Get_State(STATE::UP), fTimeDelta);
|
|
||||||
|
|
||||||
if (m_pGameInstance->Key_Pressing(DIK_RIGHT))
|
|
||||||
Transform->Turn(Transform->Get_State(STATE::UP), fTimeDelta);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void CState_Walk::Exit()
|
void CState_Walk::Exit()
|
||||||
@@ -43,13 +34,13 @@ void CState_Walk::Exit()
|
|||||||
|
|
||||||
_bool CState_Walk::CheckExitState()
|
_bool CState_Walk::CheckExitState()
|
||||||
{
|
{
|
||||||
if (m_pOwner->IsSprint())
|
if (m_pOwner->Check(FSMSTATE::SPRINT))
|
||||||
m_pFSM->Change_State(FSMSTATE::SPRINT);
|
m_pFSM->Change_State(FSMSTATE::SPRINT);
|
||||||
|
|
||||||
else if (m_pOwner->IsDodge())
|
else if (m_pOwner->Check(FSMSTATE::DODGE))
|
||||||
m_pFSM->Change_State(FSMSTATE::DODGE);
|
m_pFSM->Change_State(FSMSTATE::DODGE);
|
||||||
|
|
||||||
else if (!m_pOwner->IsWalking())
|
else if (!m_pOwner->Check(FSMSTATE::WALK))
|
||||||
m_pFSM->Change_State(FSMSTATE::IDLE);
|
m_pFSM->Change_State(FSMSTATE::IDLE);
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -20,25 +20,17 @@ class CDummyObject final : public CUnit
|
|||||||
virtual void Late_Update(_float fTimeDelta) override;
|
virtual void Late_Update(_float fTimeDelta) override;
|
||||||
virtual HRESULT Render() override;
|
virtual HRESULT Render() override;
|
||||||
|
|
||||||
public:
|
|
||||||
virtual _bool IsWalking() override;
|
|
||||||
virtual _bool IsDodge() override;
|
|
||||||
virtual _bool IsSprint() override;
|
|
||||||
virtual _bool IsJump() override;
|
|
||||||
private:
|
private:
|
||||||
HRESULT Ready_Components();
|
HRESULT Ready_Components();
|
||||||
HRESULT Bind_ShaderResources();
|
HRESULT Bind_ShaderResources();
|
||||||
|
|
||||||
virtual void Add_FSM();
|
|
||||||
virtual void Set_Anim();
|
|
||||||
void Check_State();
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static CDummyObject* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
static CDummyObject* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||||
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override;
|
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override;
|
||||||
virtual void Free() override;
|
virtual void Free() override;
|
||||||
virtual void Describe_Entity() override;
|
virtual void Describe_Entity() override;
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_END
|
NS_END
|
||||||
|
|||||||
@@ -0,0 +1,34 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include "Editor_Define.h"
|
||||||
|
#include "Monster.h"
|
||||||
|
|
||||||
|
NS_BEGIN(Editor)
|
||||||
|
|
||||||
|
class CGoblin final : public CMonster
|
||||||
|
{
|
||||||
|
private:
|
||||||
|
CGoblin(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||||
|
CGoblin(const CGoblin& Prototype);
|
||||||
|
virtual ~CGoblin() = default;
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual HRESULT Initialize_Prototype() override;
|
||||||
|
virtual HRESULT Initialize(void* pArg) override;
|
||||||
|
virtual void Priority_Update(_float fTimeDelta) override;
|
||||||
|
virtual void Update(_float fTimeDelta) override;
|
||||||
|
virtual void Late_Update(_float fTimeDelta) override;
|
||||||
|
virtual HRESULT Render() override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
HRESULT Ready_Components();
|
||||||
|
HRESULT Bind_ShaderResources();
|
||||||
|
|
||||||
|
public:
|
||||||
|
static CGoblin* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||||
|
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override;
|
||||||
|
virtual void Free() override;
|
||||||
|
virtual void Describe_Entity() override;
|
||||||
|
};
|
||||||
|
|
||||||
|
NS_END
|
||||||
@@ -48,15 +48,14 @@ class CLevel_ObjectViewer final : public CLevel
|
|||||||
_int m_iObjectIndex = { 0 };
|
_int m_iObjectIndex = { 0 };
|
||||||
_int m_iPartsObjectIndex = { 0 };
|
_int m_iPartsObjectIndex = { 0 };
|
||||||
_float m_fKeyFrame = {};
|
_float m_fKeyFrame = {};
|
||||||
vector<_float> m_KeyFrame;
|
map<_string, _float> m_KeyFrames;
|
||||||
vector<_string> m_Events;
|
|
||||||
_string m_strEvent;
|
|
||||||
_char m_szName[MAX_PATH];
|
_char m_szName[MAX_PATH];
|
||||||
_wchar m_wszName[MAX_PATH];
|
_wchar m_wszName[MAX_PATH];
|
||||||
_wchar m_wszLayer[MAX_PATH];
|
_wchar m_wszLayer[MAX_PATH];
|
||||||
_wchar m_wszPreLayer[MAX_PATH];
|
_wchar m_wszPreLayer[MAX_PATH];
|
||||||
_char m_DummyPath[MAX_PATH];
|
_char m_DummyPath[MAX_PATH];
|
||||||
_char m_FindAnimName[256] = {};
|
_char m_FindAnimName[256] = {};
|
||||||
|
class CPlayer* m_Test = { nullptr };
|
||||||
public:
|
public:
|
||||||
static CLevel_ObjectViewer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID);
|
static CLevel_ObjectViewer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext, LEVEL eLevelID);
|
||||||
virtual void Free() override;
|
virtual void Free() override;
|
||||||
|
|||||||
@@ -1,23 +1,13 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include "Editor_Define.h"
|
#include "Editor_Define.h"
|
||||||
#include "GameObject.h"
|
#include "Unit.h"
|
||||||
|
|
||||||
NS_BEGIN(Engine)
|
|
||||||
class CShader;
|
|
||||||
class CModel;
|
|
||||||
NS_END
|
|
||||||
|
|
||||||
NS_BEGIN(Editor)
|
NS_BEGIN(Editor)
|
||||||
|
|
||||||
class CMonster final : public CGameObject
|
class CMonster abstract : public CUnit
|
||||||
{
|
{
|
||||||
public:
|
protected:
|
||||||
typedef struct tagObjectDesc
|
|
||||||
{
|
|
||||||
const _tchar* pModelPrototypeTag;
|
|
||||||
}PARTS_OBJECT_DESC;
|
|
||||||
private:
|
|
||||||
CMonster(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
CMonster(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||||
CMonster(const CMonster& Prototype);
|
CMonster(const CMonster& Prototype);
|
||||||
virtual ~CMonster() = default;
|
virtual ~CMonster() = default;
|
||||||
@@ -30,25 +20,12 @@ class CMonster final : public CGameObject
|
|||||||
virtual void Late_Update(_float fTimeDelta) override;
|
virtual void Late_Update(_float fTimeDelta) override;
|
||||||
virtual HRESULT Render() override;
|
virtual HRESULT Render() override;
|
||||||
|
|
||||||
public:
|
protected:
|
||||||
_wstring& Get_PrototypeTag() { return m_strModelPrototypeTag; }
|
HRESULT Ready_Components(void* pArg);
|
||||||
|
|
||||||
private:
|
|
||||||
CShader* m_pShaderCom = { nullptr };
|
|
||||||
CModel* m_pModelCom = { nullptr };
|
|
||||||
_wstring m_strModelPrototypeTag;
|
|
||||||
_bool m_bRimLight = { true };
|
|
||||||
_float m_fRimLightPower = { 3.2f };
|
|
||||||
_float m_fRimLightStrength = { 3.04f };
|
|
||||||
_float3 m_vRimLightColor = { 69.f / 255.f, 5.f / 255.f, 10.f / 255.f };
|
|
||||||
|
|
||||||
private:
|
|
||||||
HRESULT Ready_Components();
|
|
||||||
HRESULT Bind_ShaderResources();
|
HRESULT Bind_ShaderResources();
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static CMonster* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr)PURE;
|
||||||
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override;
|
|
||||||
virtual void Free() override;
|
virtual void Free() override;
|
||||||
virtual void Describe_Entity() override;
|
virtual void Describe_Entity() override;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -7,6 +7,13 @@ NS_BEGIN(Editor)
|
|||||||
|
|
||||||
class CPlayer final : public CUnit
|
class CPlayer final : public CUnit
|
||||||
{
|
{
|
||||||
|
public:
|
||||||
|
struct InputCondition
|
||||||
|
{
|
||||||
|
FSMSTATE::ESTATE state;
|
||||||
|
function<_bool()> checker;
|
||||||
|
};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
CPlayer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
CPlayer(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||||
CPlayer(const CPlayer& Prototype);
|
CPlayer(const CPlayer& Prototype);
|
||||||
@@ -20,25 +27,35 @@ class CPlayer final : public CUnit
|
|||||||
virtual void Late_Update(_float fTimeDelta) override;
|
virtual void Late_Update(_float fTimeDelta) override;
|
||||||
virtual HRESULT Render() override;
|
virtual HRESULT Render() override;
|
||||||
|
|
||||||
public:
|
private:
|
||||||
virtual _bool IsWalking() override;
|
vector<InputCondition> m_InputConditions;
|
||||||
virtual _bool IsDodge() override;
|
|
||||||
virtual _bool IsSprint() override;
|
|
||||||
virtual _bool IsJump() override;
|
|
||||||
private:
|
private:
|
||||||
HRESULT Ready_Components();
|
HRESULT Ready_Components();
|
||||||
HRESULT Bind_ShaderResources();
|
HRESULT Bind_ShaderResources();
|
||||||
|
void Setup_InputConditions();
|
||||||
virtual void Add_FSM();
|
void Key_Input(_float fTimeDelta);
|
||||||
virtual void Set_Anim();
|
|
||||||
void Check_State();
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static CPlayer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
static CPlayer* Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext);
|
||||||
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override;
|
virtual CGameObject* Clone(void* pArg, CGameObject* pOwner = nullptr) override;
|
||||||
virtual void Free() override;
|
virtual void Free() override;
|
||||||
virtual void Describe_Entity() override;
|
virtual void Describe_Entity() override;
|
||||||
|
|
||||||
|
#pragma region STATE
|
||||||
|
private:
|
||||||
|
virtual void Add_FSM();
|
||||||
|
virtual void Set_FSM();
|
||||||
|
virtual void Set_Anim();
|
||||||
|
_bool Check(FSMSTATE::ESTATE state);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
#pragma endregion
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
NS_END
|
NS_END
|
||||||
|
|||||||
@@ -0,0 +1,19 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "Editor_Define.h"
|
||||||
|
#include "State.h"
|
||||||
|
|
||||||
|
class CState_Cast final : public CState
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CState_Cast();
|
||||||
|
virtual ~CState_Cast() = default;
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual void Enter();
|
||||||
|
virtual void Update(_float fTimeDelta);
|
||||||
|
virtual void Exit();
|
||||||
|
virtual _bool CheckExitState();
|
||||||
|
public:
|
||||||
|
virtual void Free() override;
|
||||||
|
virtual void Describe_Entity();
|
||||||
|
};
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "Editor_Define.h"
|
||||||
|
#include "State.h"
|
||||||
|
|
||||||
|
class CState_Combat final : public CState
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CState_Combat();
|
||||||
|
virtual ~CState_Combat() = default;
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual void Enter();
|
||||||
|
virtual void Update(_float fTimeDelta);
|
||||||
|
virtual void Exit();
|
||||||
|
virtual _bool CheckExitState();
|
||||||
|
public:
|
||||||
|
virtual void Free() override;
|
||||||
|
virtual void Describe_Entity();
|
||||||
|
};
|
||||||
@@ -0,0 +1,20 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "Editor_Define.h"
|
||||||
|
#include "State.h"
|
||||||
|
|
||||||
|
class CState_Land final : public CState
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CState_Land();
|
||||||
|
virtual ~CState_Land() = default;
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual void Enter();
|
||||||
|
virtual void Update(_float fTimeDelta);
|
||||||
|
virtual void Exit();
|
||||||
|
virtual _bool CheckExitState();
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual void Free() override;
|
||||||
|
virtual void Describe_Entity();
|
||||||
|
};
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "Editor_Define.h"
|
||||||
|
#include "State.h"
|
||||||
|
|
||||||
|
class CState_LightAttack final : public CState
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CState_LightAttack();
|
||||||
|
virtual ~CState_LightAttack() = default;
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual void Enter();
|
||||||
|
virtual void Update(_float fTimeDelta);
|
||||||
|
virtual void Exit();
|
||||||
|
virtual _bool CheckExitState();
|
||||||
|
public:
|
||||||
|
virtual void Free() override;
|
||||||
|
virtual void Describe_Entity();
|
||||||
|
};
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "Editor_Define.h"
|
||||||
|
#include "State.h"
|
||||||
|
|
||||||
|
class CState_Move final : public CState
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CState_Move();
|
||||||
|
virtual ~CState_Move() = default;
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual void Enter();
|
||||||
|
virtual void Update(_float fTimeDelta);
|
||||||
|
virtual void Exit();
|
||||||
|
virtual _bool CheckExitState();
|
||||||
|
public:
|
||||||
|
virtual void Free() override;
|
||||||
|
virtual void Describe_Entity();
|
||||||
|
};
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
#pragma once
|
||||||
|
#include "Editor_Define.h"
|
||||||
|
#include "State.h"
|
||||||
|
|
||||||
|
class CState_Skill final : public CState
|
||||||
|
{
|
||||||
|
public:
|
||||||
|
CState_Skill();
|
||||||
|
virtual ~CState_Skill() = default;
|
||||||
|
|
||||||
|
public:
|
||||||
|
virtual void Enter();
|
||||||
|
virtual void Update(_float fTimeDelta);
|
||||||
|
virtual void Exit();
|
||||||
|
virtual _bool CheckExitState();
|
||||||
|
public:
|
||||||
|
virtual void Free() override;
|
||||||
|
virtual void Describe_Entity();
|
||||||
|
};
|
||||||
@@ -164,7 +164,7 @@ void CChannel::Update_TransformationMatirx(const vector<CBone*>& Bones, _float f
|
|||||||
_float dy = XMVectorGetY(vDeltaAdjusted);
|
_float dy = XMVectorGetY(vDeltaAdjusted);
|
||||||
_float dz = XMVectorGetZ(vDeltaAdjusted);
|
_float dz = XMVectorGetZ(vDeltaAdjusted);
|
||||||
|
|
||||||
_vector vDeltaWorld = vRight * dx + vUp * dz + vLook * dy;
|
_vector vDeltaWorld = vRight * dx + (-vUp * dz) + vLook * dy;
|
||||||
|
|
||||||
vDeltaWorld *= 0.01f;
|
vDeltaWorld *= 0.01f;
|
||||||
|
|
||||||
|
|||||||
@@ -27,12 +27,15 @@ HRESULT CFSM::Initialize(void* pArg)
|
|||||||
void CFSM::Add_State(_uint iIndex, CState* state)
|
void CFSM::Add_State(_uint iIndex, CState* state)
|
||||||
{
|
{
|
||||||
m_States[iIndex] = state;
|
m_States[iIndex] = state;
|
||||||
|
m_States[iIndex]->Set_State(iIndex);
|
||||||
m_States[iIndex]->Set_Owner(m_pOwner);
|
m_States[iIndex]->Set_Owner(m_pOwner);
|
||||||
m_States[iIndex]->Set_Component();
|
m_States[iIndex]->Set_Component();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CFSM::Change_State(_uint iIndex)
|
void CFSM::Change_State(_uint iIndex)
|
||||||
{
|
{
|
||||||
|
m_pPrevious = m_pCurrent;
|
||||||
|
|
||||||
if (m_pCurrent)
|
if (m_pCurrent)
|
||||||
m_pCurrent->Exit();
|
m_pCurrent->Exit();
|
||||||
|
|
||||||
@@ -44,10 +47,40 @@ void CFSM::Change_State(_uint iIndex)
|
|||||||
|
|
||||||
void CFSM::Update(_float fTimeDelta)
|
void CFSM::Update(_float fTimeDelta)
|
||||||
{
|
{
|
||||||
if (m_pCurrent)
|
vector<CState*> States;
|
||||||
m_pCurrent->Update(fTimeDelta);
|
|
||||||
|
CState* pCurrent = m_pCurrent;
|
||||||
|
|
||||||
|
while (pCurrent)
|
||||||
|
{
|
||||||
|
States.push_back(pCurrent);
|
||||||
|
pCurrent = pCurrent->Get_Parent();
|
||||||
|
}
|
||||||
|
|
||||||
|
for (_int i = (_int)States.size() - 1; i >= 0; --i) {
|
||||||
|
States[i]->Update(fTimeDelta);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
_uint CFSM::Get_CurrState()
|
||||||
|
{
|
||||||
|
return m_pCurrent->Get_State();
|
||||||
|
}
|
||||||
|
|
||||||
|
_uint CFSM::Get_PrevState()
|
||||||
|
{
|
||||||
|
return m_pPrevious->Get_State();
|
||||||
|
}
|
||||||
|
|
||||||
|
void CFSM::Set_Parent(FSMSTATE::ESTATE Child, FSMSTATE::ESTATE Parent)
|
||||||
|
{
|
||||||
|
CState* pChild = m_States[Child];
|
||||||
|
CState* pParent = m_States[Parent];
|
||||||
|
if (pChild && pParent)
|
||||||
|
pChild->Set_Parent(pParent);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
CFSM* CFSM::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
CFSM* CFSM::Create(ID3D11Device* pDevice, ID3D11DeviceContext* pContext)
|
||||||
{
|
{
|
||||||
CFSM* pInstance = new CFSM(pDevice, pContext);
|
CFSM* pInstance = new CFSM(pDevice, pContext);
|
||||||
@@ -79,6 +112,7 @@ void CFSM::Free()
|
|||||||
__super::Free();
|
__super::Free();
|
||||||
|
|
||||||
SAFE_RELEASE(m_pCurrent);
|
SAFE_RELEASE(m_pCurrent);
|
||||||
|
SAFE_RELEASE(m_pPrevious);
|
||||||
|
|
||||||
for (auto& states : m_States)
|
for (auto& states : m_States)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -164,6 +164,11 @@ void CGameInstance::BillBoard(CTransform* pTransform)
|
|||||||
|
|
||||||
_matrix BillBoardMatrix = Get_Transform_Matrix(D3DTS::VIEW_INV);
|
_matrix BillBoardMatrix = Get_Transform_Matrix(D3DTS::VIEW_INV);
|
||||||
|
|
||||||
|
for (_uint i = 0; i < 3; ++i)
|
||||||
|
{
|
||||||
|
BillBoardMatrix.r[i] = XMVector3Normalize(BillBoardMatrix.r[i]);
|
||||||
|
}
|
||||||
|
|
||||||
_float3 vScale = pTransform->Get_Scale();
|
_float3 vScale = pTransform->Get_Scale();
|
||||||
|
|
||||||
_vector vPosition = pTransform->Get_State(STATE::POSITION);
|
_vector vPosition = pTransform->Get_State(STATE::POSITION);
|
||||||
@@ -175,8 +180,6 @@ void CGameInstance::BillBoard(CTransform* pTransform)
|
|||||||
BillBoardMatrix.r[3] = vPosition;
|
BillBoardMatrix.r[3] = vPosition;
|
||||||
|
|
||||||
pTransform->Set_WorldMatrix(ScaleMatrix * RotationMatrix * BillBoardMatrix);
|
pTransform->Set_WorldMatrix(ScaleMatrix * RotationMatrix * BillBoardMatrix);
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -42,6 +42,7 @@ void CState::Free()
|
|||||||
__super::Free();
|
__super::Free();
|
||||||
|
|
||||||
SAFE_RELEASE(m_pGameInstance);
|
SAFE_RELEASE(m_pGameInstance);
|
||||||
|
SAFE_RELEASE(m_pParent);
|
||||||
}
|
}
|
||||||
|
|
||||||
void CState::Describe_Entity()
|
void CState::Describe_Entity()
|
||||||
|
|||||||
@@ -46,6 +46,68 @@ HRESULT CUnit::Render()
|
|||||||
return S_OK;
|
return S_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void CUnit::Load_KeyFrame()
|
||||||
|
{
|
||||||
|
FILE* fp = nullptr;
|
||||||
|
_string Path = {};
|
||||||
|
|
||||||
|
for (_uint i = 0; i < m_pGameInstance->BinaryModelFilePathCount(); i++)
|
||||||
|
{
|
||||||
|
const _char* szCategory = m_pGameInstance->Load_BinaryModelFilePath(i);
|
||||||
|
|
||||||
|
_char szDir[MAX_PATH] = {};
|
||||||
|
_char szName[MAX_PATH] = {};
|
||||||
|
_splitpath_s(szCategory, nullptr, 0, szDir, MAX_PATH, szName, MAX_PATH, nullptr, 0);
|
||||||
|
|
||||||
|
if (strstr(CMyTools::ToString(m_strModelPrototypeTag).c_str(), szName))
|
||||||
|
{
|
||||||
|
Path = _string(szDir) + "KeyFrame.bin";
|
||||||
|
|
||||||
|
fopen_s(&fp, Path.c_str(), "rb");
|
||||||
|
if (!fp) return;
|
||||||
|
|
||||||
|
_uint KeyFrameSize = 0;
|
||||||
|
fread(&KeyFrameSize, sizeof(_uint), 1, fp);
|
||||||
|
|
||||||
|
for (size_t i = 0; i < KeyFrameSize; i++)
|
||||||
|
{
|
||||||
|
float fKey = 0.f;
|
||||||
|
fread(&fKey, sizeof(float), 1, fp);
|
||||||
|
|
||||||
|
_uint EventLen = 0;
|
||||||
|
fread(&EventLen, sizeof(_uint), 1, fp);
|
||||||
|
|
||||||
|
_string str;
|
||||||
|
str.resize(EventLen);
|
||||||
|
|
||||||
|
fread(str.data(), sizeof(_char), EventLen, fp);
|
||||||
|
m_KeyFrames.emplace(str, fKey);
|
||||||
|
}
|
||||||
|
|
||||||
|
fclose(fp);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
_float CUnit::Get_KeyFrame(_string FrameName)
|
||||||
|
{
|
||||||
|
auto iter = m_KeyFrames.find(FrameName);
|
||||||
|
|
||||||
|
if (iter == m_KeyFrames.end())
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return iter->second;
|
||||||
|
}
|
||||||
|
|
||||||
|
_bool CUnit::IsCurrentKeyFrame(_string FrameName)
|
||||||
|
{
|
||||||
|
if (m_pModelCom->Get_CurrentTrackPosition() >= Get_KeyFrame(FrameName))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
HRESULT CUnit::Ready_Components(void *pArg)
|
HRESULT CUnit::Ready_Components(void *pArg)
|
||||||
{
|
{
|
||||||
__super::Ready_Components(pArg);
|
__super::Ready_Components(pArg);
|
||||||
|
|||||||
@@ -4,12 +4,11 @@ NS_BEGIN(FSMSTATE)
|
|||||||
enum ESTATE
|
enum ESTATE
|
||||||
{
|
{
|
||||||
IDLE,
|
IDLE,
|
||||||
WALK,WALK_FWD, WALK_BWD,
|
MOVE, WALK, WALK_FWD, WALK_BWD, JOG, SPRINT,
|
||||||
JOG,
|
|
||||||
SPRINT,
|
|
||||||
JUMP,
|
JUMP,
|
||||||
|
LAND,
|
||||||
DODGE,
|
DODGE,
|
||||||
ATTACK,
|
COMBAT, LIGHT_ATTACK, CAST, SKILL,
|
||||||
END
|
END
|
||||||
};
|
};
|
||||||
NS_END
|
NS_END
|
||||||
@@ -31,9 +30,13 @@ class ENGINE_DLL CFSM final : public CComponent
|
|||||||
void Change_State(_uint iIndex);
|
void Change_State(_uint iIndex);
|
||||||
void Update(_float fTimeDelta);
|
void Update(_float fTimeDelta);
|
||||||
|
|
||||||
|
_uint Get_CurrState();
|
||||||
|
_uint Get_PrevState();
|
||||||
|
void Set_Parent(FSMSTATE::ESTATE Child, FSMSTATE::ESTATE Parent);
|
||||||
private:
|
private:
|
||||||
vector<CState*> m_States;
|
vector<CState*> m_States;
|
||||||
CState* m_pCurrent = { nullptr };
|
CState* m_pCurrent = { nullptr };
|
||||||
|
CState* m_pPrevious = { nullptr };
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual HRESULT Initialize_Prototype() override;
|
virtual HRESULT Initialize_Prototype() override;
|
||||||
|
|||||||
@@ -20,11 +20,20 @@ class ENGINE_DLL CState abstract : public CBase
|
|||||||
void Set_Owner(class CGameObject* pOwner);
|
void Set_Owner(class CGameObject* pOwner);
|
||||||
virtual void Set_Component();
|
virtual void Set_Component();
|
||||||
|
|
||||||
|
void Set_State(_uint State) { m_eState = State; }
|
||||||
|
_uint Get_State() { return m_eState; }
|
||||||
|
void Set_Parent(CState* State) { m_pParent = State; }
|
||||||
|
CState* Get_Parent() { return m_pParent; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
CUnit* m_pOwner = { nullptr };
|
CUnit* m_pOwner = { nullptr };
|
||||||
CModel* m_pModel = { nullptr };
|
CModel* m_pModel = { nullptr };
|
||||||
CFSM* m_pFSM = { nullptr };
|
CFSM* m_pFSM = { nullptr };
|
||||||
|
CState* m_pParent = { nullptr };
|
||||||
CGameInstance* m_pGameInstance = { nullptr };
|
CGameInstance* m_pGameInstance = { nullptr };
|
||||||
|
_uint m_eState = {};
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
virtual void Free() override;
|
virtual void Free() override;
|
||||||
|
|||||||
@@ -28,29 +28,38 @@ class ENGINE_DLL CUnit abstract : public CGameObject
|
|||||||
virtual void Late_Update(_float fTimeDelta) override;
|
virtual void Late_Update(_float fTimeDelta) override;
|
||||||
virtual HRESULT Render() override;
|
virtual HRESULT Render() override;
|
||||||
_wstring& Get_PrototypeTag() { return m_strModelPrototypeTag; }
|
_wstring& Get_PrototypeTag() { return m_strModelPrototypeTag; }
|
||||||
|
void Load_KeyFrame();
|
||||||
public:
|
public:
|
||||||
|
#pragma region STATE
|
||||||
pair<_uint, _bool> Get_AnimInfo(_uint iIndex) { return m_Animation[iIndex]; }
|
pair<_uint, _bool> Get_AnimInfo(_uint iIndex) { return m_Animation[iIndex]; }
|
||||||
|
virtual _bool Check(FSMSTATE::ESTATE state) { return false; }
|
||||||
|
|
||||||
virtual _bool IsWalking() { return false; }
|
void Reset_LightCombo() { m_iLightCombo = 0; }
|
||||||
virtual _bool IsDodge() { return false; }
|
_uint Next_LightCombo() { return ++m_iLightCombo; }
|
||||||
virtual _bool IsSprint() { return false; }
|
void Set_LightCombo(_uint LightCombo) { m_iLightCombo = LightCombo; }
|
||||||
virtual _bool IsJump() { return false; }
|
_float Get_KeyFrame(_string FrameName);
|
||||||
|
_bool IsCurrentKeyFrame(_string FrameName);
|
||||||
|
#pragma endregion
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
CShader* m_pShaderCom = { nullptr };
|
CShader* m_pShaderCom = { nullptr };
|
||||||
CModel* m_pModelCom = { nullptr };
|
CModel* m_pModelCom = { nullptr };
|
||||||
CFSM* m_pFSM = { nullptr };
|
CFSM* m_pFSM = { nullptr };
|
||||||
_wstring m_strModelPrototypeTag;
|
_wstring m_strModelPrototypeTag;
|
||||||
_bool m_bRimLight = { true };
|
_bool m_bRimLight = { true };
|
||||||
_float m_fRimLightPower = { 3.2f };
|
_float m_fRimLightPower = { 3.2f };
|
||||||
_float m_fRimLightStrength = { 3.04f };
|
_float m_fRimLightStrength = { 3.04f };
|
||||||
_float3 m_vRimLightColor = { 69.f / 255.f, 5.f / 255.f, 10.f / 255.f };
|
_float3 m_vRimLightColor = { 69.f / 255.f, 5.f / 255.f, 10.f / 255.f };
|
||||||
|
_uint m_iLightCombo = { 0 };
|
||||||
|
|
||||||
|
map<_string, _float> m_KeyFrames;
|
||||||
|
|
||||||
|
vector<pair<_uint, _bool>> m_Animation;
|
||||||
|
|
||||||
vector<pair<_uint,_bool>> m_Animation;
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
virtual void Add_FSM() {};
|
virtual void Add_FSM() {};
|
||||||
|
virtual void Set_FSM() {};
|
||||||
virtual void Set_Anim() {};
|
virtual void Set_Anim() {};
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|||||||
Reference in New Issue
Block a user