3.0.0-preview.21

# [3.0.0-preview.21](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v3.0.0-preview.20...v3.0.0-preview.21) (2020-08-28)

### Bug Fixes

* if in the mask, rendering material will be destroyed ([0db40cf](0db40cf160))
* support animatable material property (again) ([cf6ca80](cf6ca80d12))
This commit is contained in:
semantic-release-bot
2020-08-28 18:55:46 +00:00
parent ab27f0af6f
commit 46ec957a52
5 changed files with 62 additions and 8 deletions

View File

@@ -26,20 +26,30 @@ namespace Coffee.UIExtensions
public void UpdateMaterialProperties(Material material, MaterialPropertyBlock mpb)
{
if (!material.HasProperty(id)) return;
switch (type)
{
case ShaderPropertyType.Color:
material.SetColor(id, mpb.GetColor(id));
var color = mpb.GetColor(id);
if (color != default(Color))
material.SetColor(id, color);
break;
case ShaderPropertyType.Vector:
material.SetVector(id, mpb.GetVector(id));
var vector = mpb.GetVector(id);
if (vector != default(Vector4))
material.SetVector(id, vector);
break;
case ShaderPropertyType.Float:
case ShaderPropertyType.Range:
material.SetFloat(id, mpb.GetFloat(id));
var value = mpb.GetFloat(id);
if (value != default(float))
material.SetFloat(id, value);
break;
case ShaderPropertyType.Texture:
material.SetTexture(id, mpb.GetTexture(id));
var tex = mpb.GetTexture(id);
if (tex != default(Texture))
material.SetTexture(id, tex);
break;
}
}