You've already forked ParticleEffectForUGUI
mirror of
https://github.com/mob-sakai/ParticleEffectForUGUI.git
synced 2026-05-15 04:30:09 +00:00
Compare commits
11 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5f3ead2086 | ||
|
|
e3f42d747a | ||
|
|
b93e0e4701 | ||
|
|
9f9e04724d | ||
|
|
5981af6c0a | ||
|
|
f38240f527 | ||
|
|
d775e805fb | ||
|
|
d9eb91c120 | ||
|
|
13223b2d74 | ||
|
|
d5ce78ae5a | ||
|
|
3bb5241275 |
9
.github/workflows/release.yml
vendored
9
.github/workflows/release.yml
vendored
@@ -12,12 +12,13 @@ on:
|
|||||||
jobs:
|
jobs:
|
||||||
release:
|
release:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
if: "! contains(github.event.head_commit.message, '[skip ci]') && ! contains(github.event.head_commit.message, '[ci skip]')"
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v2
|
- uses: actions/checkout@v2
|
||||||
|
|
||||||
- run: |
|
- uses: cycjimmy/semantic-release-action@v2
|
||||||
npm i --no-save https://gist.github.com/mob-sakai/c90044338361af97a7e8c8a78425bdb3
|
with:
|
||||||
npx semantic-release -e @mob-sakai/semantic-release-upm
|
extra_plugins: |
|
||||||
|
@semantic-release/changelog
|
||||||
|
@semantic-release/git
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
|||||||
8
.github/workflows/test.yml
vendored
8
.github/workflows/test.yml
vendored
@@ -29,8 +29,6 @@ jobs:
|
|||||||
"2020.1.17f1",
|
"2020.1.17f1",
|
||||||
"2020.2.1f1",
|
"2020.2.1f1",
|
||||||
]
|
]
|
||||||
env:
|
|
||||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
# Checkout sandbox project
|
# Checkout sandbox project
|
||||||
@@ -64,9 +62,9 @@ jobs:
|
|||||||
uses: game-ci/unity-test-runner@main
|
uses: game-ci/unity-test-runner@main
|
||||||
with:
|
with:
|
||||||
unityVersion: ${{ matrix.unityVersion }}
|
unityVersion: ${{ matrix.unityVersion }}
|
||||||
customImage: ghcr.io/mob-sakai/unity3d:${{ matrix.unityVersion }}
|
customParameters: -nographics -enableCodeCoverage -coverageOptions assemblyFilters:+Coffee.UIParticle.*Tests
|
||||||
customParameters: -enableCodeCoverage
|
env:
|
||||||
# customParameters: -enableCodeCoverage -coverageOptions assemblyFilters:+CSharpCompilerSettings_,-*-CSharp,-*.Tests,-IgnoreAccessibility
|
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||||
|
|
||||||
- uses: actions/upload-artifact@v2
|
- uses: actions/upload-artifact@v2
|
||||||
if: always()
|
if: always()
|
||||||
|
|||||||
25
.releaserc.json
Normal file
25
.releaserc.json
Normal file
@@ -0,0 +1,25 @@
|
|||||||
|
{
|
||||||
|
"branches": [
|
||||||
|
"+([0-9])?(.{+([0-9]),x}).x",
|
||||||
|
"master",
|
||||||
|
"main",
|
||||||
|
{
|
||||||
|
"name": "preview",
|
||||||
|
"prerelease": true
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"tagFormat": "${version}",
|
||||||
|
"plugins": [
|
||||||
|
"@semantic-release/commit-analyzer",
|
||||||
|
"@semantic-release/release-notes-generator",
|
||||||
|
"@semantic-release/changelog",
|
||||||
|
[
|
||||||
|
"@semantic-release/npm",
|
||||||
|
{
|
||||||
|
"npmPublish": false
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"@semantic-release/git",
|
||||||
|
"@semantic-release/github"
|
||||||
|
]
|
||||||
|
}
|
||||||
17
CHANGELOG.md
17
CHANGELOG.md
@@ -1,3 +1,20 @@
|
|||||||
|
## [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)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* Multiselecting sets all scales to the same value ([13223b2](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/13223b2d747609cf88b424ad590bda7f857b387d))
|
||||||
|
* support sub emitter with 'PlayOnAwake' ([d5ce78a](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/d5ce78ae5acf2740ba7fdc6cde9f197c4e165484))
|
||||||
|
* The maximum material count is 8 ([3bb5241](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/3bb52412751360409747192150188ae904f2c3d3))
|
||||||
|
|
||||||
## [3.3.3](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/3.3.2...3.3.3) (2021-02-03)
|
## [3.3.3](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/3.3.2...3.3.3) (2021-02-03)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -250,20 +250,27 @@ namespace Coffee.UIExtensions
|
|||||||
EditorGUILayout.BeginHorizontal();
|
EditorGUILayout.BeginHorizontal();
|
||||||
if (showXyz)
|
if (showXyz)
|
||||||
{
|
{
|
||||||
|
EditorGUI.BeginChangeCheck();
|
||||||
EditorGUILayout.PropertyField(sp);
|
EditorGUILayout.PropertyField(sp);
|
||||||
|
if (EditorGUI.EndChangeCheck())
|
||||||
|
{
|
||||||
|
x.floatValue = Mathf.Max(0.001f, x.floatValue);
|
||||||
|
y.floatValue = Mathf.Max(0.001f, y.floatValue);
|
||||||
|
z.floatValue = Mathf.Max(0.001f, z.floatValue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
EditorGUI.BeginChangeCheck();
|
EditorGUI.BeginChangeCheck();
|
||||||
EditorGUILayout.PropertyField(x, s_ContentScale);
|
EditorGUILayout.PropertyField(x, s_ContentScale);
|
||||||
if (EditorGUI.EndChangeCheck())
|
if (EditorGUI.EndChangeCheck())
|
||||||
z.floatValue = y.floatValue = x.floatValue;
|
{
|
||||||
|
x.floatValue = Mathf.Max(0.001f, x.floatValue);
|
||||||
|
y.floatValue = Mathf.Max(0.001f, x.floatValue);
|
||||||
|
z.floatValue = Mathf.Max(0.001f, x.floatValue);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
x.floatValue = Mathf.Max(0.001f, x.floatValue);
|
|
||||||
y.floatValue = Mathf.Max(0.001f, y.floatValue);
|
|
||||||
z.floatValue = Mathf.Max(0.001f, z.floatValue);
|
|
||||||
|
|
||||||
EditorGUI.BeginChangeCheck();
|
EditorGUI.BeginChangeCheck();
|
||||||
showXyz = GUILayout.Toggle(showXyz, s_Content3D, EditorStyles.miniButton, GUILayout.Width(30));
|
showXyz = GUILayout.Toggle(showXyz, s_Content3D, EditorStyles.miniButton, GUILayout.Width(30));
|
||||||
if (EditorGUI.EndChangeCheck() && !showXyz)
|
if (EditorGUI.EndChangeCheck() && !showXyz)
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#if UNITY_2019_3_11 || UNITY_2019_3_12 || UNITY_2019_3_13 || UNITY_2019_3_14 || UNITY_2019_3_15 || UNITY_2019_4_OR_NEWER
|
#if UNITY_2019_3_11 || UNITY_2019_3_12 || UNITY_2019_3_13 || UNITY_2019_3_14 || UNITY_2019_3_15 || UNITY_2019_4_OR_NEWER
|
||||||
#define SERIALIZE_FIELD_MASKABLE
|
#define SERIALIZE_FIELD_MASKABLE
|
||||||
#endif
|
#endif
|
||||||
|
using System.Collections;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using Coffee.UIParticleExtensions;
|
using Coffee.UIParticleExtensions;
|
||||||
@@ -60,6 +61,7 @@ namespace Coffee.UIExtensions
|
|||||||
private static readonly List<Material> s_PrevMaskMaterials = new List<Material>();
|
private static readonly List<Material> s_PrevMaskMaterials = new List<Material>();
|
||||||
private static readonly List<Material> s_PrevModifiedMaterials = new List<Material>();
|
private static readonly List<Material> s_PrevModifiedMaterials = new List<Material>();
|
||||||
private static readonly List<Component> s_Components = new List<Component>();
|
private static readonly List<Component> s_Components = new List<Component>();
|
||||||
|
private static readonly List<ParticleSystem> s_ParticleSystems = new List<ParticleSystem>();
|
||||||
|
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -176,6 +178,11 @@ namespace Coffee.UIExtensions
|
|||||||
particles.Exec(p => p.Stop());
|
particles.Exec(p => p.Stop());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Clear()
|
||||||
|
{
|
||||||
|
particles.Exec(p => p.Clear());
|
||||||
|
}
|
||||||
|
|
||||||
public void SetParticleSystemInstance(GameObject instance)
|
public void SetParticleSystemInstance(GameObject instance)
|
||||||
{
|
{
|
||||||
SetParticleSystemInstance(instance, true);
|
SetParticleSystemInstance(instance, true);
|
||||||
@@ -266,7 +273,7 @@ namespace Coffee.UIExtensions
|
|||||||
|
|
||||||
//
|
//
|
||||||
GetComponents(typeof(IMaterialModifier), s_Components);
|
GetComponents(typeof(IMaterialModifier), s_Components);
|
||||||
var materialCount = Mathf.Max(8, count);
|
var materialCount = Mathf.Min(8, count);
|
||||||
canvasRenderer.materialCount = materialCount;
|
canvasRenderer.materialCount = materialCount;
|
||||||
var j = 0;
|
var j = 0;
|
||||||
for (var i = 0; i < particles.Count; i++)
|
for (var i = 0; i < particles.Count; i++)
|
||||||
@@ -388,7 +395,6 @@ namespace Coffee.UIExtensions
|
|||||||
#if !SERIALIZE_FIELD_MASKABLE
|
#if !SERIALIZE_FIELD_MASKABLE
|
||||||
maskable = m_Maskable;
|
maskable = m_Maskable;
|
||||||
#endif
|
#endif
|
||||||
_cachedPosition = transform.position;
|
|
||||||
activeMeshIndices.Clear();
|
activeMeshIndices.Clear();
|
||||||
|
|
||||||
UIParticleUpdater.Register(this);
|
UIParticleUpdater.Register(this);
|
||||||
@@ -407,6 +413,25 @@ namespace Coffee.UIExtensions
|
|||||||
InitializeIfNeeded();
|
InitializeIfNeeded();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private new IEnumerator Start()
|
||||||
|
{
|
||||||
|
// #147: ParticleSystem creates Particles in wrong position during prewarm
|
||||||
|
// #148: Particle Sub Emitter not showing when start game
|
||||||
|
var delayToPlay = particles.AnyFast(ps =>
|
||||||
|
{
|
||||||
|
ps.GetComponentsInChildren(false, s_ParticleSystems);
|
||||||
|
return s_ParticleSystems.AnyFast(p => p.isPlaying && (p.subEmitters.enabled || p.main.prewarm));
|
||||||
|
});
|
||||||
|
s_ParticleSystems.Clear();
|
||||||
|
if (!delayToPlay) yield break;
|
||||||
|
|
||||||
|
Stop();
|
||||||
|
Clear();
|
||||||
|
yield return null;
|
||||||
|
|
||||||
|
Play();
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// This function is called when the behaviour becomes disabled.
|
/// This function is called when the behaviour becomes disabled.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -154,6 +154,9 @@ namespace Coffee.UIExtensions
|
|||||||
|
|
||||||
particle.cachedPosition = position;
|
particle.cachedPosition = position;
|
||||||
|
|
||||||
|
if (particle.activeMeshIndices.CountFast() == 0)
|
||||||
|
diff = Vector3.zero;
|
||||||
|
|
||||||
for (var i = 0; i < particle.particles.Count; i++)
|
for (var i = 0; i < particle.particles.Count; i++)
|
||||||
{
|
{
|
||||||
Profiler.BeginSample("[UIParticle] Bake Mesh > Push index");
|
Profiler.BeginSample("[UIParticle] Bake Mesh > Push index");
|
||||||
|
|||||||
@@ -65,6 +65,16 @@ namespace Coffee.UIParticleExtensions
|
|||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static bool AnyFast<T>(this List<T> self, Predicate<T> predicate) where T : Object
|
||||||
|
{
|
||||||
|
for (var i = 0; i < self.Count; ++i)
|
||||||
|
{
|
||||||
|
if (self[i] && predicate(self[i])) return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal static class MeshExtensions
|
internal static class MeshExtensions
|
||||||
|
|||||||
@@ -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.3.3",
|
"version": "3.3.5",
|
||||||
"unity": "2018.2",
|
"unity": "2018.2",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
Reference in New Issue
Block a user