release v1.3.3
commit
fe6f587963
|
@ -143,7 +143,7 @@ namespace Coffee.UIExtensions
|
||||||
foreach (UIParticle uip in _particles)
|
foreach (UIParticle uip in _particles)
|
||||||
{
|
{
|
||||||
ParticleSystem ps = uip.cachedParticleSystem;
|
ParticleSystem ps = uip.cachedParticleSystem;
|
||||||
if (!ps)
|
if (!ps || !uip.canvas)
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
|
@ -242,11 +242,11 @@ namespace Coffee.UIExtensions
|
||||||
/// </summary>
|
/// </summary>
|
||||||
static void UpdateMeshes ()
|
static void UpdateMeshes ()
|
||||||
{
|
{
|
||||||
foreach (var uip in s_ActiveParticles)
|
for (int i = 0; i < s_ActiveParticles.Count; i++)
|
||||||
{
|
{
|
||||||
if(uip)
|
if (s_ActiveParticles [i])
|
||||||
{
|
{
|
||||||
uip.UpdateMesh ();
|
s_ActiveParticles [i].UpdateMesh ();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -264,6 +264,16 @@ namespace Coffee.UIExtensions
|
||||||
|
|
||||||
if (m_ParticleSystem && canvas)
|
if (m_ParticleSystem && canvas)
|
||||||
{
|
{
|
||||||
|
if (canvas.renderMode != RenderMode.ScreenSpaceOverlay)
|
||||||
|
{
|
||||||
|
Vector3 pos = rectTransform.localPosition;
|
||||||
|
if (Mathf.Abs (pos.z) < 0.01f)
|
||||||
|
{
|
||||||
|
pos.z = 0.01f;
|
||||||
|
rectTransform.localPosition = pos;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
var rootCanvas = canvas.rootCanvas;
|
var rootCanvas = canvas.rootCanvas;
|
||||||
Profiler.BeginSample ("Disable ParticleSystemRenderer");
|
Profiler.BeginSample ("Disable ParticleSystemRenderer");
|
||||||
if (Application.isPlaying)
|
if (Application.isPlaying)
|
||||||
|
|
|
@ -1,6 +1,9 @@
|
||||||
using System.Collections;
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
#if UNITY_2018_3_OR_NEWER && UNITY_EDITOR
|
||||||
|
using PrefabStageUtility = UnityEditor.Experimental.SceneManagement.PrefabStageUtility;
|
||||||
|
#endif
|
||||||
|
|
||||||
namespace Coffee.UIExtensions
|
namespace Coffee.UIExtensions
|
||||||
{
|
{
|
||||||
|
@ -20,6 +23,28 @@ namespace Coffee.UIExtensions
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
|
#if UNITY_2018_3_OR_NEWER && UNITY_EDITOR
|
||||||
|
// If current scene is prefab mode, create OverlayCamera for editor.
|
||||||
|
var prefabStage = PrefabStageUtility.GetCurrentPrefabStage ();
|
||||||
|
if (prefabStage != null && prefabStage.scene.isLoaded)
|
||||||
|
{
|
||||||
|
if (!s_InstanceForPrefabMode)
|
||||||
|
{
|
||||||
|
// This GameObject is not saved in prefab.
|
||||||
|
// This GameObject is not shown in the hierarchy view.
|
||||||
|
// When you exit prefab mode, this GameObject is destroyed automatically.
|
||||||
|
var go = new GameObject (typeof (UIParticleOverlayCamera).Name + "_ForEditor")
|
||||||
|
{
|
||||||
|
hideFlags = HideFlags.HideAndDontSave,
|
||||||
|
tag = "EditorOnly",
|
||||||
|
};
|
||||||
|
UnityEngine.SceneManagement.SceneManager.MoveGameObjectToScene (go, prefabStage.scene);
|
||||||
|
s_InstanceForPrefabMode = go.AddComponent<UIParticleOverlayCamera> ();
|
||||||
|
}
|
||||||
|
return s_InstanceForPrefabMode;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Find instance in scene, or create new one.
|
// Find instance in scene, or create new one.
|
||||||
if (object.ReferenceEquals (s_Instance, null))
|
if (object.ReferenceEquals (s_Instance, null))
|
||||||
{
|
{
|
||||||
|
@ -56,12 +81,24 @@ namespace Coffee.UIExtensions
|
||||||
Camera cameraForOvrelay { get { return m_Camera ? m_Camera : (m_Camera = GetComponent<Camera> ()) ? m_Camera : (m_Camera = gameObject.AddComponent<Camera> ()); } }
|
Camera cameraForOvrelay { get { return m_Camera ? m_Camera : (m_Camera = GetComponent<Camera> ()) ? m_Camera : (m_Camera = gameObject.AddComponent<Camera> ()); } }
|
||||||
Camera m_Camera;
|
Camera m_Camera;
|
||||||
static UIParticleOverlayCamera s_Instance;
|
static UIParticleOverlayCamera s_Instance;
|
||||||
|
#if UNITY_2018_3_OR_NEWER && UNITY_EDITOR
|
||||||
|
static UIParticleOverlayCamera s_InstanceForPrefabMode;
|
||||||
|
#endif
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Awake is called when the script instance is being loaded.
|
/// Awake is called when the script instance is being loaded.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void Awake ()
|
void Awake ()
|
||||||
{
|
{
|
||||||
|
#if UNITY_2018_3_OR_NEWER && UNITY_EDITOR
|
||||||
|
// OverlayCamera for editor.
|
||||||
|
if (hideFlags == HideFlags.HideAndDontSave || s_InstanceForPrefabMode == this)
|
||||||
|
{
|
||||||
|
s_InstanceForPrefabMode = GetComponent<UIParticleOverlayCamera> ();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Hold the instance.
|
// Hold the instance.
|
||||||
if (s_Instance == null)
|
if (s_Instance == null)
|
||||||
{
|
{
|
||||||
|
@ -100,6 +137,13 @@ namespace Coffee.UIExtensions
|
||||||
/// </summary>
|
/// </summary>
|
||||||
void OnDestroy ()
|
void OnDestroy ()
|
||||||
{
|
{
|
||||||
|
#if UNITY_2018_3_OR_NEWER && UNITY_EDITOR
|
||||||
|
if (s_InstanceForPrefabMode == this)
|
||||||
|
{
|
||||||
|
s_InstanceForPrefabMode = null;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
// Clear instance on destroy.
|
// Clear instance on destroy.
|
||||||
if (s_Instance == this)
|
if (s_Instance == this)
|
||||||
{
|
{
|
||||||
|
|
|
@ -1,5 +1,14 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [v1.3.3](https://github.com/mob-sakai/ParticleEffectForUGUI/tree/v1.3.3) (2019-01-16)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v1.3.2...v1.3.3)
|
||||||
|
|
||||||
|
**Fixed bugs:**
|
||||||
|
|
||||||
|
- On prefab edit mode, unnecessary UIParticleOverlayCamera is generated in the scene [\#35](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/35)
|
||||||
|
- With 'Screen Space - Camera' render mode, sorting is incorrect [\#34](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/34)
|
||||||
|
|
||||||
## [v1.3.2](https://github.com/mob-sakai/ParticleEffectForUGUI/tree/v1.3.2) (2018-12-29)
|
## [v1.3.2](https://github.com/mob-sakai/ParticleEffectForUGUI/tree/v1.3.2) (2018-12-29)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v1.3.1...v1.3.2)
|
[Full Changelog](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v1.3.1...v1.3.2)
|
||||||
|
|
11
README.md
11
README.md
|
@ -7,16 +7,17 @@ The particle rendering is maskable and sortable, without Camera, RenderTexture o
|
||||||
[](https://github.com/mob-sakai/ParticleEffectForUGUI/releases)
|
[](https://github.com/mob-sakai/ParticleEffectForUGUI/releases)
|
||||||
[](https://github.com/mob-sakai/ParticleEffectForUGUI/releases)
|
[](https://github.com/mob-sakai/ParticleEffectForUGUI/releases)
|
||||||

|

|
||||||
[](https://github.com/mob-sakai/ParticleEffectForUGUI/blob/master/LICENSE.txt)
|
[](https://github.com/mob-sakai/ParticleEffectForUGUI/blob/master/LICENSE.txt)
|
||||||
[](https://github.com/mob-sakai/ParticleEffectForUGUI/commits/develop)
|
[](http://makeapullrequest.com)
|
||||||
[](https://github.com/mob-sakai/ParticleEffectForUGUI/issues)
|
[](https://twitter.com/intent/follow?screen_name=mob_sakai)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<< [Description](#Description) | [WebGL Demo](#demo) | [Download](https://github.com/mob-sakai/ParticleEffectForUGUI/releases) | [Usage](#usage) | [Development Note](#development-note) | [Change log](https://github.com/mob-sakai/ParticleEffectForUGUI/blob/master/CHANGELOG.md) >>
|
<< [Description](#Description) | [WebGL Demo](#demo) | [Download](https://github.com/mob-sakai/ParticleEffectForUGUI/releases) | [Usage](#usage) | [Development Note](#development-note) | [Change log](https://github.com/mob-sakai/ParticleEffectForUGUI/blob/master/CHANGELOG.md) >>
|
||||||
|
|
||||||
### What's new? Please see [See changelog ](https://github.com/mob-sakai/ParticleEffectForUGUI/blob/master/CHANGELOG.md)
|
### What's new? Please see [See changelog ](https://github.com/mob-sakai/ParticleEffectForUGUI/blob/master/CHANGELOG.md)
|
||||||
### Do you want to receive notifications for new releases? [Watch this repo ](https://github.com/mob-sakai/ParticleEffectForUGUI/subscription)
|
### Do you want to receive notifications for new releases? [Watch this repo ](https://github.com/mob-sakai/ParticleEffectForUGUI/subscription)
|
||||||
|
### Support me on Patreon! [](https://www.patreon.com/join/2343451?)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
@ -105,6 +106,8 @@ Compares this "Baking mesh" approach with the conventional approach:
|
||||||
## Author
|
## Author
|
||||||
|
|
||||||
[mob-sakai](https://github.com/mob-sakai)
|
[mob-sakai](https://github.com/mob-sakai)
|
||||||
|
[](https://twitter.com/intent/follow?screen_name=mob_sakai)
|
||||||
|
[](https://www.patreon.com/join/2343451?)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
{
|
{
|
||||||
"name": "ParticleEffectForUGUI",
|
"name": "ParticleEffectForUGUI",
|
||||||
"version": "1.3.2",
|
"version": "1.3.3",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "git+https://github.com/mob-sakai/ParticleEffectForUGUI.git"
|
"url": "git+https://github.com/mob-sakai/ParticleEffectForUGUI.git"
|
||||||
|
|
Loading…
Reference in New Issue