Added Changing of textures for buttons. Change button events to be on release #311
|
@ -232,7 +232,7 @@ namespace SHADE
|
|||
if (SHComponentManager::HasComponent<SHRenderable>(comp.GetEID()))
|
||||
{
|
||||
auto renderable = SHComponentManager::GetComponent_s<SHRenderable>(comp.GetEID());
|
||||
auto texture = SHResourceManager::Get<SHTexture>(comp.GetDefaultTexture());
|
||||
//auto texture = SHResourceManager::Get<SHTexture>(comp.GetDefaultTexture());
|
||||
|
||||
auto material = renderable->GetModifiableMaterial();
|
||||
if(!comp.isHovered && !comp.isClicked)
|
||||
|
@ -240,9 +240,16 @@ namespace SHADE
|
|||
{
|
||||
material->SetProperty("data.textureIndex", comp.GetDefaultTexture());
|
||||
//SHLOG_INFO("SETTING DEFAULT TEXTURE")
|
||||
}
|
||||
else if (comp.isClicked)
|
||||
{
|
||||
if (SHAssetManager::GetType(comp.GetClickedTexture()) == AssetType::TEXTURE)
|
||||
{
|
||||
material->SetProperty("data.textureIndex", comp.GetClickedTexture());
|
||||
//SHLOG_INFO("SETTING CLICKED TEXTURE")
|
||||
}
|
||||
}
|
||||
|
||||
if (comp.isHovered)
|
||||
else
|
||||
{
|
||||
if (SHAssetManager::GetType(comp.GetHoveredTexture()) == AssetType::TEXTURE)
|
||||
{
|
||||
|
@ -250,14 +257,6 @@ namespace SHADE
|
|||
//SHLOG_INFO("SETTING HOVERED TEXTURE")
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (SHAssetManager::GetType(comp.GetClickedTexture()) == AssetType::TEXTURE)
|
||||
{
|
||||
material->SetProperty("data.textureIndex", comp.GetClickedTexture());
|
||||
SHLOG_INFO("SETTING CLICKED TEXTURE")
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@ -353,7 +352,7 @@ namespace SHADE
|
|||
if (SHComponentManager::HasComponent<SHRenderable>(comp.GetEID()))
|
||||
{
|
||||
auto renderable = SHComponentManager::GetComponent_s<SHRenderable>(comp.GetEID());
|
||||
auto texture = SHResourceManager::Get<SHTexture>(comp.GetDefaultTexture());
|
||||
//auto texture = SHResourceManager::Get<SHTexture>(comp.GetDefaultTexture());
|
||||
|
||||
auto material = renderable->GetModifiableMaterial();
|
||||
if (comp.GetValue() == false)
|
||||
|
|
Loading…
Reference in New Issue