建档
This commit is contained in:
50
source_game/Asset/Character/Chr_Animation.h
Normal file
50
source_game/Asset/Character/Chr_Animation.h
Normal file
@@ -0,0 +1,50 @@
|
||||
#pragma once
|
||||
#include "EngineFrame/Component/Animation.h"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
class CharacterObject;
|
||||
class Chr_Animation : public RenderBase
|
||||
{
|
||||
// 动作动画集合
|
||||
using ActionAniList = std::map<std::string, std::vector<RefPtr<Animation>>>;
|
||||
|
||||
public:
|
||||
inline static const std::unordered_map<std::string, std::string>
|
||||
AvatarPart = {
|
||||
{"weapon_avatar", "武器装扮"},
|
||||
{"aurora_avatar", "光环装扮"},
|
||||
{"hair_avatar", "头部装扮"},
|
||||
{"hat_avatar", "帽子装扮"},
|
||||
{"face_avatar", "脸部装扮"},
|
||||
{"breast_avatar", "胸部装扮"},
|
||||
{"coat_avatar", "上衣装扮"},
|
||||
{"skin_avatar", "皮肤装扮"},
|
||||
{"waist_avatar", "腰部装扮"},
|
||||
{"pants_avatar", "下装装扮"},
|
||||
{"shoes_avatar", "鞋子装扮"},
|
||||
{"weapon", "武器"},
|
||||
};
|
||||
|
||||
private:
|
||||
// 父对象
|
||||
CharacterObject *chr_parent;
|
||||
// 时装部位对应的动作动画集合
|
||||
ActionAniList ActionAnis;
|
||||
// 当前动作Tag
|
||||
std::string CurrentActionTag = "waiting";
|
||||
|
||||
public:
|
||||
static std::string FormatImgPath(std::string path, Animation::ReplaceData data);
|
||||
|
||||
public:
|
||||
void CreateSkinmationBySlot(std::string actionName, std::string slotName, std::string path);
|
||||
|
||||
public:
|
||||
// 初始化时 只完成基础的职业皮肤设置
|
||||
void Init(CharacterObject *parent);
|
||||
// 设置动作
|
||||
void SetAction(std::string actionName);
|
||||
|
||||
void Update(float deltaTime) override;
|
||||
};
|
||||
Reference in New Issue
Block a user