์์ :)
https://github.com/eazuooz/YamYamEngine/commit/9dcd7d665c14f92fad3f35e3beb488681e774f09
Animation Event system · eazuooz/YamYamEngine@9dcd7d6
Show file tree Showing 7 changed files with 65 additions and 18 deletions.
github.com
Event๋ ๊ฐ๊ฐ์ ์ ๋๋ฉ์ด์ ์ด ์ฒ์ ์ฌ์๋ ๋ StartEvent
ํ๋์ ์ ๋๋ฉ์ด์ ๋์์ด ์๋ฃ๋ ๋ CompleteEvent
์ ๋๋ฉ์ด์ ์ด ์ ํ๋๋ฉด์ ๋๋ ๋ EndEventํจ์๋ฅผ ํธ์ถ๋๊ฒ ๋์ด์๋ค.
๊ทธ๋์ ๋ค์๊ณผ ๊ฐ์ด Event์ ์๋ง๋ ๋ฉค๋ฒํจ์๋ฅผ bind์์ผ์ฃผ์ด์ผ ์ ๋๋ก ๋์ํ๊ฒ ๋๋ค.
Image* pImage
= Resources::Load<Image>(L"PlayerImage", L"..\\Resources\\Images\\link.bmp");
Animator* animator = GetComponent<Animator>();
animator->CreateAnimaiton(L"Walk_Up", pImage, Vector2(0.f, 780.f), Vector2(120.f, 130.f), Vector2(0.f, -30.f), 120.f, 10, 0.1f);
animator->CreateAnimaiton(L"Walk_Down", pImage, Vector2(0.f, 520.f), Vector2(120.f, 130.f), Vector2(0.f, -30.f), 120.f, 10, 0.1f);
animator->CreateAnimaiton(L"Walk_Left", pImage, Vector2(0.f, 650.f), Vector2(120.f, 130.f), Vector2(0.f, -30.f), 120.f, 10, 0.1f);
animator->CreateAnimaiton(L"Walk_Right", pImage, Vector2(0.f, 910.f), Vector2(120.f, 130.f), Vector2(0.f, -30.f), 120.f, 10, 0.1f);
animator->mStartEvent = std::bind(&Player::AnimationStart, this);
animator->mCompleteEvent = std::bind(&Player::AnimationComplete, this);
animator->mEndEvent = std::bind(&Player::AnimationEnd, this);
animator->Play(L"Walk_Down", true);
ํด๋น Event๋ค์ ์ฌ๋ฌ๋ถ๋ค์ ํธ๋ฆฌ์ฑ์ ์ํด ์ ๊ณตํ๊ฒ์ด๋ค.
๊ฐ๊ฐ์ Event๊ฐ ํธ์ถ๋๋ ์์๋ ๋ค์๊ณผ ๊ฐ์ด ํธ์ถ๋๋ค๊ณ ๋ณด๋ฉด ๋๋ค.
'๐ Development Study > ๐ผ GameProgramming 2D' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
Compute Shader (0) | 2023.04.08 |
---|---|
2D Light (0) | 2023.04.08 |
Animator, Animation2D (0) | 2023.03.02 |
Collision check / OBB (0) | 2023.03.02 |
Grid ์ค๋ธ์ ํธ (0) | 2023.03.02 |
๋๊ธ