I am wondering whether it is expected behaviour, that material instance that has been set as an override, does not visually update on the skeleton despite the material instance being updated.
I would assume that if I modify the tintMaterialInstance that the modifications should be visible on the SkeletonRenderer, however they are not
private void FixedUpdate(){
if( tintMaterialInstance == null )
{
tintShader = Shader.Find( "Spine/Skeleton Tint" );
originalMaterial = spineCreature.SkeletonDataAsset.atlasAssets[0].PrimaryMaterial;
tintMaterialInstance = Instantiate( originalMaterial );
tintMaterialInstance.shader = tintShader;
spineCreature.CustomMaterialOverride[originalMaterial] = tintMaterialInstance;
}
tintMaterialInstance.SetColor( "_Black", Color.Lerp( Color.black, Color.white, percent ) );
}
if( tintMaterialInstance == null )
{
tintShader = Shader.Find( "Spine/Skeleton Tint" );
originalMaterial = spineCreature.SkeletonDataAsset.atlasAssets[0].PrimaryMaterial;
tintMaterialInstance = Instantiate( originalMaterial );
tintMaterialInstance.shader = tintShader;
spineCreature.CustomMaterialOverride[originalMaterial] = tintMaterialInstance;
}
tintMaterialInstance.SetColor( "_Black", Color.Lerp( Color.black, Color.white, percent ) );
}