3.0.0-preview.20
# [3.0.0-preview.20](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v3.0.0-preview.19...v3.0.0-preview.20) (2020-08-28)
### Features
* automatically update ([96a868b](96a868b60a
))
pull/120/head
parent
0d4a5875d1
commit
ab27f0af6f
|
@ -1,3 +1,10 @@
|
||||||
|
# [3.0.0-preview.20](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v3.0.0-preview.19...v3.0.0-preview.20) (2020-08-28)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* automatically update ([96a868b](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/96a868b60a3f36d761d58b5082aa9d37666e63a3))
|
||||||
|
|
||||||
# [3.0.0-preview.19](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v3.0.0-preview.18...v3.0.0-preview.19) (2020-08-28)
|
# [3.0.0-preview.19](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v3.0.0-preview.18...v3.0.0-preview.19) (2020-08-28)
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -15,7 +15,7 @@ namespace Coffee.UIExtensions
|
||||||
[ExecuteInEditMode]
|
[ExecuteInEditMode]
|
||||||
[RequireComponent(typeof(RectTransform))]
|
[RequireComponent(typeof(RectTransform))]
|
||||||
[RequireComponent(typeof(CanvasRenderer))]
|
[RequireComponent(typeof(CanvasRenderer))]
|
||||||
public class UIParticle : MaskableGraphic
|
public class UIParticle : MaskableGraphic, ISerializationCallbackReceiver
|
||||||
{
|
{
|
||||||
[HideInInspector] [SerializeField] bool m_IsTrail = false;
|
[HideInInspector] [SerializeField] bool m_IsTrail = false;
|
||||||
|
|
||||||
|
@ -114,6 +114,13 @@ namespace Coffee.UIExtensions
|
||||||
{
|
{
|
||||||
GetComponentsInChildren(particles);
|
GetComponentsInChildren(particles);
|
||||||
|
|
||||||
|
foreach (var ps in particles)
|
||||||
|
{
|
||||||
|
var tsa = ps.textureSheetAnimation;
|
||||||
|
if (tsa.mode == ParticleSystemAnimationMode.Sprites && tsa.uvChannelMask == (UVChannelFlags) 0)
|
||||||
|
tsa.uvChannelMask = UVChannelFlags.UV0;
|
||||||
|
}
|
||||||
|
|
||||||
particles.Exec(p => p.GetComponent<ParticleSystemRenderer>().enabled = !enabled);
|
particles.Exec(p => p.GetComponent<ParticleSystemRenderer>().enabled = !enabled);
|
||||||
particles.SortForRendering(transform);
|
particles.SortForRendering(transform);
|
||||||
|
|
||||||
|
@ -258,12 +265,11 @@ namespace Coffee.UIExtensions
|
||||||
|
|
||||||
private void InitializeIfNeeded()
|
private void InitializeIfNeeded()
|
||||||
{
|
{
|
||||||
if (0 < particles.Count) return;
|
if (!this || 0 < particles.Count) return;
|
||||||
|
|
||||||
if (m_IsTrail
|
if (m_IsTrail)
|
||||||
|| transform.parent && transform.parent.GetComponentInParent<UIParticle>())
|
|
||||||
{
|
{
|
||||||
gameObject.SetActive(false);
|
UnityEngine.Debug.LogWarningFormat("[UIParticle] Remove this UIParticle: {0}\nReason: UIParticle for trails is no longer needed.", name);
|
||||||
if (Application.isPlaying)
|
if (Application.isPlaying)
|
||||||
Destroy(gameObject);
|
Destroy(gameObject);
|
||||||
else
|
else
|
||||||
|
@ -271,13 +277,41 @@ namespace Coffee.UIExtensions
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (transform.parent && transform.parent.GetComponentInParent<UIParticle>())
|
||||||
|
{
|
||||||
|
UnityEngine.Debug.LogWarningFormat("[UIParticle] Remove this UIParticle: {0}\nReason: The parent UIParticle exists.", name);
|
||||||
|
if (Application.isPlaying)
|
||||||
|
Destroy(this);
|
||||||
|
else
|
||||||
|
DestroyImmediate(this);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// refresh.
|
// refresh.
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
if (!Application.isPlaying)
|
if (!Application.isPlaying)
|
||||||
UnityEditor.EditorApplication.delayCall += RefreshParticles;
|
UnityEditor.EditorApplication.delayCall += () =>
|
||||||
|
{
|
||||||
|
if (this) RefreshParticles();
|
||||||
|
};
|
||||||
else
|
else
|
||||||
#endif
|
#endif
|
||||||
RefreshParticles();
|
RefreshParticles();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
void ISerializationCallbackReceiver.OnBeforeSerialize()
|
||||||
|
{
|
||||||
|
InitializeIfNeeded();
|
||||||
|
}
|
||||||
|
|
||||||
|
void ISerializationCallbackReceiver.OnAfterDeserialize()
|
||||||
|
{
|
||||||
|
UnityEditor.EditorApplication.delayCall += () =>
|
||||||
|
{
|
||||||
|
if (this) InitializeIfNeeded();
|
||||||
|
};
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -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.0.0-preview.19",
|
"version": "3.0.0-preview.20",
|
||||||
"unity": "2018.2",
|
"unity": "2018.2",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|
Loading…
Reference in New Issue