Compare commits

...

7 Commits
3.3.4 ... 3.3.6

Author SHA1 Message Date
semantic-release-bot
24d32d8441 chore(release): 3.3.6 [skip ci]
## [3.3.6](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/3.3.5...3.3.6) (2021-05-11)

### Bug Fixes

* In rare cases, the generated camera (for baking) will not be deactivated ([12c748a](12c748a8cd))
* remove from "Add Component" menu ([476c402](476c4027ff))
2021-05-11 08:24:08 +00:00
mob-sakai
476c4027ff fix: remove from "Add Component" menu 2021-05-11 17:22:02 +09:00
mob-sakai
12c748a8cd fix: In rare cases, the generated camera (for baking) will not be deactivated 2021-05-11 17:21:10 +09:00
mob-sakai
0259ad2464 refactor 2021-05-11 16:20:50 +09:00
semantic-release-bot
5f3ead2086 chore(release): 3.3.5 [skip ci]
## [3.3.5](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/3.3.4...3.3.5) (2021-02-28)

### Bug Fixes

* fix cached position for pre-warmed particles ([e3f42d7](e3f42d747a))
* ParticleSystem creates particles in wrong position during pre-warm ([b93e0e4](b93e0e4701)), closes [#147](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/147)
2021-02-28 04:21:18 +00:00
mob-sakai
e3f42d747a fix: fix cached position for pre-warmed particles 2021-02-24 16:22:37 +09:00
mob-sakai
b93e0e4701 fix: ParticleSystem creates particles in wrong position during pre-warm
Close #147
2021-02-23 13:30:46 +09:00
5 changed files with 34 additions and 7 deletions

View File

@@ -1,3 +1,19 @@
## [3.3.6](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/3.3.5...3.3.6) (2021-05-11)
### Bug Fixes
* In rare cases, the generated camera (for baking) will not be deactivated ([12c748a](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/12c748a8cd4adfd2dc5f085cec77050431f261a4))
* remove from "Add Component" menu ([476c402](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/476c4027ff5f70fb9b4c026dd5fc59bf5a876227))
## [3.3.5](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/3.3.4...3.3.5) (2021-02-28)
### Bug Fixes
* fix cached position for pre-warmed particles ([e3f42d7](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/e3f42d747a7fd973b5813cc72a9444943a6c3ad0))
* ParticleSystem creates particles in wrong position during pre-warm ([b93e0e4](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/b93e0e4701c7011176eeec5c109dda7f4ea632e0)), closes [#147](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/147)
## [3.3.4](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/3.3.3...3.3.4) (2021-02-22)

View File

@@ -2,6 +2,7 @@
namespace Coffee.UIParticleExtensions
{
[AddComponentMenu("")]
internal class BakingCamera : MonoBehaviour
{
static BakingCamera s_Instance;
@@ -40,12 +41,11 @@ namespace Coffee.UIParticleExtensions
// Find instance in scene, or create new one.
return s_Instance
? s_Instance
: (s_Instance = FindObjectOfType<BakingCamera>() ?? Create());
: (s_Instance = Create());
}
}
private Camera _camera;
// private int _refCount;
private static BakingCamera Create()
{
@@ -56,6 +56,7 @@ namespace Coffee.UIParticleExtensions
var inst = gameObject.AddComponent<BakingCamera>();
inst._camera = gameObject.AddComponent<Camera>();
inst._camera.enabled = false;
inst._camera.orthographic = true;
// Turn camera off because particle mesh baker will use only camera matrix

View File

@@ -178,6 +178,11 @@ namespace Coffee.UIExtensions
particles.Exec(p => p.Stop());
}
public void Clear()
{
particles.Exec(p => p.Clear());
}
public void SetParticleSystemInstance(GameObject instance)
{
SetParticleSystemInstance(instance, true);
@@ -390,7 +395,6 @@ namespace Coffee.UIExtensions
#if !SERIALIZE_FIELD_MASKABLE
maskable = m_Maskable;
#endif
_cachedPosition = transform.position;
activeMeshIndices.Clear();
UIParticleUpdater.Register(this);
@@ -411,17 +415,20 @@ namespace Coffee.UIExtensions
private new IEnumerator Start()
{
// #147: ParticleSystem creates Particles in wrong position during prewarm
// #148: Particle Sub Emitter not showing when start game
var hasPlayingSubEmitter = particles.AnyFast(ps =>
var delayToPlay = particles.AnyFast(ps =>
{
ps.GetComponentsInChildren(false, s_ParticleSystems);
return s_ParticleSystems.AnyFast(p => p.isPlaying && p.subEmitters.enabled);
return s_ParticleSystems.AnyFast(p => p.isPlaying && (p.subEmitters.enabled || p.main.prewarm));
});
s_ParticleSystems.Clear();
if (!hasPlayingSubEmitter) yield break;
if (!delayToPlay) yield break;
Stop();
Clear();
yield return null;
Play();
}

View File

@@ -154,6 +154,9 @@ namespace Coffee.UIExtensions
particle.cachedPosition = position;
if (particle.activeMeshIndices.CountFast() == 0)
diff = Vector3.zero;
for (var i = 0; i < particle.particles.Count; i++)
{
Profiler.BeginSample("[UIParticle] Bake Mesh > Push index");

View File

@@ -2,7 +2,7 @@
"name": "com.coffee.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.",
"version": "3.3.4",
"version": "3.3.6",
"unity": "2018.2",
"license": "MIT",
"repository": {