You've already forked ParticleEffectForUGUI
mirror of
https://github.com/mob-sakai/ParticleEffectForUGUI.git
synced 2026-05-15 12:40:08 +00:00
Compare commits
6 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9c525ad0f0 | ||
|
|
66a0ab7ad5 | ||
|
|
888eac4e54 | ||
|
|
f6e64c325b | ||
|
|
beb6fa8367 | ||
|
|
6c2ed22e3a |
19
CHANGELOG.md
19
CHANGELOG.md
@@ -1,5 +1,24 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [v2.3.0](https://github.com/mob-sakai/ParticleEffectForUGUI/tree/v2.3.0) (2019-05-12)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v2.2.1...v2.3.0)
|
||||||
|
|
||||||
|
World simulation bug due to transform movement have been fixed
|
||||||
|
|
||||||
|
**Fixed bugs:**
|
||||||
|
|
||||||
|
- World simulation bug due to transform movement [\#47](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/47)
|
||||||
|
|
||||||
|
## [v2.2.1](https://github.com/mob-sakai/ParticleEffectForUGUI/tree/v2.2.1) (2019-02-26)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v2.2.0...v2.2.1)
|
||||||
|
|
||||||
|
**Fixed bugs:**
|
||||||
|
|
||||||
|
- v2.2.0 has 2 warnings [\#44](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/44)
|
||||||
|
- Disable ParticleSystemRenderer on reset [\#45](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/45)
|
||||||
|
|
||||||
## [v2.2.0](https://github.com/mob-sakai/ParticleEffectForUGUI/tree/v2.2.0) (2019-02-23)
|
## [v2.2.0](https://github.com/mob-sakai/ParticleEffectForUGUI/tree/v2.2.0) (2019-02-23)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v2.1.1...v2.2.0)
|
[Full Changelog](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v2.1.1...v2.2.0)
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ Find the manifest.json file in the Packages folder of your project and edit it t
|
|||||||
```js
|
```js
|
||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.coffee.ui-particle": "https://github.com/mob-sakai/ParticleEffectForUGUI.git#2.2.0",
|
"com.coffee.ui-particle": "https://github.com/mob-sakai/ParticleEffectForUGUI.git#2.2.1",
|
||||||
...
|
...
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -228,7 +228,7 @@ namespace Coffee.UIExtensions
|
|||||||
{
|
{
|
||||||
if (!mat.HasProperty (propName))
|
if (!mat.HasProperty (propName))
|
||||||
{
|
{
|
||||||
EditorGUILayout.HelpBox (string.Format("Shader {0} doesn't have '{1}' property. This graphic is not maskable.", shader.name, propName), MessageType.Warning);
|
EditorGUILayout.HelpBox (string.Format ("Shader {0} doesn't have '{1}' property. This graphic is not maskable.", shader.name, propName), MessageType.Warning);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -310,7 +310,7 @@ namespace Coffee.UIExtensions
|
|||||||
transformMatrix *= emitterMatrix;
|
transformMatrix *= emitterMatrix;
|
||||||
Handles.matrix = transformMatrix;
|
Handles.matrix = transformMatrix;
|
||||||
|
|
||||||
if(uip.canvas.renderMode == RenderMode.ScreenSpaceOverlay || ps.main.scalingMode == ParticleSystemScalingMode.Hierarchy)
|
if (uip.canvas.renderMode == RenderMode.ScreenSpaceOverlay || ps.main.scalingMode == ParticleSystemScalingMode.Hierarchy)
|
||||||
{
|
{
|
||||||
Handles.matrix = Handles.matrix * Matrix4x4.Scale (Vector3.one * uip.scale);
|
Handles.matrix = Handles.matrix * Matrix4x4.Scale (Vector3.one * uip.scale);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ namespace Coffee.UIExtensions
|
|||||||
[SerializeField] bool m_IgnoreParent = false;
|
[SerializeField] bool m_IgnoreParent = false;
|
||||||
|
|
||||||
[Tooltip ("Animatable material properties. AnimationでParticleSystemのマテリアルプロパティを変更する場合、有効にしてください。")]
|
[Tooltip ("Animatable material properties. AnimationでParticleSystemのマテリアルプロパティを変更する場合、有効にしてください。")]
|
||||||
[SerializeField] AnimatableProperty[] m_AnimatableProperties = new AnimatableProperty[0];
|
[SerializeField] AnimatableProperty [] m_AnimatableProperties = new AnimatableProperty [0];
|
||||||
|
|
||||||
static MaterialPropertyBlock s_Mpb;
|
static MaterialPropertyBlock s_Mpb;
|
||||||
|
|
||||||
@@ -54,9 +54,9 @@ namespace Coffee.UIExtensions
|
|||||||
};
|
};
|
||||||
|
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
string m_Name;
|
string m_Name = "";
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
ShaderPropertyType m_Type;
|
ShaderPropertyType m_Type = ShaderPropertyType.Vector;
|
||||||
public int id { get; private set; }
|
public int id { get; private set; }
|
||||||
public ShaderPropertyType type { get { return m_Type; } }
|
public ShaderPropertyType type { get { return m_Type; } }
|
||||||
|
|
||||||
@@ -224,6 +224,13 @@ namespace Coffee.UIExtensions
|
|||||||
_mesh.MarkDynamic ();
|
_mesh.MarkDynamic ();
|
||||||
CheckTrail ();
|
CheckTrail ();
|
||||||
|
|
||||||
|
if (cachedParticleSystem)
|
||||||
|
{
|
||||||
|
_oldPos = cachedParticleSystem.main.scalingMode == ParticleSystemScalingMode.Local
|
||||||
|
? rectTransform.localPosition
|
||||||
|
: rectTransform.position;
|
||||||
|
}
|
||||||
|
|
||||||
base.OnEnable ();
|
base.OnEnable ();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -255,6 +262,21 @@ namespace Coffee.UIExtensions
|
|||||||
base.OnDisable ();
|
base.OnDisable ();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
/// <summary>
|
||||||
|
/// Reset to default values.
|
||||||
|
/// </summary>
|
||||||
|
protected override void Reset ()
|
||||||
|
{
|
||||||
|
// Disable ParticleSystemRenderer on reset.
|
||||||
|
if (cachedParticleSystem)
|
||||||
|
{
|
||||||
|
cachedParticleSystem.GetComponent<ParticleSystemRenderer> ().enabled = false;
|
||||||
|
}
|
||||||
|
base.Reset ();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Call to update the geometry of the Graphic onto the CanvasRenderer.
|
/// Call to update the geometry of the Graphic onto the CanvasRenderer.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
@@ -309,7 +331,7 @@ namespace Coffee.UIExtensions
|
|||||||
UIParticle _parent;
|
UIParticle _parent;
|
||||||
List<UIParticle> _children = new List<UIParticle> ();
|
List<UIParticle> _children = new List<UIParticle> ();
|
||||||
Matrix4x4 scaleaMatrix = default (Matrix4x4);
|
Matrix4x4 scaleaMatrix = default (Matrix4x4);
|
||||||
Vector3 _worldPos;
|
Vector3 _oldPos;
|
||||||
static ParticleSystem.Particle [] s_Particles = new ParticleSystem.Particle [4096];
|
static ParticleSystem.Particle [] s_Particles = new ParticleSystem.Particle [4096];
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -358,11 +380,12 @@ namespace Coffee.UIExtensions
|
|||||||
Profiler.EndSample ();
|
Profiler.EndSample ();
|
||||||
|
|
||||||
Profiler.BeginSample ("Make Matrix");
|
Profiler.BeginSample ("Make Matrix");
|
||||||
scaleaMatrix = m_ParticleSystem.main.scalingMode == ParticleSystemScalingMode.Hierarchy
|
ParticleSystem.MainModule main = m_ParticleSystem.main;
|
||||||
|
scaleaMatrix = main.scalingMode == ParticleSystemScalingMode.Hierarchy
|
||||||
? Matrix4x4.Scale (scale * Vector3.one)
|
? Matrix4x4.Scale (scale * Vector3.one)
|
||||||
: Matrix4x4.Scale (scale * rootCanvas.transform.localScale);
|
: Matrix4x4.Scale (scale * rootCanvas.transform.localScale);
|
||||||
Matrix4x4 matrix = default (Matrix4x4);
|
Matrix4x4 matrix = default (Matrix4x4);
|
||||||
switch (m_ParticleSystem.main.simulationSpace)
|
switch (main.simulationSpace)
|
||||||
{
|
{
|
||||||
case ParticleSystemSimulationSpace.Local:
|
case ParticleSystemSimulationSpace.Local:
|
||||||
matrix =
|
matrix =
|
||||||
@@ -375,12 +398,25 @@ namespace Coffee.UIExtensions
|
|||||||
scaleaMatrix
|
scaleaMatrix
|
||||||
* rectTransform.worldToLocalMatrix;
|
* rectTransform.worldToLocalMatrix;
|
||||||
|
|
||||||
|
bool isLocalScaling = main.scalingMode == ParticleSystemScalingMode.Local;
|
||||||
Vector3 newPos = rectTransform.position;
|
Vector3 newPos = rectTransform.position;
|
||||||
Vector3 delta = (newPos - _worldPos);
|
Vector3 delta = (newPos - _oldPos);
|
||||||
_worldPos = newPos;
|
_oldPos = newPos;
|
||||||
if (canvas.renderMode != RenderMode.WorldSpace && !Mathf.Approximately (scale, 0) && 0 < delta.sqrMagnitude)
|
|
||||||
|
if (!Mathf.Approximately (scale, 0) && 0 < delta.sqrMagnitude)
|
||||||
{
|
{
|
||||||
delta *= (1 - 1 / scale);
|
if(isLocalScaling)
|
||||||
|
{
|
||||||
|
var s = rootCanvas.transform.localScale * scale;
|
||||||
|
delta.x *= 1f - 1f / s.x;
|
||||||
|
delta.y *= 1f - 1f / s.y;
|
||||||
|
delta.z *= 1f - 1f / s.z;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
delta = delta * (1 - 1 / scale);
|
||||||
|
}
|
||||||
|
|
||||||
int count = m_ParticleSystem.particleCount;
|
int count = m_ParticleSystem.particleCount;
|
||||||
if (s_Particles.Length < count)
|
if (s_Particles.Length < count)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -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": "2.2.0",
|
"version": "2.3.0",
|
||||||
"unity": "2018.2",
|
"unity": "2018.2",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
Reference in New Issue
Block a user