-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathAnimationState.h
More file actions
69 lines (62 loc) · 1.87 KB
/
Copy pathAnimationState.h
File metadata and controls
69 lines (62 loc) · 1.87 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#pragma once
#include "Reflection.hpp" // CT3: was transitive via Core.Minimal.h
#include "../Utility_Framework/Core.Minimal.h"
#include "AniTransition.h"
#include "AniBehavior.h"
#include <nlohmann/json.hpp>
class AnimationController;
class AnimationState
{
public:
static consteval auto reflect()
{
using Self = AnimationState;
return meta::schema<Self>(
meta::field<&Self::m_name>,
meta::field<&Self::behaviourName>,
meta::field<&Self::Transitions>,
meta::field<&Self::index>,
meta::field<&Self::AnimationIndex>,
meta::field<&Self::animationSpeed>,
meta::field<&Self::multiplerAnimationSpeed>,
meta::field<&Self::animationSpeedParameterName>,
meta::field<&Self::m_isAny>,
meta::field<&Self::useMultipler>);
}
public:
AnimationState();
~AnimationState();
AnimationState(AnimationController* Owner, std::string name);
std::vector<AniTransition*> FindTransitions(const std::string& toStateName);
void ClearBehaviour()
{
ResetBehaviour();
behaviourName.clear();
}
void ResetBehaviour()
{
behaviour.reset();
behaviour = nullptr;
}
void SetBehaviour(std::string name, bool isReload = false);
void UpdateAnimationSpeed();
nlohmann::json Serialize();
AnimationState Deserialize();
public:
std::string m_name{};
std::string behaviourName{};
std::shared_ptr<AniBehavior> behaviour{};
AnimationController* m_ownerController{};
std::vector<std::shared_ptr<AniTransition>> Transitions;
int index =0;
int AnimationIndex = 0;
//기본속도
float animationSpeed = 1;
//파라미터로 더 곱해줄 속도 이동속도 비례,공격속도비례
float multiplerAnimationSpeed = 1;
std::string animationSpeedParameterName = "None";
//상태의 애니메이션 시간 상하체 분리후 합칠쓸용
float m_animationTimeElapsed = 0;
bool m_isAny = false;
bool useMultipler = false;
};