You've already forked ParticleEffectForUGUI
mirror of
https://github.com/mob-sakai/ParticleEffectForUGUI.git
synced 2026-05-16 21:30:07 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c0fba1dc9f |
16
CHANGELOG.md
16
CHANGELOG.md
@@ -1,19 +1,3 @@
|
|||||||
## [3.3.11](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/3.3.10...3.3.11) (2022-06-10)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* sorting by layer does not work properly ([ccc09e6](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/ccc09e6aca2fa3d7bc887e6c733e66706e40ae0f))
|
|
||||||
* when using linear color space, the particle colors are not output correctly ([11c3a7b](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/11c3a7b37415d78e1b8ba3988a6e043c9f1861e0)), closes [#203](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/203)
|
|
||||||
|
|
||||||
## [3.3.10](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/3.3.9...3.3.10) (2022-02-17)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* annoying warning for [ExecuteInEditMode] ([b6b2c72](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/b6b2c72b198566e2880a22831c937eff7e9eff28)), closes [#180](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/180)
|
|
||||||
* PrefabStageUtility class is not experimental after 2021.2 ([0fd5d7a](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/0fd5d7affe707fa9e92abd6e192bf400dfb1a80a))
|
|
||||||
|
|
||||||
## [3.3.9](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/3.3.8...3.3.9) (2021-08-02)
|
## [3.3.9](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/3.3.8...3.3.9) (2021-08-02)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ using UnityEngine.UI;
|
|||||||
namespace Coffee.UIExtensions.Demos
|
namespace Coffee.UIExtensions.Demos
|
||||||
{
|
{
|
||||||
#if UNITY_5_3_OR_NEWER
|
#if UNITY_5_3_OR_NEWER
|
||||||
[ExecuteAlways]
|
[ExecuteInEditMode]
|
||||||
[RequireComponent(typeof(CanvasRenderer), typeof(ParticleSystem))]
|
[RequireComponent(typeof(CanvasRenderer), typeof(ParticleSystem))]
|
||||||
public class UIParticleSystem_Demo : MaskableGraphic
|
public class UIParticleSystem_Demo : MaskableGraphic
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -17,11 +17,7 @@ namespace Coffee.UIParticleExtensions
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
// If current scene is prefab mode, create OverlayCamera for editor.
|
// If current scene is prefab mode, create OverlayCamera for editor.
|
||||||
#if UNITY_2021_2_OR_NEWER
|
|
||||||
var prefabStage = UnityEditor.SceneManagement.PrefabStageUtility.GetCurrentPrefabStage();
|
|
||||||
#else
|
|
||||||
var prefabStage = UnityEditor.Experimental.SceneManagement.PrefabStageUtility.GetCurrentPrefabStage();
|
var prefabStage = UnityEditor.Experimental.SceneManagement.PrefabStageUtility.GetCurrentPrefabStage();
|
||||||
#endif
|
|
||||||
if (prefabStage == null || !prefabStage.scene.isLoaded) return null;
|
if (prefabStage == null || !prefabStage.scene.isLoaded) return null;
|
||||||
if (s_InstanceForPrefab) return s_InstanceForPrefab;
|
if (s_InstanceForPrefab) return s_InstanceForPrefab;
|
||||||
|
|
||||||
|
|||||||
@@ -202,24 +202,6 @@ namespace Coffee.UIExtensions
|
|||||||
DestroyUIParticle(current);
|
DestroyUIParticle(current);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// #203: When using linear color space, the particle colors are not output correctly.
|
|
||||||
// To fix, set 'Apply Active Color Space' in renderer module to false.
|
|
||||||
var allPsRenderers = targets.OfType<UIParticle>()
|
|
||||||
.SelectMany(x => x.particles)
|
|
||||||
.Where(x => x)
|
|
||||||
.Select(x => x.GetComponent<ParticleSystemRenderer>())
|
|
||||||
.ToArray();
|
|
||||||
if (0 < allPsRenderers.Length)
|
|
||||||
{
|
|
||||||
var so = new SerializedObject(allPsRenderers);
|
|
||||||
var sp = so.FindProperty("m_ApplyActiveColorSpace");//.boolValue = false;
|
|
||||||
if (FixButton(sp.boolValue || sp.hasMultipleDifferentValues, "When using linear color space, the particle colors are not output correctly.\nTo fix, set 'Apply Active Color Space' in renderer module to false."))
|
|
||||||
{
|
|
||||||
sp.boolValue = false;
|
|
||||||
so.ApplyModifiedProperties();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void DestroyUIParticle(UIParticle p, bool ignoreCurrent = false)
|
void DestroyUIParticle(UIParticle p, bool ignoreCurrent = false)
|
||||||
@@ -230,12 +212,8 @@ namespace Coffee.UIExtensions
|
|||||||
DestroyImmediate(p);
|
DestroyImmediate(p);
|
||||||
DestroyImmediate(cr);
|
DestroyImmediate(cr);
|
||||||
|
|
||||||
#if UNITY_2021_2_OR_NEWER
|
|
||||||
var stage = UnityEditor.SceneManagement.PrefabStageUtility.GetCurrentPrefabStage();
|
|
||||||
#elif UNITY_2018_3_OR_NEWER
|
|
||||||
var stage = UnityEditor.Experimental.SceneManagement.PrefabStageUtility.GetCurrentPrefabStage();
|
|
||||||
#endif
|
|
||||||
#if UNITY_2018_3_OR_NEWER
|
#if UNITY_2018_3_OR_NEWER
|
||||||
|
var stage = UnityEditor.Experimental.SceneManagement.PrefabStageUtility.GetCurrentPrefabStage();
|
||||||
if (stage != null && stage.scene.isLoaded)
|
if (stage != null && stage.scene.isLoaded)
|
||||||
{
|
{
|
||||||
#if UNITY_2020_1_OR_NEWER
|
#if UNITY_2020_1_OR_NEWER
|
||||||
|
|||||||
@@ -17,7 +17,7 @@ namespace Coffee.UIExtensions
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Render maskable and sortable particle effect ,without Camera, RenderTexture or Canvas.
|
/// Render maskable and sortable particle effect ,without Camera, RenderTexture or Canvas.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[ExecuteAlways]
|
[ExecuteInEditMode]
|
||||||
[RequireComponent(typeof(RectTransform))]
|
[RequireComponent(typeof(RectTransform))]
|
||||||
[RequireComponent(typeof(CanvasRenderer))]
|
[RequireComponent(typeof(CanvasRenderer))]
|
||||||
public class UIParticle : MaskableGraphic
|
public class UIParticle : MaskableGraphic
|
||||||
@@ -313,6 +313,20 @@ namespace Coffee.UIExtensions
|
|||||||
ClearPreviousMaterials();
|
ClearPreviousMaterials();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ClearMaterials()
|
||||||
|
{
|
||||||
|
// Clear mask materials.
|
||||||
|
s_PrevMaskMaterials.AddRange(_maskMaterials);
|
||||||
|
_maskMaterials.Clear();
|
||||||
|
|
||||||
|
// Clear modified materials.
|
||||||
|
s_PrevModifiedMaterials.AddRange(_modifiedMaterials);
|
||||||
|
_modifiedMaterials.Clear();
|
||||||
|
|
||||||
|
canvasRenderer.Clear();
|
||||||
|
ClearPreviousMaterials();
|
||||||
|
}
|
||||||
|
|
||||||
private void ClearPreviousMaterials()
|
private void ClearPreviousMaterials()
|
||||||
{
|
{
|
||||||
foreach (var m in s_PrevMaskMaterials)
|
foreach (var m in s_PrevMaskMaterials)
|
||||||
@@ -447,6 +461,7 @@ namespace Coffee.UIExtensions
|
|||||||
_bakedMesh = null;
|
_bakedMesh = null;
|
||||||
|
|
||||||
base.OnDisable();
|
base.OnDisable();
|
||||||
|
ClearMaterials();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -230,7 +230,7 @@ namespace Coffee.UIParticleExtensions
|
|||||||
|
|
||||||
// Sorting layer: ascending
|
// Sorting layer: ascending
|
||||||
if (aRenderer.sortingLayerID != bRenderer.sortingLayerID)
|
if (aRenderer.sortingLayerID != bRenderer.sortingLayerID)
|
||||||
return SortingLayer.GetLayerValueFromID(aRenderer.sortingLayerID) - SortingLayer.GetLayerValueFromID(bRenderer.sortingLayerID);
|
return aRenderer.sortingLayerID - bRenderer.sortingLayerID;
|
||||||
|
|
||||||
// Sorting order: ascending
|
// Sorting order: ascending
|
||||||
if (aRenderer.sortingOrder != bRenderer.sortingOrder)
|
if (aRenderer.sortingOrder != bRenderer.sortingOrder)
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
"name": "com.coffee.ui-particle",
|
"name": "com.coffee.ui-particle",
|
||||||
"displayName": "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.",
|
"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.3.11",
|
"version": "3.3.9",
|
||||||
"unity": "2018.2",
|
"unity": "2018.2",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
Reference in New Issue
Block a user