Added SharedMaterial for Renderable #357
|
@ -47,11 +47,16 @@ namespace SHADE
|
|||
}
|
||||
}
|
||||
SHADE::Material Renderable::Material::get()
|
||||
{
|
||||
auto mat = GetNativeComponent()->GetModifiableMaterial();
|
||||
return mat ? SHADE::Material(mat) : SHADE::Material();
|
||||
}
|
||||
SHADE::Material Renderable::SharedMaterial::get()
|
||||
{
|
||||
auto mat = GetNativeComponent()->GetMaterial();
|
||||
return mat ? SHADE::Material(mat) : SHADE::Material();
|
||||
}
|
||||
void Renderable::Material::set(SHADE::Material value)
|
||||
void Renderable::SharedMaterial::set(SHADE::Material value)
|
||||
{
|
||||
if (value)
|
||||
{
|
||||
|
|
|
@ -55,9 +55,19 @@ namespace SHADE
|
|||
void set(MeshAsset value);
|
||||
}
|
||||
/// <summary>
|
||||
/// Material used to render this Renderable.
|
||||
/// Special instance of the shared Material for this Renderable. When accessing
|
||||
/// this property, a new instance of the shared Material is created and assigned
|
||||
/// to this Renderable. Hence, changes will only affect this Renderable.
|
||||
/// </summary>
|
||||
property SHADE::Material Material
|
||||
{
|
||||
SHADE::Material get();
|
||||
}
|
||||
/// <summary>
|
||||
/// The shared Material used to render this Renderable and other Renderables
|
||||
/// using the same base Material.
|
||||
/// </summary>
|
||||
property SHADE::Material SharedMaterial
|
||||
{
|
||||
SHADE::Material get();
|
||||
void set(SHADE::Material value);
|
||||
|
|
Loading…
Reference in New Issue