-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnimator.h
More file actions
40 lines (37 loc) · 1.04 KB
/
Animator.h
File metadata and controls
40 lines (37 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#pragma once
#include "GameObject.h"
#include "AnimationClip.h"
#include <map>
//트랜잭션을 추가할 수 있고
//트랜잭션이 동작할 조건을 추가한다
typedef struct tagTransaction {
bool isReset; //프레임을 0부터 시작할건지
}Transaction;
class Animator :
public Component
{
private:
typedef struct tagTransaction {
AnimationClip* startClip;
AnimationClip* nextClip;
}TRANSACTION;
private:
float frameTime;
public:
Animator();
~Animator();
Renderer* renderer;
AnimationClip* curClip;
AnimationClip* preClip;
map<string, AnimationClip*> clipMap;
map<string, TRANSACTION> transactionMap;
map<string, TRANSACTION>::iterator transactionIter;
void Init();
void Update();
void Render();
void SetClip(AnimationClip* newClip);
void SetClip(AnimationClip* newClip, int startFrame);
void AddClip(string clipName, AnimationClip* newClip);
AnimationClip* GetClip(string clipName);
void AddTransaction(string name, AnimationClip* startClip, AnimationClip* nextClip);
};