3.0.0-preview.32
# [3.0.0-preview.32](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v3.0.0-preview.31...v3.0.0-preview.32) (2020-09-14)
### Bug Fixes
* animatable properties not working ([5b8b0bd](5b8b0bd28b
)), closes [#95](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/95)
pull/120/head
parent
6f3f4803da
commit
64787261df
|
@ -1,3 +1,10 @@
|
|||
# [3.0.0-preview.32](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v3.0.0-preview.31...v3.0.0-preview.32) (2020-09-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* animatable properties not working ([5b8b0bd](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/5b8b0bd28b251a7ea6e0cfa0c4b69bd7f9c4d953)), closes [#95](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/95)
|
||||
|
||||
# [3.0.0-preview.31](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v3.0.0-preview.30...v3.0.0-preview.31) (2020-09-02)
|
||||
|
||||
|
||||
|
|
|
@ -86,8 +86,9 @@ namespace Coffee.UIExtensions
|
|||
? camera.transform.rotation
|
||||
: s_OrthoRotation;
|
||||
|
||||
transform.SetPositionAndRotation(canvas.transform.position + s_OrthoPosition, rotation);
|
||||
transform.SetPositionAndRotation(s_OrthoPosition, rotation);
|
||||
Instance._camera.orthographic = true;
|
||||
Instance._camera.farClipPlane = 2000f;
|
||||
|
||||
return Instance._camera;
|
||||
}
|
||||
|
|
|
@ -272,6 +272,33 @@ namespace Coffee.UIExtensions
|
|||
return baseMaterial;
|
||||
}
|
||||
|
||||
internal void UpdateMaterialProperties()
|
||||
{
|
||||
if (m_AnimatableProperties.Length == 0) return;
|
||||
|
||||
//
|
||||
var materialCount = Mathf.Max(8, activeMeshIndices.BitCount());
|
||||
canvasRenderer.materialCount = materialCount;
|
||||
var j = 0;
|
||||
for (var i = 0; i < particles.Count; i++)
|
||||
{
|
||||
if (materialCount <= j) break;
|
||||
var ps = particles[i];
|
||||
if (!ps) continue;
|
||||
|
||||
var r = ps.GetComponent<ParticleSystemRenderer>();
|
||||
r.GetSharedMaterials(s_TempMaterials);
|
||||
|
||||
// Main
|
||||
var bit = (long) 1 << (i * 2);
|
||||
if (0 < (activeMeshIndices & bit) && 0 < s_TempMaterials.Count)
|
||||
{
|
||||
UpdateMaterialProperties(r, j);
|
||||
j++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
internal void UpdateMaterialProperties(Renderer r, int index)
|
||||
{
|
||||
if (m_AnimatableProperties.Length == 0 || canvasRenderer.materialCount <= index) return;
|
||||
|
|
|
@ -79,7 +79,7 @@ namespace Coffee.UIExtensions
|
|||
Profiler.EndSample();
|
||||
|
||||
Profiler.BeginSample("[UIParticle] Update Animatable Material Properties");
|
||||
// UpdateAnimatableMaterialProperties(particle);
|
||||
particle.UpdateMaterialProperties();
|
||||
Profiler.EndSample();
|
||||
}
|
||||
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
"name": "com.coffee.ui-particle",
|
||||
"displayName": "UI Particle",
|
||||
"description": "This plugin provide a component to render particle effect for uGUI.\nThe particle rendering is maskable and sortable, without Camera, RenderTexture or Canvas.",
|
||||
"version": "3.0.0-preview.31",
|
||||
"version": "3.0.0-preview.32",
|
||||
"unity": "2018.2",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
|
Loading…
Reference in New Issue