Example character level animations.

This commit is contained in:
2023-01-18 23:53:39 -08:00
parent 602151d567
commit 2b1b258065
29 changed files with 388 additions and 44 deletions

View File

@ -17,6 +17,7 @@ namespace Dawn {
public:
VisualNovelCharacter *vnCharacter;
SimpleTexturedShaderInterface *shaderInterface;
AnimationController *animation;
static std::vector<Asset*> prefabAssets(AssetManager *assMan) {
return std::vector<Asset*>{
@ -25,7 +26,10 @@ namespace Dawn {
};
}
DeathPrefab(Scene *scene, sceneitemid_t id) : SceneItemPrefab(scene, id){}
DeathPrefab(Scene *scene, sceneitemid_t id) : SceneItemPrefab(scene, id)
{
}
void prefabInit(AssetManager *man) override {
auto textureAsset = man->get<TextureAsset>("texture_death");
@ -34,17 +38,18 @@ namespace Dawn {
auto meshRenderer = this->addComponent<MeshRenderer>();
auto material = this->addComponent<Material>();
auto meshHost = this->addComponent<MeshHost>();
auto animation = this->addComponent<AnimationController>();
auto tiledSprite = this->addComponent<TiledSprite>();
tiledSprite->setTilesetAndSize(&tilesetAsset->tileset);
tiledSprite->setTile(0);
vnCharacter = this->addComponent<VisualNovelCharacter>();
vnCharacter->nameKey = "character.death.name";
shaderInterface = this->addComponent<SimpleTexturedShaderInterface>();
shaderInterface->setTexture(&textureAsset->texture);
vnCharacter = this->addComponent<VisualNovelCharacter>();
vnCharacter->nameKey = "character.death.name";
animation = this->addComponent<AnimationController>();
auto tiledSprite = this->addComponent<TiledSprite>();
tiledSprite->setTilesetAndSize(&tilesetAsset->tileset);
tiledSprite->setTile(0);
this->transform.setLocalPosition(glm::vec3(0, 0, 0));
}