#include <Block/SpriteBlock/BasicBlock/BasicBlock.hpp>
#include <Block/SpriteBlock/BasicBlock/UniformBlock/UniformBlock.hpp>

UniformBlock::UniformBlock(std::string name, std::string displayName, float hardness, std::string materialName) :
    BasicBlock(name, displayName, hardness, materialName),
    materialName(materialName)
{
    withFallbackScript("uniformBlock.lua");
}

void UniformBlock::onDesignerInitializing(BlockSpriteDesigner &designer, ScriptEngine &engine)
{
    BasicBlock::onDesignerInitializing(designer, engine);

    engine.push(materialName);
    engine.setGlobal("UNIFORM_MATERIAL_NAME");
}