You've already forked ParticleEffectForUGUI
mirror of
https://github.com/mob-sakai/ParticleEffectForUGUI.git
synced 2026-05-15 04:30:09 +00:00
Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6884c62687 | ||
|
|
fc4bd708fd | ||
|
|
08273cb0c3 | ||
|
|
06d8fae58f | ||
|
|
22bcecd0ab | ||
|
|
68669c7396 | ||
|
|
1b1ca56461 |
15
CHANGELOG.md
15
CHANGELOG.md
@@ -1,3 +1,18 @@
|
||||
# [3.2.0](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/3.1.1...3.2.0) (2020-11-15)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* compatibility with other IMaterialModifier ([08273cb](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/08273cb0c340ccb4f35120dc804c37d758da9ce1)), closes [#115](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/115)
|
||||
|
||||
## [3.1.1](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/3.1.0...3.1.1) (2020-11-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* error on build in Unity 2019.3.11-15 ([68669c7](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/68669c739676f2354db4913a0e2296ab1715ee1f)), closes [#114](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/114)
|
||||
* null Reference when creating New Scene after Prefab was open in PrefabMode ([22bcecd](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/22bcecd0abd6ad651fcf066e5c9efe9a43fd217a)), closes [#111](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/111)
|
||||
|
||||
# [3.1.0](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/3.0.1...3.1.0) (2020-10-28)
|
||||
|
||||
|
||||
|
||||
@@ -60,7 +60,7 @@ Compares this "Baking mesh" approach with the conventional approach:
|
||||
|
||||
## Demo
|
||||
|
||||
* [WebGL Demo](http://mob-sakai.github.io/ParticleEffectForUGUI)
|
||||
* [WebGL Demo](https://mob-sakai.github.io/Demos/ParticleEffectForUGUI)
|
||||
* [WebGL Demo (Cartoon FX & War FX)](https://mob-sakai.github.io/Demos/ParticleEffectForUGUI_CFX)
|
||||
* [Cartoon FX Free][CFX] & [War FX][WFX] (by [Jean Moreno (JMO)][JMO]) with UIParticle
|
||||
|
||||
|
||||
@@ -89,11 +89,11 @@ namespace Coffee.UIExtensions
|
||||
{
|
||||
EditorGUI.LabelField(new Rect(rect.x, rect.y, 150, rect.height), s_ContentRenderingOrder);
|
||||
|
||||
#if UNITY_2019_3_OR_NEWER
|
||||
#if UNITY_2019_3_OR_NEWER
|
||||
rect = new Rect(rect.width - 55, rect.y, 80, rect.height);
|
||||
#else
|
||||
#else
|
||||
rect = new Rect(rect.width - 55, rect.y - 1, 80, rect.height);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
if (GUI.Button(rect, s_ContentRefresh, EditorStyles.miniButton))
|
||||
{
|
||||
|
||||
@@ -1,3 +1,6 @@
|
||||
#if UNITY_2019_3_11 || UNITY_2019_3_12 || UNITY_2019_3_13 || UNITY_2019_3_14 || UNITY_2019_3_15 || UNITY_2019_4_OR_NEWER
|
||||
#define SERIALIZE_FIELD_MASKABLE
|
||||
#endif
|
||||
using System.Collections.Generic;
|
||||
using System.Runtime.CompilerServices;
|
||||
using Coffee.UIParticleExtensions;
|
||||
@@ -38,9 +41,8 @@ namespace Coffee.UIExtensions
|
||||
[Tooltip("Particles")] [SerializeField]
|
||||
private List<ParticleSystem> m_Particles = new List<ParticleSystem>();
|
||||
|
||||
#if !UNITY_2019_4_OR_NEWER
|
||||
[SerializeField]
|
||||
private bool m_Maskable = true;
|
||||
#if !SERIALIZE_FIELD_MASKABLE
|
||||
[SerializeField] private bool m_Maskable = true;
|
||||
#endif
|
||||
|
||||
private bool _shouldBeRemoved;
|
||||
@@ -54,6 +56,7 @@ namespace Coffee.UIExtensions
|
||||
private static MaterialPropertyBlock s_Mpb;
|
||||
private static readonly List<Material> s_PrevMaskMaterials = new List<Material>();
|
||||
private static readonly List<Material> s_PrevModifiedMaterials = new List<Material>();
|
||||
private static readonly List<Component> s_Components = new List<Component>();
|
||||
|
||||
|
||||
/// <summary>
|
||||
@@ -121,6 +124,11 @@ namespace Coffee.UIExtensions
|
||||
get { return _modifiedMaterials; }
|
||||
}
|
||||
|
||||
public override Material materialForRendering
|
||||
{
|
||||
get { return canvasRenderer.GetMaterial(0); }
|
||||
}
|
||||
|
||||
public List<bool> activeMeshIndices
|
||||
{
|
||||
get { return _activeMeshIndices; }
|
||||
@@ -247,6 +255,7 @@ namespace Coffee.UIExtensions
|
||||
}
|
||||
|
||||
//
|
||||
GetComponents(typeof(IMaterialModifier), s_Components);
|
||||
var materialCount = Mathf.Max(8, count);
|
||||
canvasRenderer.materialCount = materialCount;
|
||||
var j = 0;
|
||||
@@ -265,6 +274,8 @@ namespace Coffee.UIExtensions
|
||||
if (activeMeshIndices[index] && 0 < s_TempMaterials.Count)
|
||||
{
|
||||
var mat = GetModifiedMaterial(s_TempMaterials[0], ps.GetTextureForSprite());
|
||||
for (var k = 1; k < s_Components.Count; k++)
|
||||
mat = (s_Components[k] as IMaterialModifier).GetModifiedMaterial(mat);
|
||||
canvasRenderer.SetMaterial(mat, j);
|
||||
UpdateMaterialProperties(r, j);
|
||||
j++;
|
||||
@@ -276,6 +287,8 @@ namespace Coffee.UIExtensions
|
||||
if (activeMeshIndices[index] && 1 < s_TempMaterials.Count)
|
||||
{
|
||||
var mat = GetModifiedMaterial(s_TempMaterials[1], null);
|
||||
for (var k = 1; k < s_Components.Count; k++)
|
||||
mat = (s_Components[k] as IMaterialModifier).GetModifiedMaterial(mat);
|
||||
canvasRenderer.SetMaterial(mat, j++);
|
||||
}
|
||||
}
|
||||
@@ -355,7 +368,7 @@ namespace Coffee.UIExtensions
|
||||
/// </summary>
|
||||
protected override void OnEnable()
|
||||
{
|
||||
#if !UNITY_2019_4_OR_NEWER
|
||||
#if !SERIALIZE_FIELD_MASKABLE
|
||||
maskable = m_Maskable;
|
||||
#endif
|
||||
_cachedPosition = transform.localPosition;
|
||||
@@ -448,7 +461,7 @@ namespace Coffee.UIExtensions
|
||||
SetVerticesDirty();
|
||||
m_ShouldRecalculateStencil = true;
|
||||
RecalculateClipping();
|
||||
#if !UNITY_2019_4_OR_NEWER
|
||||
#if !SERIALIZE_FIELD_MASKABLE
|
||||
maskable = m_Maskable;
|
||||
#endif
|
||||
}
|
||||
|
||||
@@ -59,7 +59,7 @@ namespace Coffee.UIExtensions
|
||||
|
||||
private static void Refresh(UIParticle particle)
|
||||
{
|
||||
if (!particle || !particle.canvas || !particle.canvasRenderer) return;
|
||||
if (!particle || !particle.bakedMesh || !particle.canvas || !particle.canvasRenderer) return;
|
||||
|
||||
Profiler.BeginSample("[UIParticle] Modify scale");
|
||||
ModifyScale(particle);
|
||||
|
||||
@@ -210,10 +210,10 @@ namespace Coffee.UIParticleExtensions
|
||||
// Z position & sortingFudge: descending
|
||||
var aTransform = a.transform;
|
||||
var bTransform = b.transform;
|
||||
var aPos = tr.InverseTransformPoint(aTransform.position).z+ aRenderer.sortingFudge;
|
||||
var bPos = tr.InverseTransformPoint(bTransform.position).z+ bRenderer.sortingFudge;
|
||||
var aPos = tr.InverseTransformPoint(aTransform.position).z + aRenderer.sortingFudge;
|
||||
var bPos = tr.InverseTransformPoint(bTransform.position).z + bRenderer.sortingFudge;
|
||||
if (!Mathf.Approximately(aPos, bPos))
|
||||
return (int)Mathf.Sign(bPos - aPos);
|
||||
return (int) Mathf.Sign(bPos - aPos);
|
||||
|
||||
// Material instance ID: match
|
||||
if (aMat.GetInstanceID() == bMat.GetInstanceID())
|
||||
|
||||
@@ -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.1.0",
|
||||
"version": "3.2.0",
|
||||
"unity": "2018.2",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
Reference in New Issue
Block a user