You've already forked ParticleEffectForUGUI
mirror of
https://github.com/mob-sakai/ParticleEffectForUGUI.git
synced 2026-05-14 20:20:06 +00:00
Compare commits
10 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
41e895a2db | ||
|
|
17ce81eb0e | ||
|
|
ba3b80db7a | ||
|
|
2a1f3345ba | ||
|
|
c0aa89bd6f | ||
|
|
501aa7b7f1 | ||
|
|
9313489552 | ||
|
|
63b36a45b9 | ||
|
|
087dbe99b9 | ||
|
|
d11cd0a06d |
96
.github/workflows/test.yml
vendored
Normal file
96
.github/workflows/test.yml
vendored
Normal file
@@ -0,0 +1,96 @@
|
||||
# Secrets
|
||||
# UNITY_LICENSE:
|
||||
name: test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
tags:
|
||||
- "!*"
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
|
||||
jobs:
|
||||
unity-test:
|
||||
runs-on: ubuntu-latest
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
unityVersion: [
|
||||
"2018.3.14f1",
|
||||
"2018.4.30f1",
|
||||
"2019.1.14f1",
|
||||
"2019.2.21f1",
|
||||
"2019.3.15f1",
|
||||
"2019.4.16f1",
|
||||
"2020.1.17f1",
|
||||
"2020.2.1f1",
|
||||
]
|
||||
env:
|
||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||
|
||||
steps:
|
||||
# Checkout sandbox project
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
ref: sandbox
|
||||
submodules: true
|
||||
fetch-depth: 0
|
||||
|
||||
# Update package submodule
|
||||
- name: "Update package submodule"
|
||||
working-directory: Packages/dev
|
||||
run: git checkout ${{ github.sha }}
|
||||
|
||||
- uses: actions/cache@v2
|
||||
with:
|
||||
path: Library
|
||||
key: Library-${{ matrix.unityVersion }}-${{ github.sha }}
|
||||
restore-keys: |
|
||||
Library-${{ matrix.unityVersion }}-
|
||||
Library-
|
||||
|
||||
# Install codecoverage package
|
||||
- name: "Install codecoverage package"
|
||||
if: startsWith(matrix.unityVersion, '2019.4.')
|
||||
run: |
|
||||
npx openupm-cli add -f com.unity.testtools.codecoverage@0.4.0-preview
|
||||
|
||||
# Run tests
|
||||
- name: "Run tests"
|
||||
uses: game-ci/unity-test-runner@main
|
||||
with:
|
||||
unityVersion: ${{ matrix.unityVersion }}
|
||||
customImage: ghcr.io/mob-sakai/unity3d:${{ matrix.unityVersion }}
|
||||
customParameters: -enableCodeCoverage
|
||||
# customParameters: -enableCodeCoverage -coverageOptions assemblyFilters:+CSharpCompilerSettings_,-*-CSharp,-*.Tests,-IgnoreAccessibility
|
||||
|
||||
- uses: actions/upload-artifact@v2
|
||||
if: always()
|
||||
with:
|
||||
name: TestResults-${{ matrix.unityVersion }}
|
||||
path: |
|
||||
artifacts/*.xml
|
||||
CodeCoverage/**/TestCoverageResults_*.xml
|
||||
|
||||
publish:
|
||||
needs: unity-test
|
||||
runs-on: ubuntu-latest
|
||||
if: always()
|
||||
steps:
|
||||
|
||||
- uses: actions/download-artifact@v2
|
||||
with:
|
||||
path: artifacts
|
||||
|
||||
- uses: testspace-com/setup-testspace@v1
|
||||
with:
|
||||
domain: ${{github.repository_owner}}
|
||||
|
||||
- name: Push test results
|
||||
if: always()
|
||||
run: |
|
||||
testspace `find . -name '*.xml' | tr '\n' ' '`
|
||||
100
.github/workflows/unity-test.yml
vendored
100
.github/workflows/unity-test.yml
vendored
@@ -1,100 +0,0 @@
|
||||
name: unity-test
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
tags:
|
||||
- "!*"
|
||||
pull_request:
|
||||
types:
|
||||
- opened
|
||||
- synchronize
|
||||
|
||||
jobs:
|
||||
unity-test:
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
unity:
|
||||
[
|
||||
"2018.3.14f1",
|
||||
"2018.4.25f1",
|
||||
"2019.1.14f1",
|
||||
"2019.2.11f1",
|
||||
"2019.3.15f1",
|
||||
"2019.4.8f1",
|
||||
"2020.1.5f1",
|
||||
]
|
||||
|
||||
runs-on: ubuntu-latest
|
||||
container:
|
||||
# Use Unity image from https://hub.docker.com/r/gableroux/unity3d/tags
|
||||
image: gableroux/unity3d:${{ matrix.unity }}
|
||||
|
||||
steps:
|
||||
# Activate Unity Editor
|
||||
- name: Activate Unity Editor
|
||||
id: activation
|
||||
run: |
|
||||
apt-get update > /dev/null
|
||||
apt-get install software-properties-common -y > /dev/null
|
||||
apt-add-repository ppa:git-core/ppa -y > /dev/null
|
||||
apt-get update > /dev/null
|
||||
apt-get install git -y > /dev/null
|
||||
git clone https://gist.github.com/135c940b45ec4e385861c8711777db7f.git .ulfs
|
||||
chmod 755 .ulfs/activate.sh && .ulfs/activate.sh ${{ matrix.unity }}
|
||||
|
||||
# (On failed activation) Upload unity activation file
|
||||
- name: Upload unity activation file
|
||||
uses: actions/upload-artifact@v2
|
||||
if: failure()
|
||||
with:
|
||||
name: Unity_v${{ matrix.unity }}.alf
|
||||
path: ./*.alf
|
||||
|
||||
# Checkout sandbox project
|
||||
- uses: actions/checkout@v2
|
||||
with:
|
||||
ref: "sandbox"
|
||||
submodules: "true"
|
||||
|
||||
# Update package submodule
|
||||
- name: "Update package submodule"
|
||||
working-directory: Packages/dev
|
||||
run: git checkout ${{ github.head_ref }}
|
||||
|
||||
# Install codecoverage package
|
||||
- name: "Install codecoverage package"
|
||||
if: always() && steps.activation.conclusion == 'success'
|
||||
run: |
|
||||
[ -n "`echo ${{ matrix.unity }} | grep -e '\(2017.\|2018.\|2019.1.\|2019.2.\)'`" ] && exit 0
|
||||
npm i -g openupm-cli
|
||||
openupm add com.unity.testtools.codecoverage
|
||||
|
||||
# Run playmode tests
|
||||
- name: "Run playmode tests"
|
||||
if: always() && steps.activation.conclusion == 'success'
|
||||
run: |
|
||||
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' \
|
||||
/opt/Unity/Editor/Unity -batchmode -nographics -silent-crashes -logFile -projectPath . \
|
||||
-runTests -testPlatform playmode -enableCodeCoverage
|
||||
|
||||
# Run editmode tests
|
||||
- name: "Run editmode tests"
|
||||
if: always() && steps.activation.conclusion == 'success'
|
||||
run: |
|
||||
xvfb-run --auto-servernum --server-args='-screen 0 640x480x24' \
|
||||
/opt/Unity/Editor/Unity -batchmode -nographics -silent-crashes -logFile -projectPath . \
|
||||
-runTests -testPlatform editmode -enableCodeCoverage
|
||||
|
||||
# Setup testspace
|
||||
- uses: testspace-com/setup-testspace@v1
|
||||
if: always() && steps.activation.conclusion == 'success'
|
||||
with:
|
||||
domain: ${{ github.repository_owner }}
|
||||
|
||||
# Push test results
|
||||
- name: Push test results
|
||||
if: always() && steps.activation.conclusion == 'success'
|
||||
run: testspace "[${{ matrix.unity }}]TestResults-*.xml" "[Code Coverage]CodeCoverage/**/TestCoverageResults_*.xml"
|
||||
23
CHANGELOG.md
23
CHANGELOG.md
@@ -1,3 +1,26 @@
|
||||
## [3.3.3](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/3.3.2...3.3.3) (2021-02-03)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* particle trails draw in wrong transform ([17ce81e](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/17ce81eb0eccb103c21fa553183df97429cf5c6f)), closes [#145](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/145)
|
||||
|
||||
## [3.3.2](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/3.3.1...3.3.2) (2021-02-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* _cachedPosition defaults to localPosition ([c0aa89b](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/c0aa89bd6f7847723a4702b6ca70fa202e8a8304)), closes [#121](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/121)
|
||||
* submeshes can't over 8 ([2a1f334](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/2a1f3345bacdecf38e8890781a181a1392224e35)), closes [#122](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/122)
|
||||
|
||||
## [3.3.1](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/3.3.0...3.3.1) (2021-02-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* ignore material check and transform check ([d11cd0a](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/d11cd0a06d76a32b2a119387bddc34c703b9b497)), closes [#119](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/119)
|
||||
* the trail is incorrect in SimulationSpace.Local ([9313489](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/9313489552b30f2e2b0b42a641f5e0502995b03d))
|
||||
|
||||
# [3.3.0](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/3.2.0...3.3.0) (2020-11-20)
|
||||
|
||||
|
||||
|
||||
@@ -204,19 +204,6 @@ namespace Coffee.UIExtensions
|
||||
DestroyUIParticle(current);
|
||||
return;
|
||||
}
|
||||
|
||||
current.GetComponentsInParent(true, s_TempParents);
|
||||
if (FixButton(1 < s_TempParents.Count, "This UIParticle component should be removed. The parent UIParticle exists."))
|
||||
{
|
||||
DestroyUIParticle(current);
|
||||
return;
|
||||
}
|
||||
|
||||
current.GetComponentsInChildren(true, s_TempChildren);
|
||||
if (FixButton(1 < s_TempChildren.Count, "The children UIParticle component should be removed."))
|
||||
{
|
||||
s_TempChildren.ForEach(child => DestroyUIParticle(child, true));
|
||||
}
|
||||
}
|
||||
|
||||
void DestroyUIParticle(UIParticle p, bool ignoreCurrent = false)
|
||||
|
||||
@@ -222,6 +222,7 @@ namespace Coffee.UIExtensions
|
||||
{
|
||||
if (!root) return;
|
||||
root.GetComponentsInChildren(particles);
|
||||
particles.RemoveAll(x => x.GetComponentInParent<UIParticle>() != this);
|
||||
|
||||
foreach (var ps in particles)
|
||||
{
|
||||
@@ -387,7 +388,7 @@ namespace Coffee.UIExtensions
|
||||
#if !SERIALIZE_FIELD_MASKABLE
|
||||
maskable = m_Maskable;
|
||||
#endif
|
||||
_cachedPosition = transform.localPosition;
|
||||
_cachedPosition = transform.position;
|
||||
activeMeshIndices.Clear();
|
||||
|
||||
UIParticleUpdater.Register(this);
|
||||
@@ -447,14 +448,6 @@ namespace Coffee.UIExtensions
|
||||
enabled = false;
|
||||
return;
|
||||
}
|
||||
else if (enabled && transform.parent && transform.parent.GetComponentInParent<UIParticle>())
|
||||
{
|
||||
UnityEngine.Debug.LogWarningFormat(this, "[UIParticle] The UIParticle component should be removed: {0}\nReason: The parent UIParticle exists.", name);
|
||||
gameObject.hideFlags = HideFlags.None;
|
||||
_shouldBeRemoved = true;
|
||||
enabled = false;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!this || particles.AnyFast()) return;
|
||||
|
||||
|
||||
@@ -241,6 +241,10 @@ namespace Coffee.UIExtensions
|
||||
var hash = currentPs.GetMaterialHash(true);
|
||||
if (hash != 0)
|
||||
{
|
||||
matrix = currentPs.main.simulationSpace == ParticleSystemSimulationSpace.Local && currentPs.trails.worldSpace
|
||||
? matrix * Matrix4x4.Translate(-currentPs.transform.position)
|
||||
: matrix;
|
||||
|
||||
var m = MeshHelper.GetTemporaryMesh();
|
||||
try
|
||||
{
|
||||
|
||||
@@ -9,8 +9,9 @@ namespace Coffee.UIParticleExtensions
|
||||
internal static class SpriteExtensions
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
private static Type tSpriteEditorExtension = Type.GetType("UnityEditor.Experimental.U2D.SpriteEditorExtension, UnityEditor")
|
||||
?? Type.GetType("UnityEditor.U2D.SpriteEditorExtension, UnityEditor");
|
||||
private static Type tSpriteEditorExtension =
|
||||
Type.GetType("UnityEditor.Experimental.U2D.SpriteEditorExtension, UnityEditor")
|
||||
?? Type.GetType("UnityEditor.U2D.SpriteEditorExtension, UnityEditor");
|
||||
|
||||
private static MethodInfo miGetActiveAtlasTexture = tSpriteEditorExtension
|
||||
.GetMethod("GetActiveAtlasTexture", BindingFlags.Static | BindingFlags.NonPublic);
|
||||
@@ -222,27 +223,18 @@ namespace Coffee.UIParticleExtensions
|
||||
if (!Mathf.Approximately(aPos, bPos))
|
||||
return (int) Mathf.Sign(bPos - aPos);
|
||||
|
||||
// Material instance ID: match
|
||||
if (aMat.GetInstanceID() == bMat.GetInstanceID())
|
||||
return 0;
|
||||
|
||||
// Transform: ascending
|
||||
return TransformCompare(aTransform, bTransform);
|
||||
return (int) Mathf.Sign(GetIndex(self, a) - GetIndex(self, b));
|
||||
});
|
||||
}
|
||||
|
||||
private static int TransformCompare(Transform a, Transform b)
|
||||
private static int GetIndex(IList<ParticleSystem> list, Object ps)
|
||||
{
|
||||
while (true)
|
||||
for (var i = 0; i < list.Count; i++)
|
||||
{
|
||||
if (!a && !b) return 0;
|
||||
if (!a) return -1;
|
||||
if (!b) return 1;
|
||||
if (a.parent == b.parent) return a.GetSiblingIndex() - b.GetSiblingIndex();
|
||||
|
||||
a = a.parent;
|
||||
b = b.parent;
|
||||
if (list[i].GetInstanceID() == ps.GetInstanceID()) return i;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static long GetMaterialHash(this ParticleSystem self, bool trail)
|
||||
|
||||
@@ -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.0",
|
||||
"version": "3.3.3",
|
||||
"unity": "2018.2",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
|
||||
Reference in New Issue
Block a user