The fruits of my labor
This commit is contained in:
@ -10,13 +10,12 @@
|
||||
#include "scene/components/Components.hpp"
|
||||
#include "visualnovel/components/VisualNovelCharacter.hpp"
|
||||
#include "display/animation/TiledSpriteAnimation.hpp"
|
||||
#include "scene/components/display/shader/SimpleTexturedShaderInterface.hpp"
|
||||
#include "scene/components/display/material/SimpleTexturedMaterial.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class DeathPrefab : public SceneItemPrefab<DeathPrefab> {
|
||||
public:
|
||||
VisualNovelCharacter *vnCharacter;
|
||||
SimpleTexturedShaderInterface *shaderInterface;
|
||||
AnimationController *animation;
|
||||
|
||||
static std::vector<Asset*> prefabAssets(AssetManager *assMan) {
|
||||
@ -36,11 +35,10 @@ namespace Dawn {
|
||||
auto tilesetAsset = man->get<TilesetAsset>("tileset_death");
|
||||
|
||||
auto meshRenderer = this->addComponent<MeshRenderer>();
|
||||
auto material = this->addComponent<Material>();
|
||||
auto meshHost = this->addComponent<MeshHost>();
|
||||
|
||||
shaderInterface = this->addComponent<SimpleTexturedShaderInterface>();
|
||||
shaderInterface->setTexture(&textureAsset->texture);
|
||||
auto material = this->addComponent<SimpleTexturedMaterial>();
|
||||
material->texture = &textureAsset->texture;
|
||||
|
||||
vnCharacter = this->addComponent<VisualNovelCharacter>();
|
||||
vnCharacter->nameKey = "character.death.name";
|
||||
|
@ -10,40 +10,45 @@
|
||||
#include "scene/components/Components.hpp"
|
||||
#include "visualnovel/components/VisualNovelCharacter.hpp"
|
||||
#include "display/animation/TiledSpriteAnimation.hpp"
|
||||
#include "scene/components/display/material/SimpleTexturedMaterial.hpp"
|
||||
|
||||
namespace Dawn {
|
||||
class PennyPrefab : public SceneItemPrefab<PennyPrefab> {
|
||||
public:
|
||||
VisualNovelCharacter *vnCharacter;
|
||||
PokerPlayer *pokerPlayer;
|
||||
SimpleTexturedMaterial *material;
|
||||
|
||||
static std::vector<Asset*> prefabAssets(AssetManager *assMan) {
|
||||
return std::vector<Asset*>{
|
||||
assMan->get<TextureAsset>("texture_penny"),
|
||||
assMan->get<TilesetAsset>("tileset_penny")
|
||||
assMan->get<TextureAsset>("texture_death"),
|
||||
assMan->get<TilesetAsset>("tileset_death")
|
||||
};
|
||||
}
|
||||
|
||||
PennyPrefab(Scene *scene, sceneitemid_t id) : SceneItemPrefab(scene, id){}
|
||||
|
||||
void prefabInit(AssetManager *man) override {
|
||||
auto textureAsset = man->get<TextureAsset>("texture_penny");
|
||||
auto tilesetAsset = man->get<TilesetAsset>("tileset_penny");
|
||||
auto textureAsset = man->get<TextureAsset>("texture_death");
|
||||
auto tilesetAsset = man->get<TilesetAsset>("tileset_death");
|
||||
|
||||
auto meshRenderer = this->addComponent<MeshRenderer>();
|
||||
auto material = this->addComponent<Material>();
|
||||
auto meshHost = this->addComponent<MeshHost>();
|
||||
auto tiledSprite = this->addComponent<TiledSprite>();
|
||||
auto animation = this->addComponent<AnimationController>();
|
||||
auto pokerPlayer = this->addComponent<PokerPlayer>();
|
||||
vnCharacter = this->addComponent<VisualNovelCharacter>();
|
||||
|
||||
vnCharacter->nameKey = "character.penny.name";
|
||||
|
||||
auto param = material->getShader()->getParameterByName("u_Text");
|
||||
material->textureValues[param] = &textureAsset->texture;
|
||||
material = this->addComponent<SimpleTexturedMaterial>();
|
||||
material->texture = &textureAsset->texture;
|
||||
|
||||
auto animation = this->addComponent<AnimationController>();
|
||||
|
||||
pokerPlayer = this->addComponent<PokerPlayer>();
|
||||
|
||||
vnCharacter = this->addComponent<VisualNovelCharacter>();
|
||||
vnCharacter->nameKey = "character.penny.name";
|
||||
|
||||
auto tiledSprite = this->addComponent<TiledSprite>();
|
||||
tiledSprite->setTilesetAndSize(&tilesetAsset->tileset);
|
||||
tiledSprite->setTile(0);
|
||||
|
||||
this->transform.setLocalPosition(glm::vec3(0, 0, 0));
|
||||
|
||||
// auto anim = new TiledSpriteAnimation(tiledSprite);
|
||||
|
Reference in New Issue
Block a user