You've already forked ParticleEffectForUGUI
mirror of
https://github.com/mob-sakai/ParticleEffectForUGUI.git
synced 2026-05-15 20:50:08 +00:00
Compare commits
5 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b73a8adb4d | ||
|
|
9749e3e01c | ||
|
|
8c674cba2e | ||
|
|
87bdefce2b | ||
|
|
59fc95f1ea |
25
CHANGELOG.md
25
CHANGELOG.md
@@ -1,8 +1,27 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## [2.0.0](https://github.com/mob-sakai/ParticleEffectForUGUI/tree/2.0.0) (2019-01-17)
|
## [v2.1.1](https://github.com/mob-sakai/ParticleEffectForUGUI/tree/v2.1.1) (2019-02-15)
|
||||||
|
|
||||||
[Full Changelog](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v1.3.3...2.0.0)
|
[Full Changelog](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v2.1.0...v2.1.1)
|
||||||
|
|
||||||
|
**Fixed bugs:**
|
||||||
|
|
||||||
|
- UIParticle.Scale - Rendering Order Issue [\#39](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/39)
|
||||||
|
|
||||||
|
## [v2.1.0](https://github.com/mob-sakai/ParticleEffectForUGUI/tree/v2.1.0) (2019-02-07)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v2.0.0...v2.1.0)
|
||||||
|
|
||||||
|
World simulation bug is fixed.
|
||||||
|

|
||||||
|
|
||||||
|
**Fixed bugs:**
|
||||||
|
|
||||||
|
- When moving the transform in world simulation mode, particles don't behave as expected [\#37](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/37)
|
||||||
|
|
||||||
|
## [v2.0.0](https://github.com/mob-sakai/ParticleEffectForUGUI/tree/v2.0.0) (2019-01-17)
|
||||||
|
|
||||||
|
[Full Changelog](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v1.3.3...v2.0.0)
|
||||||
|
|
||||||
**Install UIParticle with Unity Package Manager!**
|
**Install UIParticle with Unity Package Manager!**
|
||||||
|
|
||||||
@@ -148,4 +167,4 @@ You can mask and sort particles for uGUI without Camera, RenderTexture, Canvas.
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/skywinder/Github-Changelog-Generator)*
|
\* *This Changelog was automatically generated by [github_changelog_generator](https://github.com/github-changelog-generator/github-changelog-generator)*
|
||||||
|
|||||||
@@ -74,12 +74,12 @@ 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.0.0",
|
"com.coffee.ui-particle": "https://github.com/mob-sakai/ParticleEffectForUGUI.git#2.1.0",
|
||||||
...
|
...
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
To update the package, change `#2.0.0` to the target version.
|
To update the package, change `#{version}` to the target version.
|
||||||
|
|
||||||
#### Using .unitypackage file (for Unity 2018.2+)
|
#### Using .unitypackage file (for Unity 2018.2+)
|
||||||
|
|
||||||
|
|||||||
@@ -236,6 +236,8 @@ 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;
|
||||||
|
static ParticleSystem.Particle [] s_Particles = new ParticleSystem.Particle [4096];
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// Update meshes.
|
/// Update meshes.
|
||||||
@@ -264,7 +266,7 @@ namespace Coffee.UIExtensions
|
|||||||
|
|
||||||
if (m_ParticleSystem && canvas)
|
if (m_ParticleSystem && canvas)
|
||||||
{
|
{
|
||||||
if (canvas.renderMode != RenderMode.ScreenSpaceOverlay)
|
// I do not know why, but it worked fine when setting `transform.localPosition.z` to `0.01`. (#34, #39)
|
||||||
{
|
{
|
||||||
Vector3 pos = rectTransform.localPosition;
|
Vector3 pos = rectTransform.localPosition;
|
||||||
if (Mathf.Abs (pos.z) < 0.01f)
|
if (Mathf.Abs (pos.z) < 0.01f)
|
||||||
@@ -284,21 +286,43 @@ namespace Coffee.UIExtensions
|
|||||||
|
|
||||||
Profiler.BeginSample ("Make Matrix");
|
Profiler.BeginSample ("Make Matrix");
|
||||||
scaleaMatrix = m_ParticleSystem.main.scalingMode == ParticleSystemScalingMode.Hierarchy
|
scaleaMatrix = m_ParticleSystem.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 (m_ParticleSystem.main.simulationSpace)
|
||||||
{
|
{
|
||||||
case ParticleSystemSimulationSpace.Local:
|
case ParticleSystemSimulationSpace.Local:
|
||||||
matrix =
|
matrix =
|
||||||
scaleaMatrix
|
scaleaMatrix
|
||||||
* Matrix4x4.Rotate (m_ParticleSystem.transform.rotation).inverse
|
* Matrix4x4.Rotate (rectTransform.rotation).inverse
|
||||||
* Matrix4x4.Scale (m_ParticleSystem.transform.lossyScale).inverse;
|
* Matrix4x4.Scale (rectTransform.lossyScale).inverse;
|
||||||
break;
|
break;
|
||||||
case ParticleSystemSimulationSpace.World:
|
case ParticleSystemSimulationSpace.World:
|
||||||
matrix =
|
matrix =
|
||||||
scaleaMatrix
|
scaleaMatrix
|
||||||
* m_ParticleSystem.transform.worldToLocalMatrix;
|
* rectTransform.worldToLocalMatrix;
|
||||||
|
|
||||||
|
Vector3 newPos = rectTransform.position;
|
||||||
|
Vector3 delta = (newPos - _worldPos);
|
||||||
|
_worldPos = newPos;
|
||||||
|
if (canvas.renderMode != RenderMode.WorldSpace && !Mathf.Approximately (scale, 0) && 0 < delta.sqrMagnitude)
|
||||||
|
{
|
||||||
|
delta *= (1 - 1 / scale);
|
||||||
|
int count = m_ParticleSystem.particleCount;
|
||||||
|
if (s_Particles.Length < count)
|
||||||
|
{
|
||||||
|
s_Particles = new ParticleSystem.Particle [s_Particles.Length * 2];
|
||||||
|
}
|
||||||
|
|
||||||
|
m_ParticleSystem.GetParticles (s_Particles);
|
||||||
|
for (int i = 0; i < count; i++)
|
||||||
|
{
|
||||||
|
var p = s_Particles [i];
|
||||||
|
p.position = p.position + delta;
|
||||||
|
s_Particles [i] = p;
|
||||||
|
}
|
||||||
|
m_ParticleSystem.SetParticles (s_Particles, count);
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case ParticleSystemSimulationSpace.Custom:
|
case ParticleSystemSimulationSpace.Custom:
|
||||||
break;
|
break;
|
||||||
|
|||||||
Binary file not shown.
@@ -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.0.0",
|
"version": "2.1.1",
|
||||||
"unity": "2018.2",
|
"unity": "2018.2",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
Reference in New Issue
Block a user