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
36 Commits
v4.11.1
...
4f79848a7c
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
4f79848a7c | ||
|
|
d89d394e04 | ||
|
|
031d46a321 | ||
|
|
af0e98239b | ||
|
|
5384f61c56 | ||
|
|
a92d0b9280 | ||
|
|
fed927559f | ||
|
|
eb2e862e80 | ||
|
|
d1386a1221 | ||
|
|
a79ffb2c2b | ||
|
|
37fb189d72 | ||
|
|
9d56c94636 | ||
|
|
fe179c0f0f | ||
|
|
df2f3caafb | ||
|
|
1c8c65d25e | ||
|
|
a9461ecb4d | ||
|
|
38aec2ea1a | ||
|
|
9523ae12c0 | ||
|
|
96106370e5 | ||
|
|
bb2d588e0c | ||
|
|
078005a1a7 | ||
|
|
0cff50ef69 | ||
|
|
0da652520c | ||
|
|
4199492e3a | ||
|
|
1f88bb255e | ||
|
|
73d208e9b8 | ||
|
|
bfac4d4e2f | ||
|
|
88d956ece8 | ||
|
|
2842b3db7d | ||
|
|
c2958d5d7d | ||
|
|
7456b5d555 | ||
|
|
9955eefdc2 | ||
|
|
c09bfb81ab | ||
|
|
fab2ed1697 | ||
|
|
ef4dbc3cba | ||
|
|
27551a4d47 |
6
.github/CODEOWNERS
vendored
Normal file
6
.github/CODEOWNERS
vendored
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
# This is a comment.
|
||||||
|
# Each line is a file pattern followed by one or more owners.
|
||||||
|
# https://docs.github.com/ja/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/about-code-owners
|
||||||
|
|
||||||
|
# Default owners
|
||||||
|
* @mob-sakai
|
||||||
12
.github/FUNDING.yml
vendored
Normal file
12
.github/FUNDING.yml
vendored
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
# These are supported funding model platforms
|
||||||
|
|
||||||
|
github: mob-sakai # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
|
||||||
|
patreon: mob_sakai # Replace with a single Patreon username
|
||||||
|
open_collective: # Replace with a single Open Collective username
|
||||||
|
ko_fi: # Replace with a single Ko-fi username
|
||||||
|
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
|
||||||
|
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
|
||||||
|
liberapay: # Replace with a single Liberapay username
|
||||||
|
issuehunt: # Replace with a single IssueHunt username
|
||||||
|
otechie: # Replace with a single Otechie username
|
||||||
|
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
|
||||||
35
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
35
.github/ISSUE_TEMPLATE/bug_report.md
vendored
Normal file
@@ -0,0 +1,35 @@
|
|||||||
|
---
|
||||||
|
name: Bug report
|
||||||
|
about: Create a report to help us improve
|
||||||
|
title: ''
|
||||||
|
labels: bug
|
||||||
|
assignees: mob-sakai
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
NOTE: Your issue may already be reported! Please search on the [issue tracker](../) before creating one.
|
||||||
|
|
||||||
|
**Describe the bug**
|
||||||
|
A clear and concise description of what the bug is.
|
||||||
|
|
||||||
|
**To Reproduce**
|
||||||
|
Steps to reproduce the behavior:
|
||||||
|
1. Go to '...'
|
||||||
|
2. Click on '....'
|
||||||
|
3. Scroll down to '....'
|
||||||
|
4. See error
|
||||||
|
|
||||||
|
**Expected behavior**
|
||||||
|
A clear and concise description of what you expected to happen.
|
||||||
|
|
||||||
|
**Screenshots**
|
||||||
|
If applicable, add screenshots to help explain your problem.
|
||||||
|
|
||||||
|
**Environment (please complete the following information):**
|
||||||
|
- Version [e.g. 1.0.0]
|
||||||
|
- Platform: [e.g. Editor(Windows/Mac), Standalone(Windows/Mac), iOS, Android, WebGL]
|
||||||
|
- Unity version: [e.g. 2018.2.8f1]
|
||||||
|
- Build options: [e.g. IL2CPP, .Net 4.x, LWRP]
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context about the problem here.
|
||||||
22
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
22
.github/ISSUE_TEMPLATE/feature_request.md
vendored
Normal file
@@ -0,0 +1,22 @@
|
|||||||
|
---
|
||||||
|
name: Feature request
|
||||||
|
about: Suggest an idea for this project
|
||||||
|
title: ''
|
||||||
|
labels: enhancement
|
||||||
|
assignees: mob-sakai
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
NOTE: Your issue may already be reported! Please search on the [issue tracker](../) before creating one.
|
||||||
|
|
||||||
|
**Is your feature request related to a problem? Please describe.**
|
||||||
|
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
|
||||||
|
|
||||||
|
**Describe the solution you'd like**
|
||||||
|
A clear and concise description of what you want to happen.
|
||||||
|
|
||||||
|
**Describe alternatives you've considered**
|
||||||
|
A clear and concise description of any alternative solutions or features you've considered.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context or screenshots about the feature request here.
|
||||||
16
.github/ISSUE_TEMPLATE/question.md
vendored
Normal file
16
.github/ISSUE_TEMPLATE/question.md
vendored
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
---
|
||||||
|
name: Question
|
||||||
|
about: Ask a question about this project
|
||||||
|
title: ''
|
||||||
|
labels: question
|
||||||
|
assignees: mob-sakai
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
NOTE: Your issue may already be reported! Please search on the [issue tracker](../) before creating one.
|
||||||
|
|
||||||
|
**Describe what help do you need**
|
||||||
|
A description of the question.
|
||||||
|
|
||||||
|
**Additional context**
|
||||||
|
Add any other context or screenshots about the question here.
|
||||||
37
.github/pull_request_template.md
vendored
Normal file
37
.github/pull_request_template.md
vendored
Normal file
@@ -0,0 +1,37 @@
|
|||||||
|
|
||||||
|
# Pull Request Template
|
||||||
|
|
||||||
|
## Description
|
||||||
|
|
||||||
|
- Please include a summary of the change and which issue is fixed.
|
||||||
|
- Please also include relevant motivation and context.
|
||||||
|
- List any dependencies that are required for this change.
|
||||||
|
|
||||||
|
Fixes #{issue_number}
|
||||||
|
|
||||||
|
## Type of change
|
||||||
|
|
||||||
|
Please write the commit message in the format corresponding to the change type.
|
||||||
|
Please see [Conventional Commits](https://www.conventionalcommits.org/en/v1.0.0/) for more information.
|
||||||
|
|
||||||
|
- [ ] Bug fix (non-breaking change which fixes an issue)
|
||||||
|
- [ ] New feature (non-breaking change which adds functionality)
|
||||||
|
- [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
|
||||||
|
- [ ] Update documentations
|
||||||
|
- [ ] Others (refactoring, style changes, etc.)
|
||||||
|
|
||||||
|
## Test environment
|
||||||
|
|
||||||
|
- Platform: [e.g. Editor(Windows/Mac), Standalone(Windows/Mac), iOS, Android, WebGL]
|
||||||
|
- Unity version: [e.g. 2022.2.0f1]
|
||||||
|
- Build options: [e.g. IL2CPP, .Net 4.x, URP/HDRP]
|
||||||
|
|
||||||
|
## Checklist
|
||||||
|
|
||||||
|
- [ ] This pull request is for merging into the `develop` branch
|
||||||
|
- [ ] My code follows the style guidelines of this project
|
||||||
|
- [ ] I have performed a self-review of my own code
|
||||||
|
- [ ] I have commented my code, particularly in hard-to-understand areas
|
||||||
|
- [ ] I have made corresponding changes to the documentation
|
||||||
|
- [ ] My changes generate no new warnings
|
||||||
|
- [ ] I have checked my code and corrected any misspellings
|
||||||
28
.github/workflows/deploy.yml
vendored
Normal file
28
.github/workflows/deploy.yml
vendored
Normal file
@@ -0,0 +1,28 @@
|
|||||||
|
name: 🚀 Deploy with Zip
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
inputs:
|
||||||
|
zip:
|
||||||
|
description: "The url to the zip file"
|
||||||
|
required: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
deploy:
|
||||||
|
name: 🚀 Deploy
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
permissions:
|
||||||
|
pages: write
|
||||||
|
id-token: write
|
||||||
|
steps:
|
||||||
|
- name: 📦 Download zip file To '_site'
|
||||||
|
run: |
|
||||||
|
curl -L ${{ github.event.inputs.zip }} -o _site.zip
|
||||||
|
unzip _site.zip -d _site
|
||||||
|
find _site -name __MACOSX | xargs rm -rf
|
||||||
|
|
||||||
|
- name: 📦 Upload '_site'
|
||||||
|
uses: actions/upload-pages-artifact@v3
|
||||||
|
|
||||||
|
- name: 🚀 Deploy To GitHub Pages
|
||||||
|
uses: actions/deploy-pages@v4
|
||||||
65
.github/workflows/release.yml
vendored
65
.github/workflows/release.yml
vendored
@@ -5,8 +5,9 @@ on:
|
|||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- release
|
- preview
|
||||||
- release-*
|
- main
|
||||||
|
- v*.x
|
||||||
tags-ignore:
|
tags-ignore:
|
||||||
- "**"
|
- "**"
|
||||||
|
|
||||||
@@ -22,9 +23,6 @@ jobs:
|
|||||||
channel: ${{ steps.release.outputs.new_release_channel }}
|
channel: ${{ steps.release.outputs.new_release_channel }}
|
||||||
released: ${{ steps.release.outputs.new_release_published }}
|
released: ${{ steps.release.outputs.new_release_published }}
|
||||||
tag: ${{ steps.release.outputs.new_release_git_tag }}
|
tag: ${{ steps.release.outputs.new_release_git_tag }}
|
||||||
version: ${{ steps.release.outputs.new_release_version }}
|
|
||||||
merge_to: ${{ steps.summary.outputs.merge_to }}
|
|
||||||
split_to: ${{ steps.summary.outputs.split_to }}
|
|
||||||
steps:
|
steps:
|
||||||
- name: 🚚 Checkout (${{ github.ref_name }})
|
- name: 🚚 Checkout (${{ github.ref_name }})
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
@@ -40,62 +38,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
|
||||||
|
|
||||||
- id: summary
|
- run: |
|
||||||
run: |
|
|
||||||
echo "🔖 New release published: '${{ steps.release.outputs.new_release_published }}'" | tee -a $GITHUB_STEP_SUMMARY
|
echo "🔖 New release published: '${{ steps.release.outputs.new_release_published }}'" | tee -a $GITHUB_STEP_SUMMARY
|
||||||
echo "🔖 New release version: '${{ steps.release.outputs.new_release_version }}'" | tee -a $GITHUB_STEP_SUMMARY
|
|
||||||
echo "🔖 New release channel: '${{ steps.release.outputs.new_release_channel }}'" | tee -a $GITHUB_STEP_SUMMARY
|
echo "🔖 New release channel: '${{ steps.release.outputs.new_release_channel }}'" | tee -a $GITHUB_STEP_SUMMARY
|
||||||
echo "🔖 New release git tag: '${{ steps.release.outputs.new_release_git_tag }}'" | tee -a $GITHUB_STEP_SUMMARY
|
echo "🔖 New release git tag: '${{ steps.release.outputs.new_release_git_tag }}'" | tee -a $GITHUB_STEP_SUMMARY
|
||||||
|
|
||||||
if [ '${{ steps.release.outputs.new_release_published }}' = 'false' ]; then
|
|
||||||
echo "No new release published." | tee -a $GITHUB_STEP_SUMMARY
|
|
||||||
elif [ '${{ github.ref_name }}' = 'release' ]; then
|
|
||||||
echo "merge_to=develop" | tee -a $GITHUB_OUTPUT $GITHUB_STEP_SUMMARY
|
|
||||||
echo "split_to=main" | tee -a $GITHUB_OUTPUT $GITHUB_STEP_SUMMARY
|
|
||||||
else
|
|
||||||
channel=$(echo ${{ github.ref_name }} | sed 's/^release-//')
|
|
||||||
echo "merge_to=develop-${channel}" | tee -a $GITHUB_OUTPUT $GITHUB_STEP_SUMMARY
|
|
||||||
echo "split_to=${channel}" | tee -a $GITHUB_OUTPUT $GITHUB_STEP_SUMMARY
|
|
||||||
fi
|
|
||||||
|
|
||||||
merge-to:
|
|
||||||
if: needs.release.outputs.merge_to != ''
|
|
||||||
needs: release
|
|
||||||
name: 🔀 Merge to ${{ needs.release.outputs.merge_to }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
steps:
|
|
||||||
- name: 🚚 Checkout (${{ needs.release.outputs.merge_to }})
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
ref: ${{ needs.release.outputs.merge_to }}
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: 🔀 Merge '${{ needs.release.outputs.tag }}' into '${{ needs.release.outputs.merge_to }}'
|
|
||||||
run: |
|
|
||||||
git config --local user.email "github-actions[bot]@users.noreply.github.com"
|
|
||||||
git config --local user.name "github-actions[bot]"
|
|
||||||
|
|
||||||
git merge ${{ needs.release.outputs.tag }}
|
|
||||||
git push origin ${{ needs.release.outputs.merge_to }}
|
|
||||||
|
|
||||||
split-to:
|
|
||||||
if: needs.release.outputs.split_to != ''
|
|
||||||
needs: release
|
|
||||||
name: 🔀 Split package to ${{ needs.release.outputs.split_to }}
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
permissions:
|
|
||||||
contents: write
|
|
||||||
steps:
|
|
||||||
- name: 🚚 Checkout (${{ needs.release.outputs.tag }})
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
ref: ${{ needs.release.outputs.tag }}
|
|
||||||
fetch-depth: 0
|
|
||||||
- name: 🔀 Split subtree 'Packages/src' to '${{ needs.release.outputs.split_to }}'
|
|
||||||
run: |
|
|
||||||
split_to=${{ needs.release.outputs.split_to }}
|
|
||||||
git branch $split_to origin/$split_to
|
|
||||||
git subtree split --prefix=Packages/src --branch $split_to
|
|
||||||
git tag ${{ needs.release.outputs.version }} $split_to
|
|
||||||
git push origin ${{ needs.release.outputs.version }} $split_to:$split_to
|
|
||||||
|
|||||||
22
.github/workflows/test.yml
vendored
22
.github/workflows/test.yml
vendored
@@ -10,6 +10,7 @@ env:
|
|||||||
MINIMUM_VERSION: 2019.4
|
MINIMUM_VERSION: 2019.4
|
||||||
# EXCLUDE_FILTER: The excluded versions of Unity.
|
# EXCLUDE_FILTER: The excluded versions of Unity.
|
||||||
EXCLUDE_FILTER: "(2020.2.0|2021.1|2023.3)"
|
EXCLUDE_FILTER: "(2020.2.0|2021.1|2023.3)"
|
||||||
|
PROJECT_PATH: .
|
||||||
|
|
||||||
on:
|
on:
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
@@ -21,7 +22,7 @@ on:
|
|||||||
push:
|
push:
|
||||||
branches:
|
branches:
|
||||||
- develop
|
- develop
|
||||||
- develop-preview
|
- "develop-*"
|
||||||
tags:
|
tags:
|
||||||
- "!*"
|
- "!*"
|
||||||
paths-ignore:
|
paths-ignore:
|
||||||
@@ -71,11 +72,11 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- name: 🚚 Checkout ($${{ github.ref }})
|
- name: 🚚 Checkout ($${{ github.ref }})
|
||||||
if: github.event_name == 'push'
|
if: github.event_name == 'push'
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
|
|
||||||
- name: 🚚 Checkout pull request (pull_request_target)
|
- name: 🚚 Checkout pull request (pull_request_target)
|
||||||
if: github.event_name == 'pull_request_target'
|
if: github.event_name == 'pull_request_target'
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v5
|
||||||
with:
|
with:
|
||||||
ref: ${{ github.event.pull_request.head.sha }}
|
ref: ${{ github.event.pull_request.head.sha }}
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
@@ -85,25 +86,27 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
git config user.name "GitHub Actions"
|
git config user.name "GitHub Actions"
|
||||||
git config user.email "actions@github.com"
|
git config user.email "actions@github.com"
|
||||||
git merge origin/${{ github.event.pull_request.base.ref }} --no-edit
|
git rebase ${{ github.event.pull_request.base.sha }}
|
||||||
|
git log --oneline -n 10
|
||||||
|
|
||||||
- name: 📥 Cache library
|
- name: 📥 Cache library
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: Library
|
path: ${{ env.PROJECT_PATH }}/Library
|
||||||
key: Library-${{ matrix.unityVersion }}-${{ github.event.pull_request.head.sha || github.sha }}
|
key: ${{ env.PROJECT_PATH }}-Library-${{ matrix.unityVersion }}-${{ github.event.pull_request.head.sha || github.sha }}
|
||||||
restore-keys: |
|
restore-keys: |
|
||||||
Library-${{ matrix.unityVersion }}-
|
${{ env.PROJECT_PATH }}-Library-${{ matrix.unityVersion }}-
|
||||||
Library-
|
${{ env.PROJECT_PATH }}-Library-
|
||||||
|
|
||||||
- name: 🛠️ Build Unity Project (Test)
|
- name: 🛠️ Build Unity Project (Test)
|
||||||
uses: game-ci/unity-builder@v4
|
uses: game-ci/unity-builder@main
|
||||||
timeout-minutes: 45
|
timeout-minutes: 45
|
||||||
with:
|
with:
|
||||||
customImage: ghcr.io/mob-sakai/unity3d:${{ matrix.unityVersion }}
|
customImage: ghcr.io/mob-sakai/unity3d:${{ matrix.unityVersion }}
|
||||||
targetPlatform: StandaloneLinux64
|
targetPlatform: StandaloneLinux64
|
||||||
allowDirtyBuild: true
|
allowDirtyBuild: true
|
||||||
customParameters: -nographics
|
customParameters: -nographics
|
||||||
|
projectPath: ${{ env.PROJECT_PATH }}
|
||||||
env:
|
env:
|
||||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||||
@@ -118,6 +121,7 @@ jobs:
|
|||||||
customParameters: -nographics
|
customParameters: -nographics
|
||||||
checkName: ${{ matrix.unityVersion }} Test Results
|
checkName: ${{ matrix.unityVersion }} Test Results
|
||||||
githubToken: ${{ github.token }}
|
githubToken: ${{ github.token }}
|
||||||
|
projectPath: ${{ env.PROJECT_PATH }}
|
||||||
env:
|
env:
|
||||||
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
|
||||||
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
|
||||||
|
|||||||
@@ -18,11 +18,12 @@ MonoBehaviour:
|
|||||||
m_EnabledInEditor: 1
|
m_EnabledInEditor: 1
|
||||||
m_AlwaysIncludeAssembly: 1
|
m_AlwaysIncludeAssembly: 1
|
||||||
m_InstantiateOnLoad: 1
|
m_InstantiateOnLoad: 1
|
||||||
m_Prefab: {fileID: 7211429669315726685, guid: b73940fc30a2f4eb9a73783e9c1f8da6,
|
m_Prefab: {fileID: 4567906826058368312, guid: 7cebff2d255b9433cbe23b243c193329,
|
||||||
type: 3}
|
type: 3}
|
||||||
m_Interval: 0.5
|
m_Interval: 0.5
|
||||||
m_Anchor: 0
|
m_Anchor: 0
|
||||||
m_Width: 750
|
m_Width: 750
|
||||||
|
m_HelpUrl: https://github.com/mob-sakai/ParticleEffectForUGUI
|
||||||
m_CustomMonitorItems:
|
m_CustomMonitorItems:
|
||||||
- m_Format: Screen:{0}x{1}
|
- m_Format: Screen:{0}x{1}
|
||||||
m_Arg0:
|
m_Arg0:
|
||||||
|
|||||||
File diff suppressed because it is too large
Load Diff
@@ -1,7 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: b73940fc30a2f4eb9a73783e9c1f8da6
|
|
||||||
PrefabImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -10,7 +10,7 @@ MonoBehaviour:
|
|||||||
m_Enabled: 1
|
m_Enabled: 1
|
||||||
m_EditorHideFlags: 0
|
m_EditorHideFlags: 0
|
||||||
m_Script: {fileID: 11500000, guid: f22a23b9d98e440478697f4adf30e61c, type: 3}
|
m_Script: {fileID: 11500000, guid: f22a23b9d98e440478697f4adf30e61c, type: 3}
|
||||||
m_Name: UIParticle
|
m_Name: UIParticleProjectSettings
|
||||||
m_EditorClassIdentifier:
|
m_EditorClassIdentifier:
|
||||||
m_EnableLinearToGamma: 1
|
m_EnableLinearToGamma: 1
|
||||||
m_HideGeneratedObjects: 1
|
m_HideGeneratedObjects: 1
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
fileFormatVersion: 2
|
fileFormatVersion: 2
|
||||||
guid: 4b9df7b8a4193489299b8f477348ae0c
|
guid: a5b9278dfbd194d04b1c6ae7031928c1
|
||||||
NativeFormatImporter:
|
NativeFormatImporter:
|
||||||
externalObjects: {}
|
externalObjects: {}
|
||||||
mainObjectFileID: 11400000
|
mainObjectFileID: 11400000
|
||||||
@@ -1,16 +1,21 @@
|
|||||||
using System.Collections;
|
using System.Collections;
|
||||||
|
using Coffee.UIParticleInternal;
|
||||||
using NUnit.Framework;
|
using NUnit.Framework;
|
||||||
|
using UnityEngine;
|
||||||
using UnityEngine.TestTools;
|
using UnityEngine.TestTools;
|
||||||
|
|
||||||
namespace Coffee.UIParticle.Editor.Tests
|
namespace Coffee.UIParticle.Editor.Tests
|
||||||
{
|
{
|
||||||
public class NewTestScript
|
public class NewTestScript
|
||||||
{
|
{
|
||||||
// A Test behaves as an ordinary method
|
[TestCase(-1)]
|
||||||
[Test]
|
[TestCase(0)]
|
||||||
public void NewTestScriptSimplePasses()
|
[TestCase(2048)]
|
||||||
|
[TestCase(3000)]
|
||||||
|
public void GetParticleArray(int requiredSize)
|
||||||
{
|
{
|
||||||
// Use the Assert class to test conditions
|
var array = ParticleSystemExtensions.GetParticleArray(requiredSize);
|
||||||
|
Debug.Log($"requiredSize: {requiredSize}, array.Length: {array.Length}");
|
||||||
}
|
}
|
||||||
|
|
||||||
// A UnityTest behaves like a coroutine in Play Mode. In Edit Mode you can use
|
// A UnityTest behaves like a coroutine in Play Mode. In Edit Mode you can use
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
"depth": 0,
|
"depth": 0,
|
||||||
"source": "git",
|
"source": "git",
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"hash": "52987fb6e66e7fc48498d8d164c3c8808de4de6b"
|
"hash": "3c280f1a8f4db5038b881ff07f270efd9638fa31"
|
||||||
},
|
},
|
||||||
"com.coffee.minimal-resource": {
|
"com.coffee.minimal-resource": {
|
||||||
"version": "https://github.com/mob-sakai/Coffee.Internal.git?path=Packages/MinimalResource",
|
"version": "https://github.com/mob-sakai/Coffee.Internal.git?path=Packages/MinimalResource",
|
||||||
"depth": 0,
|
"depth": 0,
|
||||||
"source": "git",
|
"source": "git",
|
||||||
"dependencies": {},
|
"dependencies": {},
|
||||||
"hash": "52987fb6e66e7fc48498d8d164c3c8808de4de6b"
|
"hash": "3c280f1a8f4db5038b881ff07f270efd9638fa31"
|
||||||
},
|
},
|
||||||
"com.coffee.nano-monitor": {
|
"com.coffee.nano-monitor": {
|
||||||
"version": "https://github.com/mob-sakai/Coffee.Internal.git?path=Packages/NanoMonitor",
|
"version": "https://github.com/mob-sakai/Coffee.Internal.git?path=Packages/NanoMonitor",
|
||||||
@@ -21,7 +21,7 @@
|
|||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.unity.ugui": "1.0.0"
|
"com.unity.ugui": "1.0.0"
|
||||||
},
|
},
|
||||||
"hash": "52987fb6e66e7fc48498d8d164c3c8808de4de6b"
|
"hash": "3c280f1a8f4db5038b881ff07f270efd9638fa31"
|
||||||
},
|
},
|
||||||
"com.coffee.ui-particle": {
|
"com.coffee.ui-particle": {
|
||||||
"version": "file:src",
|
"version": "file:src",
|
||||||
|
|||||||
@@ -1,12 +1,13 @@
|
|||||||
{
|
{
|
||||||
"branches": [
|
"branches": [
|
||||||
"release",
|
"main",
|
||||||
"release-4.x",
|
"[0-9]+.x",
|
||||||
{
|
{
|
||||||
"name": "release-preview",
|
"name": "preview",
|
||||||
"prerelease": "preview"
|
"prerelease": true
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
|
"tagFormat": "${version}",
|
||||||
"plugins": [
|
"plugins": [
|
||||||
"@semantic-release/commit-analyzer",
|
"@semantic-release/commit-analyzer",
|
||||||
"@semantic-release/release-notes-generator",
|
"@semantic-release/release-notes-generator",
|
||||||
|
|||||||
@@ -1,25 +1,25 @@
|
|||||||
## [4.11.1](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v4.11.0...v4.11.1) (2025-02-21)
|
# [5.0.0-preview.16](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/5.0.0-preview.15...5.0.0-preview.16) (2025-03-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* IL2CPP build fails on older versions of Unity ([0da6525](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/0da652520cd165b43de7404c0b0ab1fbcf9349d1))
|
||||||
|
* NRE on enable ([0cff50e](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/0cff50ef696aa53fb7c46a9a737b7cf3a05b7b9b)), closes [#359](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/359)
|
||||||
|
|
||||||
|
# [5.0.0-preview.15](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/5.0.0-preview.14...5.0.0-preview.15) (2025-02-21)
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
|
|
||||||
* component icons will no longer be displayed in the scene view ([6dfbdae](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/6dfbdae38d3822ab9c2c6f0e4ca1ca32ee98a239))
|
* component icons will no longer be displayed in the scene view ([6dfbdae](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/6dfbdae38d3822ab9c2c6f0e4ca1ca32ee98a239))
|
||||||
|
* editor crashed on exit play mode (editor, windows) ([47ee45c](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/47ee45cbbe651a8f87ca2b8a3948f8b88db8211e)), closes [#351](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/351)
|
||||||
# [4.11.0](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v4.10.7...v4.11.0) (2025-02-21)
|
|
||||||
|
|
||||||
|
|
||||||
### Features
|
### Features
|
||||||
|
|
||||||
* add 'TimeScaleMultiplier' option ([925af0b](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/925af0b6046f65f23a778f67cefa8ff9cbedb513))
|
* add 'TimeScaleMultiplier' option ([925af0b](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/925af0b6046f65f23a778f67cefa8ff9cbedb513))
|
||||||
|
|
||||||
## [4.10.7](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v4.10.6...v4.10.7) (2025-01-14)
|
# [5.0.0-preview.14](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/5.0.0-preview.13...5.0.0-preview.14) (2025-01-03)
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
|
||||||
|
|
||||||
* editor crashed on exit play mode (editor, windows) ([47ee45c](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/47ee45cbbe651a8f87ca2b8a3948f8b88db8211e)), closes [#351](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/351)
|
|
||||||
|
|
||||||
## [4.10.6](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v4.10.5...v4.10.6) (2025-01-03)
|
|
||||||
|
|
||||||
|
|
||||||
### Bug Fixes
|
### Bug Fixes
|
||||||
@@ -27,6 +27,19 @@
|
|||||||
* sub-emitter particles may not render correctly in certain scenarios ([8276684](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/8276684c3b1646f0490ed64557547ba15281664a)), closes [#348](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/348)
|
* sub-emitter particles may not render correctly in certain scenarios ([8276684](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/8276684c3b1646f0490ed64557547ba15281664a)), closes [#348](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/348)
|
||||||
* sub-emitter's `inherit velocity` module doubles at runtime ([67de3d1](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/67de3d1bd3e16dc9b564625cb990c53d75769506)), closes [#349](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/349)
|
* sub-emitter's `inherit velocity` module doubles at runtime ([67de3d1](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/67de3d1bd3e16dc9b564625cb990c53d75769506)), closes [#349](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/349)
|
||||||
|
|
||||||
|
# [5.0.0-preview.13](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/5.0.0-preview.12...5.0.0-preview.13) (2025-01-03)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* change the default value of `UIParticle.scale` from `10` to `1` ([9955eef](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/9955eefdc22cf565502f85c87cd2efd3a25fbe50))
|
||||||
|
* UIParticle no longer inherits from MaskableGraphic ([c09bfb8](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/c09bfb81abc9179bf5fc49d29eaf7fc4ed01a4dc))
|
||||||
|
|
||||||
|
|
||||||
|
### BREAKING CHANGES
|
||||||
|
|
||||||
|
* Some members inherited from MaskableGraphic will no longer be available.
|
||||||
|
|
||||||
## [4.10.5](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v4.10.4...v4.10.5) (2024-12-23)
|
## [4.10.5](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v4.10.4...v4.10.5) (2024-12-23)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -76,7 +76,7 @@ namespace Coffee.UIExtensions
|
|||||||
for (var j = 0; j < mats.Count; j++)
|
for (var j = 0; j < mats.Count; j++)
|
||||||
{
|
{
|
||||||
var mat = mats[j];
|
var mat = mats[j];
|
||||||
if (!mat || !mat.shader) continue;
|
if (mat == null || mat.shader == null) continue;
|
||||||
|
|
||||||
for (var i = 0; i < ShaderUtil.GetPropertyCount(mat.shader); i++)
|
for (var i = 0; i < ShaderUtil.GetPropertyCount(mat.shader); i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,7 +2,6 @@ using System.Collections.Generic;
|
|||||||
using System.Linq;
|
using System.Linq;
|
||||||
using System.Text.RegularExpressions;
|
using System.Text.RegularExpressions;
|
||||||
using UnityEditor;
|
using UnityEditor;
|
||||||
using UnityEditor.UI;
|
|
||||||
using UnityEditorInternal;
|
using UnityEditorInternal;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
using UnityEngine.Profiling;
|
using UnityEngine.Profiling;
|
||||||
@@ -26,7 +25,7 @@ namespace Coffee.UIExtensions
|
|||||||
{
|
{
|
||||||
[CustomEditor(typeof(UIParticle))]
|
[CustomEditor(typeof(UIParticle))]
|
||||||
[CanEditMultipleObjects]
|
[CanEditMultipleObjects]
|
||||||
internal class UIParticleEditor : GraphicEditor
|
internal class UIParticleEditor : Editor
|
||||||
{
|
{
|
||||||
internal class State : ScriptableSingleton<State>
|
internal class State : ScriptableSingleton<State>
|
||||||
{
|
{
|
||||||
@@ -87,10 +86,8 @@ namespace Coffee.UIExtensions
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// This function is called when the object becomes enabled and active.
|
/// This function is called when the object becomes enabled and active.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
protected override void OnEnable()
|
private void OnEnable()
|
||||||
{
|
{
|
||||||
base.OnEnable();
|
|
||||||
|
|
||||||
_maskable = serializedObject.FindProperty("m_Maskable");
|
_maskable = serializedObject.FindProperty("m_Maskable");
|
||||||
_scale3D = serializedObject.FindProperty("m_Scale3D");
|
_scale3D = serializedObject.FindProperty("m_Scale3D");
|
||||||
_animatableProperties = serializedObject.FindProperty("m_AnimatableProperties");
|
_animatableProperties = serializedObject.FindProperty("m_AnimatableProperties");
|
||||||
@@ -110,7 +107,7 @@ namespace Coffee.UIExtensions
|
|||||||
{
|
{
|
||||||
var ps = sp.GetArrayElementAtIndex(index).objectReferenceValue as ParticleSystem;
|
var ps = sp.GetArrayElementAtIndex(index).objectReferenceValue as ParticleSystem;
|
||||||
var materialCount = 0;
|
var materialCount = 0;
|
||||||
if (ps && ps.TryGetComponent<ParticleSystemRenderer>(out var psr))
|
if (ps != null && ps.TryGetComponent<ParticleSystemRenderer>(out var psr))
|
||||||
{
|
{
|
||||||
materialCount = psr.sharedMaterials.Length;
|
materialCount = psr.sharedMaterials.Length;
|
||||||
}
|
}
|
||||||
@@ -124,7 +121,7 @@ namespace Coffee.UIExtensions
|
|||||||
var p = sp.GetArrayElementAtIndex(index);
|
var p = sp.GetArrayElementAtIndex(index);
|
||||||
EditorGUI.ObjectField(rect, p, GUIContent.none);
|
EditorGUI.ObjectField(rect, p, GUIContent.none);
|
||||||
var ps = p.objectReferenceValue as ParticleSystem;
|
var ps = p.objectReferenceValue as ParticleSystem;
|
||||||
if (!ps || !ps.TryGetComponent<ParticleSystemRenderer>(out var psr)) return;
|
if (ps == null || !ps.TryGetComponent<ParticleSystemRenderer>(out var psr)) return;
|
||||||
|
|
||||||
rect.x += 15;
|
rect.x += 15;
|
||||||
rect.width -= 15;
|
rect.width -= 15;
|
||||||
@@ -191,7 +188,7 @@ namespace Coffee.UIExtensions
|
|||||||
public override void OnInspectorGUI()
|
public override void OnInspectorGUI()
|
||||||
{
|
{
|
||||||
var current = target as UIParticle;
|
var current = target as UIParticle;
|
||||||
if (!current) return;
|
if (current == null) return;
|
||||||
|
|
||||||
Profiler.BeginSample("(UIP:E) OnInspectorGUI");
|
Profiler.BeginSample("(UIP:E) OnInspectorGUI");
|
||||||
serializedObject.Update();
|
serializedObject.Update();
|
||||||
@@ -267,7 +264,7 @@ namespace Coffee.UIExtensions
|
|||||||
Profiler.BeginSample("(UIP:E) Non-UI built-in shader is not supported.");
|
Profiler.BeginSample("(UIP:E) Non-UI built-in shader is not supported.");
|
||||||
foreach (var mat in s_TempMaterials)
|
foreach (var mat in s_TempMaterials)
|
||||||
{
|
{
|
||||||
if (!mat || !mat.shader) continue;
|
if (mat == null || mat.shader == null) continue;
|
||||||
var shader = mat.shader;
|
var shader = mat.shader;
|
||||||
if (IsBuiltInObject(shader) && !shader.name.StartsWith("UI/"))
|
if (IsBuiltInObject(shader) && !shader.name.StartsWith("UI/"))
|
||||||
{
|
{
|
||||||
@@ -286,7 +283,7 @@ namespace Coffee.UIExtensions
|
|||||||
{
|
{
|
||||||
foreach (var mat in s_TempMaterials)
|
foreach (var mat in s_TempMaterials)
|
||||||
{
|
{
|
||||||
if (!mat || !mat.shader) continue;
|
if (mat == null || mat.shader == null) continue;
|
||||||
var shader = mat.shader;
|
var shader = mat.shader;
|
||||||
if (!s_Shaders.Add(shader)) continue;
|
if (!s_Shaders.Add(shader)) continue;
|
||||||
|
|
||||||
@@ -464,9 +461,11 @@ namespace Coffee.UIExtensions
|
|||||||
{
|
{
|
||||||
if (!p || (ignoreCurrent && target == p)) return;
|
if (!p || (ignoreCurrent && target == p)) return;
|
||||||
|
|
||||||
var cr = p.canvasRenderer;
|
Misc.DestroyImmediate(p);
|
||||||
DestroyImmediate(p);
|
if (p.TryGetComponent<CanvasRenderer>(out var cr))
|
||||||
DestroyImmediate(cr);
|
{
|
||||||
|
Misc.DestroyImmediate(cr);
|
||||||
|
}
|
||||||
|
|
||||||
#if UNITY_2018_3_OR_NEWER
|
#if UNITY_2018_3_OR_NEWER
|
||||||
var stage = PrefabStageUtility.GetCurrentPrefabStage();
|
var stage = PrefabStageUtility.GetCurrentPrefabStage();
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 418 B After Width: | Height: | Size: 418 B |
@@ -1,8 +0,0 @@
|
|||||||
fileFormatVersion: 2
|
|
||||||
guid: 7a55e246f37df405bac88eac692e3a86
|
|
||||||
folderAsset: yes
|
|
||||||
DefaultImporter:
|
|
||||||
externalObjects: {}
|
|
||||||
userData:
|
|
||||||
assetBundleName:
|
|
||||||
assetBundleVariant:
|
|
||||||
@@ -1,9 +1,9 @@
|
|||||||
# <img alt="UIParticleIcon" src="https://github.com/mob-sakai/ParticleEffectForUGUI/assets/12690315/d76e105e-a840-4f61-a1f6-8cf311c0812d" width="26"/> Particle Effect For UGUI (UI Particle) <!-- omit in toc -->
|
# <img alt="UIParticleIcon" src="https://github.com/mob-sakai/ParticleEffectForUGUI/assets/12690315/d76e105e-a840-4f61-a1f6-8cf311c0812d" width="26"/> UI Particle v5 <!-- omit in toc -->
|
||||||
|
|
||||||
[](https://openupm.com/packages/com.coffee.ui-particle/)
|
[](https://openupm.com/packages/com.coffee.ui-particle/)
|
||||||
[](https://github.com/mob-sakai/ParticleEffectForUGUI/releases)
|
[](https://github.com/mob-sakai/ParticleEffectForUGUI/releases)
|
||||||
[](https://github.com/mob-sakai/ParticleEffectForUGUI/blob/main/LICENSE.md)
|
[](https://github.com/mob-sakai/ParticleEffectForUGUI/blob/main/LICENSE.md)
|
||||||

|

|
||||||

|

|
||||||

|

|
||||||

|

|
||||||
@@ -11,7 +11,7 @@
|
|||||||
[](https://github.com/mob-sakai/ParticleEffectForUGUI/subscription)
|
[](https://github.com/mob-sakai/ParticleEffectForUGUI/subscription)
|
||||||
[](https://twitter.com/intent/follow?screen_name=mob_sakai)
|
[](https://twitter.com/intent/follow?screen_name=mob_sakai)
|
||||||
|
|
||||||
<< [📝 Description](#-description-) | [📌 Key Features](#-key-features) | [🎮 Demo](#-demo) | [⚙ Installation](#-installation) | [🚀 Usage](#-usage) | [🛠 Development Note](#-development-note) | [🤝 Contributing](#-contributing) >>
|
<< [📝 Description](#-description-) | [📌 Key Features](#-key-features) | [🎮 Demo](#-demo) | [⚙ Installation](#-installation) | [🔄 Upgrading to 5.x](#-upgrading-from-3x4x-to-5x) | [🚀 Usage](#-usage) | [🛠 Development Note](#-development-note) | [🤝 Contributing](#-contributing) >>
|
||||||
|
|
||||||
## 📝 Description <!-- omit in toc -->
|
## 📝 Description <!-- omit in toc -->
|
||||||
|
|
||||||
@@ -26,7 +26,9 @@ You can render, mask, and sort your `ParticleSystems` for UI without the need fo
|
|||||||
- [Install via OpenUPM](#install-via-openupm)
|
- [Install via OpenUPM](#install-via-openupm)
|
||||||
- [Install via UPM (with Package Manager UI)](#install-via-upm-with-package-manager-ui)
|
- [Install via UPM (with Package Manager UI)](#install-via-upm-with-package-manager-ui)
|
||||||
- [Install via UPM (Manually)](#install-via-upm-manually)
|
- [Install via UPM (Manually)](#install-via-upm-manually)
|
||||||
- [Install as Embedded Package](#install-as-embedded-package)
|
- [Install as Embedded Package](#install-as-embedded-package)
|
||||||
|
- [🔄 Upgrading from v3/v4 to v5](#-upgrading-from-v3v4-to-v5)
|
||||||
|
- [Breaking Changes](#breaking-changes)
|
||||||
- [🚀 Usage](#-usage)
|
- [🚀 Usage](#-usage)
|
||||||
- [Component: UIParticle](#component-uiparticle)
|
- [Component: UIParticle](#component-uiparticle)
|
||||||
- [Basic Usage](#basic-usage)
|
- [Basic Usage](#basic-usage)
|
||||||
@@ -104,7 +106,7 @@ You can render, mask, and sort your `ParticleSystems` for UI without the need fo
|
|||||||
|
|
||||||
## ⚙ Installation
|
## ⚙ Installation
|
||||||
|
|
||||||
_This package requires **Unity 2018.3 or later**._
|
_This package requires **Unity 2019.3 or later**._
|
||||||
|
|
||||||
#### Install via OpenUPM
|
#### Install via OpenUPM
|
||||||
|
|
||||||
@@ -116,16 +118,16 @@ _This package requires **Unity 2018.3 or later**._
|
|||||||
```
|
```
|
||||||
- To update the package, use Package Manager UI (`Window > Package Manager`) or run the following command with `@{version}`:
|
- To update the package, use Package Manager UI (`Window > Package Manager`) or run the following command with `@{version}`:
|
||||||
```
|
```
|
||||||
openupm add com.coffee.ui-particle@4.9.0
|
openupm add com.coffee.ui-particle@5.0.0
|
||||||
```
|
```
|
||||||
|
|
||||||
#### Install via UPM (with Package Manager UI)
|
#### Install via UPM (with Package Manager UI)
|
||||||
|
|
||||||
- Click `Window > Package Manager` to open Package Manager UI.
|
- Click `Window > Package Manager` to open Package Manager UI.
|
||||||
- Click `+ > Add package from git URL...` and input the repository URL: `https://github.com/mob-sakai/ParticleEffectForUGUI.git`
|
- Click `+ > Add package from git URL...` and input the repository URL: `https://github.com/mob-sakai/ParticleEffectForUGUI.git?path=Packages/src`
|
||||||

|

|
||||||
- To update the package, change suffix `#{version}` to the target version.
|
- To update the package, change suffix `#{version}` to the target version.
|
||||||
- e.g. `https://github.com/mob-sakai/ParticleEffectForUGUI.git#4.9.0`
|
- e.g. `https://github.com/mob-sakai/ParticleEffectForUGUI.git?path=Packages/src#5.0.0`
|
||||||
|
|
||||||
#### Install via UPM (Manually)
|
#### Install via UPM (Manually)
|
||||||
|
|
||||||
@@ -133,22 +135,41 @@ _This package requires **Unity 2018.3 or later**._
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"com.coffee.ui-particle": "https://github.com/mob-sakai/ParticleEffectForUGUI.git",
|
"com.coffee.ui-particle": "https://github.com/mob-sakai/ParticleEffectForUGUI.git?path=Packages/src",
|
||||||
...
|
...
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
- To update the package, change suffix `#{version}` to the target version.
|
- To update the package, change suffix `#{version}` to the target version.
|
||||||
- e.g. `"com.coffee.ui-particle": "https://github.com/mob-sakai/ParticleEffectForUGUI.git#4.9.0",`
|
- e.g. `"com.coffee.ui-particle": "https://github.com/mob-sakai/ParticleEffectForUGUI.git?path=Packages/src#5.0.0",`
|
||||||
|
|
||||||
#### Install as Embedded Package
|
### Install as Embedded Package
|
||||||
|
|
||||||
1. Download a source code zip file from [Releases](https://github.com/mob-sakai/ParticleEffectForUGUI.git/releases) and extract it.
|
1. Download the `Source code (zip)` file from [Releases](https://github.com/mob-sakai/ParticleEffectForUGUI/releases) and
|
||||||
2. Place it in your project's `Packages` directory.
|
extract it.
|
||||||

|
2. Move the `<extracted_dir>/Packages/src` directory into your project's `Packages` directory.
|
||||||
- If you want to fix bugs or add features, install it as an embedded package.
|

|
||||||
- To update the package, you need to re-download it and replace the contents.
|
- You can rename the `src` directory if needed.
|
||||||
|
- If you intend to fix bugs or add features, installing it as an embedded package is recommended.
|
||||||
|
- To update the package, re-download it and replace the existing contents.
|
||||||
|
|
||||||
|
<br><br>
|
||||||
|
|
||||||
|
## 🔄 Upgrading from v3/v4 to v5
|
||||||
|
|
||||||
|
### Breaking Changes
|
||||||
|
|
||||||
|
- The default value of `UIParticle.scale` has been changed from `10` to `1`.
|
||||||
|
- `UIParticle` no longer inherits from `MaskableGraphic`.
|
||||||
|
- If you are installing via git URL, add `?path=Packages/src`.
|
||||||
|
```json
|
||||||
|
// v3/v4
|
||||||
|
"com.coffee.ui-particle": "https://github.com/mob-sakai/ParticleEffectForUGUI.git",
|
||||||
|
|
||||||
|
// v5
|
||||||
|
"com.coffee.ui-particle": "https://github.com/mob-sakai/ParticleEffectForUGUI.git?path=Packages/src",
|
||||||
|
```
|
||||||
|
|
||||||
<br><br>
|
<br><br>
|
||||||
|
|
||||||
|
|||||||
Binary file not shown.
@@ -38,7 +38,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
private static void GetComponentsInChildren_Internal<T>(this Component self, List<T> results, int depth)
|
private static void GetComponentsInChildren_Internal<T>(this Component self, List<T> results, int depth)
|
||||||
where T : Component
|
where T : Component
|
||||||
{
|
{
|
||||||
if (!self || results == null || depth < 0) return;
|
if (self == null || results == null || depth < 0) return;
|
||||||
|
|
||||||
var tr = self.transform;
|
var tr = self.transform;
|
||||||
if (tr.TryGetComponent<T>(out var t))
|
if (tr.TryGetComponent<T>(out var t))
|
||||||
@@ -59,7 +59,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static T GetOrAddComponent<T>(this Component self) where T : Component
|
public static T GetOrAddComponent<T>(this Component self) where T : Component
|
||||||
{
|
{
|
||||||
if (!self) return null;
|
if (self == null) return null;
|
||||||
return self.TryGetComponent<T>(out var component)
|
return self.TryGetComponent<T>(out var component)
|
||||||
? component
|
? component
|
||||||
: self.gameObject.AddComponent<T>();
|
: self.gameObject.AddComponent<T>();
|
||||||
@@ -166,7 +166,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
#if !UNITY_2021_2_OR_NEWER && !UNITY_2020_3_45 && !UNITY_2020_3_46 && !UNITY_2020_3_47 && !UNITY_2020_3_48
|
#if !UNITY_2021_2_OR_NEWER && !UNITY_2020_3_45 && !UNITY_2020_3_46 && !UNITY_2020_3_47 && !UNITY_2020_3_48
|
||||||
public static T GetComponentInParent<T>(this Component self, bool includeInactive) where T : Component
|
public static T GetComponentInParent<T>(this Component self, bool includeInactive) where T : Component
|
||||||
{
|
{
|
||||||
if (!self) return null;
|
if (self == null) return null;
|
||||||
if (!includeInactive) return self.GetComponentInParent<T>();
|
if (!includeInactive) return self.GetComponentInParent<T>();
|
||||||
|
|
||||||
var current = self.transform;
|
var current = self.transform;
|
||||||
@@ -184,9 +184,9 @@ namespace Coffee.UIParticleInternal
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Verify whether it can be converted to the specified component.
|
/// Verify whether it can be converted to the specified component.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
internal static bool CanConvertTo<T>(this Object context) where T : MonoBehaviour
|
internal static bool CanConvertTo<T>(this Object context) where T : MonoBehaviour
|
||||||
{
|
{
|
||||||
return context && context.GetType() != typeof(T);
|
return context != null && context.GetType() != typeof(T);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
@@ -32,10 +32,10 @@ namespace Coffee.UIParticleInternal
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static Texture2D GetActualTexture(this Sprite self)
|
public static Texture2D GetActualTexture(this Sprite self)
|
||||||
{
|
{
|
||||||
if (!self) return null;
|
if (self == null) return null;
|
||||||
|
|
||||||
var ret = s_GetActiveAtlasTextureMethod(self);
|
var ret = s_GetActiveAtlasTextureMethod(self);
|
||||||
return ret ? ret : self.texture;
|
return ret != null ? ret : self.texture;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -43,7 +43,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public static SpriteAtlas GetActiveAtlas(this Sprite self)
|
public static SpriteAtlas GetActiveAtlas(this Sprite self)
|
||||||
{
|
{
|
||||||
if (!self) return null;
|
if (self == null) return null;
|
||||||
|
|
||||||
return s_GetActiveAtlasMethod(self);
|
return s_GetActiveAtlasMethod(self);
|
||||||
}
|
}
|
||||||
@@ -53,7 +53,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
internal static Texture2D GetActualTexture(this Sprite self)
|
internal static Texture2D GetActualTexture(this Sprite self)
|
||||||
{
|
{
|
||||||
return self ? self.texture : null;
|
return self != null ? self.texture : null;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -37,7 +37,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
foreach (var t in TypeCache.GetTypesDerivedFrom(typeof(PreloadedProjectSettings<>)))
|
foreach (var t in TypeCache.GetTypesDerivedFrom(typeof(PreloadedProjectSettings<>)))
|
||||||
{
|
{
|
||||||
var defaultSettings = GetDefaultSettings(t);
|
var defaultSettings = GetDefaultSettings(t);
|
||||||
if (!defaultSettings)
|
if (defaultSettings == null)
|
||||||
{
|
{
|
||||||
// When create a new instance, automatically set it as default settings.
|
// When create a new instance, automatically set it as default settings.
|
||||||
defaultSettings = CreateInstance(t) as PreloadedProjectSettings;
|
defaultSettings = CreateInstance(t) as PreloadedProjectSettings;
|
||||||
@@ -48,7 +48,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
SetDefaultSettings(defaultSettings);
|
SetDefaultSettings(defaultSettings);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (defaultSettings)
|
if (defaultSettings != null)
|
||||||
{
|
{
|
||||||
defaultSettings.OnInitialize();
|
defaultSettings.OnInitialize();
|
||||||
}
|
}
|
||||||
@@ -66,7 +66,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
private static Object[] GetPreloadedSettings(Type type)
|
private static Object[] GetPreloadedSettings(Type type)
|
||||||
{
|
{
|
||||||
return PlayerSettings.GetPreloadedAssets()
|
return PlayerSettings.GetPreloadedAssets()
|
||||||
.Where(x => x && x.GetType() == type)
|
.Where(x => x != null && x.GetType() == type)
|
||||||
.ToArray();
|
.ToArray();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -76,12 +76,12 @@ namespace Coffee.UIParticleInternal
|
|||||||
?? AssetDatabase.FindAssets($"t:{nameof(PreloadedProjectSettings)}")
|
?? AssetDatabase.FindAssets($"t:{nameof(PreloadedProjectSettings)}")
|
||||||
.Select(AssetDatabase.GUIDToAssetPath)
|
.Select(AssetDatabase.GUIDToAssetPath)
|
||||||
.Select(AssetDatabase.LoadAssetAtPath<PreloadedProjectSettings>)
|
.Select(AssetDatabase.LoadAssetAtPath<PreloadedProjectSettings>)
|
||||||
.FirstOrDefault(x => x && x.GetType() == type);
|
.FirstOrDefault(x => x != null && x.GetType() == type);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected static void SetDefaultSettings(PreloadedProjectSettings asset)
|
protected static void SetDefaultSettings(PreloadedProjectSettings asset)
|
||||||
{
|
{
|
||||||
if (!asset) return;
|
if (asset == null) return;
|
||||||
|
|
||||||
var type = asset.GetType();
|
var type = asset.GetType();
|
||||||
if (string.IsNullOrEmpty(AssetDatabase.GetAssetPath(asset)))
|
if (string.IsNullOrEmpty(AssetDatabase.GetAssetPath(asset)))
|
||||||
@@ -103,7 +103,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
var preloadedAssets = PlayerSettings.GetPreloadedAssets();
|
var preloadedAssets = PlayerSettings.GetPreloadedAssets();
|
||||||
var projectSettings = GetPreloadedSettings(type);
|
var projectSettings = GetPreloadedSettings(type);
|
||||||
PlayerSettings.SetPreloadedAssets(preloadedAssets
|
PlayerSettings.SetPreloadedAssets(preloadedAssets
|
||||||
.Where(x => x)
|
.Where(x => x != null)
|
||||||
.Except(projectSettings.Except(new[] { asset }))
|
.Except(projectSettings.Except(new[] { asset }))
|
||||||
.Append(asset)
|
.Append(asset)
|
||||||
.Distinct()
|
.Distinct()
|
||||||
@@ -133,19 +133,19 @@ namespace Coffee.UIParticleInternal
|
|||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
private string _jsonText;
|
private string _jsonText;
|
||||||
|
|
||||||
public static bool hasInstance => s_Instance;
|
public static bool hasInstance => s_Instance != null;
|
||||||
|
|
||||||
public static T instance
|
public static T instance
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (s_Instance) return s_Instance;
|
if (s_Instance != null) return s_Instance;
|
||||||
|
|
||||||
s_Instance = GetDefaultSettings(typeof(T)) as T;
|
s_Instance = GetDefaultSettings(typeof(T)) as T;
|
||||||
if (s_Instance) return s_Instance;
|
if (s_Instance != null) return s_Instance;
|
||||||
|
|
||||||
s_Instance = CreateInstance<T>();
|
s_Instance = CreateInstance<T>();
|
||||||
if (!s_Instance)
|
if (s_Instance == null)
|
||||||
{
|
{
|
||||||
s_Instance = null;
|
s_Instance = null;
|
||||||
return s_Instance;
|
return s_Instance;
|
||||||
@@ -174,7 +174,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
public static T instance => s_Instance ? s_Instance : s_Instance = CreateInstance<T>();
|
public static T instance => s_Instance != null ? s_Instance : s_Instance = CreateInstance<T>();
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -183,7 +183,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
protected virtual void OnEnable()
|
protected virtual void OnEnable()
|
||||||
{
|
{
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
var isDefaultSettings = !s_Instance || s_Instance == this || GetDefaultSettings(typeof(T)) == this;
|
var isDefaultSettings = s_Instance == null || s_Instance == this || GetDefaultSettings(typeof(T)) == this;
|
||||||
if (!isDefaultSettings)
|
if (!isDefaultSettings)
|
||||||
{
|
{
|
||||||
DestroyImmediate(this, true);
|
DestroyImmediate(this, true);
|
||||||
@@ -193,7 +193,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
EditorApplication.playModeStateChanged += OnPlayModeStateChanged;
|
EditorApplication.playModeStateChanged += OnPlayModeStateChanged;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
if (s_Instance) return;
|
if (s_Instance != null) return;
|
||||||
s_Instance = this as T;
|
s_Instance = this as T;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -222,7 +222,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
|
|
||||||
public override void OnGUI(string searchContext)
|
public override void OnGUI(string searchContext)
|
||||||
{
|
{
|
||||||
if (!_target)
|
if (_target == null)
|
||||||
{
|
{
|
||||||
if (_editor)
|
if (_editor)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -48,7 +48,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
public static void LogIf(bool enable, object tag, object message, Object context = null)
|
public static void LogIf(bool enable, object tag, object message, Object context = null)
|
||||||
{
|
{
|
||||||
if (!enable) return;
|
if (!enable) return;
|
||||||
Log_Internal(LogType.Log, tag, message, context ? context : tag as Object);
|
Log_Internal(LogType.Log, tag, message, context != null ? context : tag as Object);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !ENABLE_COFFEE_LOGGER
|
#if !ENABLE_COFFEE_LOGGER
|
||||||
@@ -56,7 +56,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
#endif
|
#endif
|
||||||
public static void Log(object tag, object message, Object context = null)
|
public static void Log(object tag, object message, Object context = null)
|
||||||
{
|
{
|
||||||
Log_Internal(LogType.Log, tag, message, context ? context : tag as Object);
|
Log_Internal(LogType.Log, tag, message, context != null ? context : tag as Object);
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !ENABLE_COFFEE_LOGGER
|
#if !ENABLE_COFFEE_LOGGER
|
||||||
@@ -64,13 +64,13 @@ namespace Coffee.UIParticleInternal
|
|||||||
#endif
|
#endif
|
||||||
public static void LogWarning(object tag, object message, Object context = null)
|
public static void LogWarning(object tag, object message, Object context = null)
|
||||||
{
|
{
|
||||||
Log_Internal(LogType.Warning, tag, message, context ? context : tag as Object);
|
Log_Internal(LogType.Warning, tag, message, context != null ? context : tag as Object);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void LogError(object tag, object message, Object context = null)
|
public static void LogError(object tag, object message, Object context = null)
|
||||||
{
|
{
|
||||||
#if ENABLE_COFFEE_LOGGER
|
#if ENABLE_COFFEE_LOGGER
|
||||||
Log_Internal(LogType.Error, tag, message, context ? context : tag as Object);
|
Log_Internal(LogType.Error, tag, message, context != null ? context : tag as Object);
|
||||||
#else
|
#else
|
||||||
Debug.LogError($"{tag}: {message}", context);
|
Debug.LogError($"{tag}: {message}", context);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
|
|
||||||
public static void Destroy(Object obj)
|
public static void Destroy(Object obj)
|
||||||
{
|
{
|
||||||
if (!obj) return;
|
if (obj == null) return;
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
if (!Application.isPlaying)
|
if (!Application.isPlaying)
|
||||||
{
|
{
|
||||||
@@ -44,7 +44,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
|
|
||||||
public static void DestroyImmediate(Object obj)
|
public static void DestroyImmediate(Object obj)
|
||||||
{
|
{
|
||||||
if (!obj) return;
|
if (obj == null) return;
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
if (Application.isEditor)
|
if (Application.isEditor)
|
||||||
{
|
{
|
||||||
@@ -61,7 +61,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
public static void SetDirty(Object obj)
|
public static void SetDirty(Object obj)
|
||||||
{
|
{
|
||||||
#if UNITY_EDITOR
|
#if UNITY_EDITOR
|
||||||
if (!obj) return;
|
if (obj == null) return;
|
||||||
EditorUtility.SetDirty(obj);
|
EditorUtility.SetDirty(obj);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
@@ -117,11 +117,11 @@ namespace Coffee.UIParticleInternal
|
|||||||
foreach (var type in types)
|
foreach (var type in types)
|
||||||
{
|
{
|
||||||
var script = scripts.FirstOrDefault(x => x.GetClass() == type);
|
var script = scripts.FirstOrDefault(x => x.GetClass() == type);
|
||||||
if (!script) continue;
|
if (script == null) continue;
|
||||||
|
|
||||||
var path = type.GetCustomAttribute<IconAttribute>()?._path;
|
var path = type.GetCustomAttribute<IconAttribute>()?._path;
|
||||||
var icon = AssetDatabase.LoadAssetAtPath<Texture2D>(path);
|
var icon = AssetDatabase.LoadAssetAtPath<Texture2D>(path);
|
||||||
if (!icon) continue;
|
if (icon == null) continue;
|
||||||
|
|
||||||
s_SetIconForObject(script, icon);
|
s_SetIconForObject(script, icon);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -90,7 +90,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
Profiler.BeginSample("(COF)[ObjectRepository] GetFromCache");
|
Profiler.BeginSample("(COF)[ObjectRepository] GetFromCache");
|
||||||
if (_cache.TryGetValue(hash, out var entry))
|
if (_cache.TryGetValue(hash, out var entry))
|
||||||
{
|
{
|
||||||
if (!entry.storedObject)
|
if (entry.storedObject == null)
|
||||||
{
|
{
|
||||||
Release(ref entry.storedObject);
|
Release(ref entry.storedObject);
|
||||||
Profiler.EndSample();
|
Profiler.EndSample();
|
||||||
@@ -116,7 +116,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
|
|
||||||
private void Add(Hash128 hash, ref T obj, T newObject)
|
private void Add(Hash128 hash, ref T obj, T newObject)
|
||||||
{
|
{
|
||||||
if (!newObject)
|
if (newObject == null)
|
||||||
{
|
{
|
||||||
Release(ref obj);
|
Release(ref obj);
|
||||||
obj = newObject;
|
obj = newObject;
|
||||||
@@ -151,7 +151,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
&& _cache.TryGetValue(hash, out var entry))
|
&& _cache.TryGetValue(hash, out var entry))
|
||||||
{
|
{
|
||||||
entry.reference--;
|
entry.reference--;
|
||||||
if (entry.reference <= 0 || !entry.storedObject)
|
if (entry.reference <= 0 || entry.storedObject == null)
|
||||||
{
|
{
|
||||||
Remove(entry);
|
Remove(entry);
|
||||||
}
|
}
|
||||||
@@ -192,7 +192,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
public void Release(Action<T> onRelease)
|
public void Release(Action<T> onRelease)
|
||||||
{
|
{
|
||||||
reference = 0;
|
reference = 0;
|
||||||
if (storedObject)
|
if (storedObject != null)
|
||||||
{
|
{
|
||||||
onRelease?.Invoke(storedObject);
|
onRelease?.Invoke(storedObject);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,12 +3,13 @@ using System.Collections.Generic;
|
|||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
using Coffee.UIParticleInternal;
|
using Coffee.UIParticleInternal;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
using UnityEngine.EventSystems;
|
||||||
using UnityEngine.Rendering;
|
using UnityEngine.Rendering;
|
||||||
using UnityEngine.Serialization;
|
using UnityEngine.Serialization;
|
||||||
using UnityEngine.UI;
|
|
||||||
using Random = UnityEngine.Random;
|
using Random = UnityEngine.Random;
|
||||||
|
|
||||||
[assembly: InternalsVisibleTo("Coffee.UIParticle.Editor")]
|
[assembly: InternalsVisibleTo("Coffee.UIParticle.Editor")]
|
||||||
|
[assembly: InternalsVisibleTo("Coffee.UIParticle.Editor.Tests")]
|
||||||
[assembly: InternalsVisibleTo("Coffee.UIParticle.PerformanceDemo")]
|
[assembly: InternalsVisibleTo("Coffee.UIParticle.PerformanceDemo")]
|
||||||
[assembly: InternalsVisibleTo("Coffee.UIParticle.Demo")]
|
[assembly: InternalsVisibleTo("Coffee.UIParticle.Demo")]
|
||||||
|
|
||||||
@@ -17,11 +18,11 @@ namespace Coffee.UIExtensions
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Render maskable and sortable particle effect ,without Camera, RenderTexture or Canvas.
|
/// Render maskable and sortable particle effect ,without Camera, RenderTexture or Canvas.
|
||||||
/// </summary>
|
/// </summary>
|
||||||
[Icon("Packages/com.coffee.ui-particle/Icons/UIParticleIcon.png")]
|
[Icon("Packages/com.coffee.ui-particle/Editor/UIParticleIcon.png")]
|
||||||
[ExecuteAlways]
|
[ExecuteAlways]
|
||||||
[RequireComponent(typeof(RectTransform))]
|
[RequireComponent(typeof(RectTransform))]
|
||||||
[RequireComponent(typeof(CanvasRenderer))]
|
[RequireComponent(typeof(CanvasRenderer))]
|
||||||
public class UIParticle : MaskableGraphic, ISerializationCallbackReceiver
|
public class UIParticle : UIBehaviour, ISerializationCallbackReceiver
|
||||||
{
|
{
|
||||||
public enum AutoScalingMode
|
public enum AutoScalingMode
|
||||||
{
|
{
|
||||||
@@ -63,7 +64,7 @@ namespace Coffee.UIExtensions
|
|||||||
|
|
||||||
[Tooltip("Scale the rendering particles. When the `3D` toggle is enabled, 3D scale (x, y, z) is supported.")]
|
[Tooltip("Scale the rendering particles. When the `3D` toggle is enabled, 3D scale (x, y, z) is supported.")]
|
||||||
[SerializeField]
|
[SerializeField]
|
||||||
private Vector3 m_Scale3D = new Vector3(10, 10, 10);
|
private Vector3 m_Scale3D = new Vector3(1, 1, 1);
|
||||||
|
|
||||||
[Tooltip("If you want to update material properties (e.g. _MainTex_ST, _Color) in AnimationClip, " +
|
[Tooltip("If you want to update material properties (e.g. _MainTex_ST, _Color) in AnimationClip, " +
|
||||||
"use this to mark as animatable.")]
|
"use this to mark as animatable.")]
|
||||||
@@ -124,20 +125,48 @@ namespace Coffee.UIExtensions
|
|||||||
[Tooltip("Time scale multiplier.")]
|
[Tooltip("Time scale multiplier.")]
|
||||||
private float m_TimeScaleMultiplier = 1;
|
private float m_TimeScaleMultiplier = 1;
|
||||||
|
|
||||||
|
[SerializeField]
|
||||||
|
private bool m_Maskable = true;
|
||||||
|
|
||||||
private readonly List<UIParticleRenderer> _renderers = new List<UIParticleRenderer>();
|
private readonly List<UIParticleRenderer> _renderers = new List<UIParticleRenderer>();
|
||||||
private Camera _bakeCamera;
|
private Camera _bakeCamera;
|
||||||
|
private Canvas _canvas;
|
||||||
private int _groupId;
|
private int _groupId;
|
||||||
private bool _isScaleStored;
|
private bool _isScaleStored;
|
||||||
private Vector3 _storedScale;
|
private Vector3 _storedScale;
|
||||||
private DrivenRectTransformTracker _tracker;
|
private DrivenRectTransformTracker _tracker;
|
||||||
|
|
||||||
/// <summary>
|
public RectTransform rectTransform => transform as RectTransform;
|
||||||
/// Should this graphic be considered a target for ray-casting?
|
|
||||||
/// </summary>
|
public Canvas canvas
|
||||||
public override bool raycastTarget
|
|
||||||
{
|
{
|
||||||
get => false;
|
get
|
||||||
set { }
|
{
|
||||||
|
if (_canvas) return _canvas;
|
||||||
|
|
||||||
|
var tr = transform;
|
||||||
|
while (tr && !_canvas)
|
||||||
|
{
|
||||||
|
if (tr.TryGetComponent(out _canvas)) return _canvas;
|
||||||
|
tr = tr.parent;
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// Does this graphic allow masking.
|
||||||
|
/// </summary>
|
||||||
|
public bool maskable
|
||||||
|
{
|
||||||
|
get => m_Maskable;
|
||||||
|
set
|
||||||
|
{
|
||||||
|
if (value == m_Maskable) return;
|
||||||
|
m_Maskable = value;
|
||||||
|
UpdateRendererMaterial();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -323,15 +352,15 @@ namespace Coffee.UIExtensions
|
|||||||
|
|
||||||
public Vector3 parentScale { get; private set; }
|
public Vector3 parentScale { get; private set; }
|
||||||
|
|
||||||
public Vector3 canvasScale { get; private set; }
|
private Vector3 canvasScale { get; set; }
|
||||||
|
|
||||||
protected override void OnEnable()
|
protected override void OnEnable()
|
||||||
{
|
{
|
||||||
_isScaleStored = false;
|
_isScaleStored = false;
|
||||||
ResetGroupId();
|
ResetGroupId();
|
||||||
UIParticleUpdater.Register(this);
|
UIParticleUpdater.Register(this);
|
||||||
RegisterDirtyMaterialCallback(UpdateRendererMaterial);
|
|
||||||
|
|
||||||
|
//
|
||||||
if (0 < particles.Count)
|
if (0 < particles.Count)
|
||||||
{
|
{
|
||||||
RefreshParticles(particles);
|
RefreshParticles(particles);
|
||||||
@@ -341,7 +370,7 @@ namespace Coffee.UIExtensions
|
|||||||
RefreshParticles();
|
RefreshParticles();
|
||||||
}
|
}
|
||||||
|
|
||||||
base.OnEnable();
|
UpdateRendererMaterial();
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -358,9 +387,15 @@ namespace Coffee.UIExtensions
|
|||||||
_isScaleStored = false;
|
_isScaleStored = false;
|
||||||
UIParticleUpdater.Unregister(this);
|
UIParticleUpdater.Unregister(this);
|
||||||
_renderers.ForEach(r => r.Reset());
|
_renderers.ForEach(r => r.Reset());
|
||||||
UnregisterDirtyMaterialCallback(UpdateRendererMaterial);
|
_canvas = null;
|
||||||
|
}
|
||||||
|
|
||||||
base.OnDisable();
|
/// <summary>
|
||||||
|
/// Called when the state of the parent Canvas is changed.
|
||||||
|
/// </summary>
|
||||||
|
protected override void OnCanvasHierarchyChanged()
|
||||||
|
{
|
||||||
|
_canvas = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -370,6 +405,14 @@ namespace Coffee.UIExtensions
|
|||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// This function is called when a direct or indirect parent of the transform of the GameObject has changed.
|
||||||
|
/// </summary>
|
||||||
|
protected override void OnTransformParentChanged()
|
||||||
|
{
|
||||||
|
_canvas = null;
|
||||||
|
}
|
||||||
|
|
||||||
void ISerializationCallbackReceiver.OnBeforeSerialize()
|
void ISerializationCallbackReceiver.OnBeforeSerialize()
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
@@ -470,7 +513,7 @@ namespace Coffee.UIExtensions
|
|||||||
for (var i = 0; i < _renderers.Count; i++)
|
for (var i = 0; i < _renderers.Count; i++)
|
||||||
{
|
{
|
||||||
var r = _renderers[i];
|
var r = _renderers[i];
|
||||||
if (!r || !r.material) continue;
|
if (r == null || r.material == null) continue;
|
||||||
result.Add(r.material);
|
result.Add(r.material);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -488,7 +531,7 @@ namespace Coffee.UIExtensions
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void SetParticleSystemInstance(GameObject instance, bool destroyOldParticles)
|
public void SetParticleSystemInstance(GameObject instance, bool destroyOldParticles)
|
||||||
{
|
{
|
||||||
if (!instance) return;
|
if (instance == null) return;
|
||||||
|
|
||||||
var childCount = transform.childCount;
|
var childCount = transform.childCount;
|
||||||
for (var i = 0; i < childCount; i++)
|
for (var i = 0; i < childCount; i++)
|
||||||
@@ -517,7 +560,7 @@ namespace Coffee.UIExtensions
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
public void SetParticleSystemPrefab(GameObject prefab)
|
public void SetParticleSystemPrefab(GameObject prefab)
|
||||||
{
|
{
|
||||||
if (!prefab) return;
|
if (prefab == null) return;
|
||||||
|
|
||||||
SetParticleSystemInstance(Instantiate(prefab.gameObject), true);
|
SetParticleSystemInstance(Instantiate(prefab.gameObject), true);
|
||||||
}
|
}
|
||||||
@@ -537,12 +580,14 @@ namespace Coffee.UIExtensions
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
private void RefreshParticles(GameObject root)
|
private void RefreshParticles(GameObject root)
|
||||||
{
|
{
|
||||||
if (!root) return;
|
if (root == null) return;
|
||||||
root.GetComponentsInChildren(true, particles);
|
root.GetComponentsInChildren(true, particles);
|
||||||
for (var i = particles.Count - 1; 0 <= i; i--)
|
for (var i = particles.Count - 1; 0 <= i; i--)
|
||||||
{
|
{
|
||||||
var ps = particles[i];
|
var ps = particles[i];
|
||||||
if (!ps || ps.GetComponentInParent<UIParticle>(true) != this)
|
if (!ps
|
||||||
|
|| ps.gameObject.CompareTag("EditorOnly") // Ignore "EditorOnly" tagged ParticleSystems.
|
||||||
|
|| ps.GetComponentInParent<UIParticle>(true) != this) // Ignore ParticleSystems that are not under this UIParticle.
|
||||||
{
|
{
|
||||||
particles.RemoveAt(i);
|
particles.RemoveAt(i);
|
||||||
}
|
}
|
||||||
@@ -590,7 +635,7 @@ namespace Coffee.UIExtensions
|
|||||||
for (var i = 0; i < particleSystems.Count; i++)
|
for (var i = 0; i < particleSystems.Count; i++)
|
||||||
{
|
{
|
||||||
var ps = particleSystems[i];
|
var ps = particleSystems[i];
|
||||||
if (!ps) continue;
|
if (ps == null) continue;
|
||||||
|
|
||||||
var mainEmitter = ps.GetMainEmitter(particleSystems);
|
var mainEmitter = ps.GetMainEmitter(particleSystems);
|
||||||
GetRenderer(j++).Set(this, ps, false, mainEmitter);
|
GetRenderer(j++).Set(this, ps, false, mainEmitter);
|
||||||
@@ -641,7 +686,7 @@ namespace Coffee.UIExtensions
|
|||||||
for (var i = 0; i < _renderers.Count; i++)
|
for (var i = 0; i < _renderers.Count; i++)
|
||||||
{
|
{
|
||||||
var r = _renderers[i];
|
var r = _renderers[i];
|
||||||
if (r) continue;
|
if (r != null) continue;
|
||||||
|
|
||||||
RefreshParticles(particles);
|
RefreshParticles(particles);
|
||||||
break;
|
break;
|
||||||
@@ -651,7 +696,7 @@ namespace Coffee.UIExtensions
|
|||||||
for (var i = 0; i < _renderers.Count; i++)
|
for (var i = 0; i < _renderers.Count; i++)
|
||||||
{
|
{
|
||||||
var r = _renderers[i];
|
var r = _renderers[i];
|
||||||
if (!r) continue;
|
if (r == null) continue;
|
||||||
|
|
||||||
r.UpdateMesh(bakeCamera);
|
r.UpdateMesh(bakeCamera);
|
||||||
}
|
}
|
||||||
@@ -664,23 +709,12 @@ namespace Coffee.UIExtensions
|
|||||||
: Random.Range(m_GroupId, m_GroupMaxId + 1);
|
: Random.Range(m_GroupId, m_GroupMaxId + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override void UpdateMaterial()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
/// <summary>
|
|
||||||
/// Call to update the geometry of the Graphic onto the CanvasRenderer.
|
|
||||||
/// </summary>
|
|
||||||
protected override void UpdateGeometry()
|
|
||||||
{
|
|
||||||
}
|
|
||||||
|
|
||||||
private void UpdateRendererMaterial()
|
private void UpdateRendererMaterial()
|
||||||
{
|
{
|
||||||
for (var i = 0; i < _renderers.Count; i++)
|
for (var i = 0; i < _renderers.Count; i++)
|
||||||
{
|
{
|
||||||
var r = _renderers[i];
|
var r = _renderers[i];
|
||||||
if (!r) continue;
|
if (r == null) continue;
|
||||||
r.maskable = maskable;
|
r.maskable = maskable;
|
||||||
r.SetMaterialDirty();
|
r.SetMaterialDirty();
|
||||||
}
|
}
|
||||||
@@ -693,7 +727,7 @@ namespace Coffee.UIExtensions
|
|||||||
_renderers.Add(UIParticleRenderer.AddRenderer(this, index));
|
_renderers.Add(UIParticleRenderer.AddRenderer(this, index));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!_renderers[index])
|
if (_renderers[index] == null)
|
||||||
{
|
{
|
||||||
_renderers[index] = UIParticleRenderer.AddRenderer(this, index);
|
_renderers[index] = UIParticleRenderer.AddRenderer(this, index);
|
||||||
}
|
}
|
||||||
@@ -703,13 +737,13 @@ namespace Coffee.UIExtensions
|
|||||||
|
|
||||||
private Camera GetBakeCamera()
|
private Camera GetBakeCamera()
|
||||||
{
|
{
|
||||||
if (!canvas) return Camera.main;
|
if (canvas == null) return Camera.main;
|
||||||
if (!useCustomView && canvas.renderMode != RenderMode.ScreenSpaceOverlay && canvas.rootCanvas.worldCamera)
|
if (!useCustomView && canvas.renderMode != RenderMode.ScreenSpaceOverlay && canvas.rootCanvas.worldCamera)
|
||||||
{
|
{
|
||||||
return canvas.rootCanvas.worldCamera;
|
return canvas.rootCanvas.worldCamera;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (_bakeCamera)
|
if (_bakeCamera != null)
|
||||||
{
|
{
|
||||||
_bakeCamera.orthographicSize = useCustomView ? customViewSize : 10;
|
_bakeCamera.orthographicSize = useCustomView ? customViewSize : 10;
|
||||||
return _bakeCamera;
|
return _bakeCamera;
|
||||||
@@ -728,7 +762,7 @@ namespace Coffee.UIExtensions
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Create baking camera.
|
// Create baking camera.
|
||||||
if (!_bakeCamera)
|
if (_bakeCamera == null)
|
||||||
{
|
{
|
||||||
var go = new GameObject("[generated] UIParticle BakingCamera");
|
var go = new GameObject("[generated] UIParticle BakingCamera");
|
||||||
go.SetActive(false);
|
go.SetActive(false);
|
||||||
|
|||||||
@@ -208,7 +208,7 @@ namespace Coffee.UIExtensions
|
|||||||
|
|
||||||
private Vector3 GetDestinationPosition(UIParticle uiParticle, ParticleSystem particleSystem)
|
private Vector3 GetDestinationPosition(UIParticle uiParticle, ParticleSystem particleSystem)
|
||||||
{
|
{
|
||||||
var isUI = uiParticle && uiParticle.enabled;
|
var isUI = uiParticle != null && uiParticle.enabled;
|
||||||
var psPos = particleSystem.transform.position;
|
var psPos = particleSystem.transform.position;
|
||||||
var attractorPos = transform.position;
|
var attractorPos = transform.position;
|
||||||
var dstPos = attractorPos;
|
var dstPos = attractorPos;
|
||||||
|
|||||||
@@ -5,7 +5,6 @@ using UnityEngine;
|
|||||||
|
|
||||||
namespace Coffee.UIExtensions
|
namespace Coffee.UIExtensions
|
||||||
{
|
{
|
||||||
[Icon("Packages/com.coffee.ui-particle/Icons/UIParticleIcon.png")]
|
|
||||||
public class UIParticleProjectSettings : PreloadedProjectSettings<UIParticleProjectSettings>
|
public class UIParticleProjectSettings : PreloadedProjectSettings<UIParticleProjectSettings>
|
||||||
{
|
{
|
||||||
[Header("Setting")]
|
[Header("Setting")]
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ MonoImporter:
|
|||||||
serializedVersion: 2
|
serializedVersion: 2
|
||||||
defaultReferences: []
|
defaultReferences: []
|
||||||
executionOrder: 0
|
executionOrder: 0
|
||||||
icon: {instanceID: 0}
|
icon: {fileID: 2800000, guid: 5f0675613942149309588d556e33d990, type: 3}
|
||||||
userData:
|
userData:
|
||||||
assetBundleName:
|
assetBundleName:
|
||||||
assetBundleVariant:
|
assetBundleVariant:
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ using UnityEngine.UI;
|
|||||||
|
|
||||||
namespace Coffee.UIExtensions
|
namespace Coffee.UIExtensions
|
||||||
{
|
{
|
||||||
[Icon("Packages/com.coffee.ui-particle/Icons/UIParticleIcon.png")]
|
[Icon("Packages/com.coffee.ui-particle/Editor/UIParticleIcon.png")]
|
||||||
[ExecuteAlways]
|
[ExecuteAlways]
|
||||||
[RequireComponent(typeof(RectTransform))]
|
[RequireComponent(typeof(RectTransform))]
|
||||||
[RequireComponent(typeof(CanvasRenderer))]
|
[RequireComponent(typeof(CanvasRenderer))]
|
||||||
@@ -55,7 +55,7 @@ namespace Coffee.UIExtensions
|
|||||||
s_Corners[1] = transform.TransformPoint(_lastBounds.min.x, _lastBounds.max.y, 0);
|
s_Corners[1] = transform.TransformPoint(_lastBounds.min.x, _lastBounds.max.y, 0);
|
||||||
s_Corners[2] = transform.TransformPoint(_lastBounds.max.x, _lastBounds.max.y, 0);
|
s_Corners[2] = transform.TransformPoint(_lastBounds.max.x, _lastBounds.max.y, 0);
|
||||||
s_Corners[3] = transform.TransformPoint(_lastBounds.max.x, _lastBounds.min.y, 0);
|
s_Corners[3] = transform.TransformPoint(_lastBounds.max.x, _lastBounds.min.y, 0);
|
||||||
if (canvas)
|
if (canvas != null)
|
||||||
{
|
{
|
||||||
var worldToLocalMatrix = canvas.rootCanvas.transform.worldToLocalMatrix;
|
var worldToLocalMatrix = canvas.rootCanvas.transform.worldToLocalMatrix;
|
||||||
for (var i = 0; i < 4; ++i)
|
for (var i = 0; i < 4; ++i)
|
||||||
@@ -95,7 +95,7 @@ namespace Coffee.UIExtensions
|
|||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
if (!_materialForRendering)
|
if (_materialForRendering == null)
|
||||||
{
|
{
|
||||||
_materialForRendering = base.materialForRendering;
|
_materialForRendering = base.materialForRendering;
|
||||||
}
|
}
|
||||||
@@ -106,7 +106,7 @@ namespace Coffee.UIExtensions
|
|||||||
|
|
||||||
public void Reset(int index = -1)
|
public void Reset(int index = -1)
|
||||||
{
|
{
|
||||||
if (_renderer)
|
if (_renderer != null)
|
||||||
{
|
{
|
||||||
_renderer.enabled = true;
|
_renderer.enabled = true;
|
||||||
}
|
}
|
||||||
@@ -121,7 +121,7 @@ namespace Coffee.UIExtensions
|
|||||||
}
|
}
|
||||||
|
|
||||||
//_emitter = null;
|
//_emitter = null;
|
||||||
if (this && isActiveAndEnabled)
|
if (isActiveAndEnabled)
|
||||||
{
|
{
|
||||||
material = null;
|
material = null;
|
||||||
canvasRenderer.Clear();
|
canvasRenderer.Clear();
|
||||||
@@ -140,7 +140,7 @@ namespace Coffee.UIExtensions
|
|||||||
base.OnEnable();
|
base.OnEnable();
|
||||||
|
|
||||||
hideFlags = UIParticleProjectSettings.globalHideFlags;
|
hideFlags = UIParticleProjectSettings.globalHideFlags;
|
||||||
if (!s_CombineInstances[0].mesh)
|
if (s_CombineInstances[0].mesh == null)
|
||||||
{
|
{
|
||||||
s_CombineInstances[0].mesh = new Mesh
|
s_CombineInstances[0].mesh = new Mesh
|
||||||
{
|
{
|
||||||
@@ -283,10 +283,6 @@ namespace Coffee.UIExtensions
|
|||||||
|| !transform.lossyScale.GetScaled(_parent.scale3DForCalc).IsVisible() // Scale is not visible.
|
|| !transform.lossyScale.GetScaled(_parent.scale3DForCalc).IsVisible() // Scale is not visible.
|
||||||
|| (!_particleSystem.IsAlive() && !_particleSystem.isPlaying) // No particle.
|
|| (!_particleSystem.IsAlive() && !_particleSystem.isPlaying) // No particle.
|
||||||
|| (_isTrail && !_particleSystem.trails.enabled) // Trail, but it is not enabled.
|
|| (_isTrail && !_particleSystem.trails.enabled) // Trail, but it is not enabled.
|
||||||
#if UNITY_2018_3_OR_NEWER
|
|
||||||
|| canvasRenderer.GetInheritedAlpha() <
|
|
||||||
0.01f // #102: Do not bake particle system to mesh when the alpha is zero.
|
|
||||||
#endif
|
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
Profiler.BeginSample("[UIParticleRenderer] Clear Mesh");
|
Profiler.BeginSample("[UIParticleRenderer] Clear Mesh");
|
||||||
@@ -298,6 +294,24 @@ namespace Coffee.UIExtensions
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Reset custom data.
|
||||||
|
// var customData = _particleSystem.customData;
|
||||||
|
// if (!customData.enabled || customData.GetMode(ParticleSystemCustomData.Custom1) == ParticleSystemCustomDataMode.Disabled)
|
||||||
|
// {
|
||||||
|
// customData.SetVector(ParticleSystemCustomData.Custom1, 0, 0);
|
||||||
|
// customData.SetVector(ParticleSystemCustomData.Custom1, 1, 0);
|
||||||
|
// customData.SetVector(ParticleSystemCustomData.Custom1, 2, 0);
|
||||||
|
// customData.SetVector(ParticleSystemCustomData.Custom1, 3, 0);
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
// if (!customData.enabled || customData.GetMode(ParticleSystemCustomData.Custom2) == ParticleSystemCustomDataMode.Disabled)
|
||||||
|
// {
|
||||||
|
// customData.SetVector(ParticleSystemCustomData.Custom2, 0, 0);
|
||||||
|
// customData.SetVector(ParticleSystemCustomData.Custom2, 1, 0);
|
||||||
|
// customData.SetVector(ParticleSystemCustomData.Custom2, 2, 0);
|
||||||
|
// customData.SetVector(ParticleSystemCustomData.Custom2, 3, 0);
|
||||||
|
// }
|
||||||
|
|
||||||
var main = _particleSystem.main;
|
var main = _particleSystem.main;
|
||||||
var scale = GetWorldScale();
|
var scale = GetWorldScale();
|
||||||
var psPos = _particleSystem.transform.position;
|
var psPos = _particleSystem.transform.position;
|
||||||
@@ -315,6 +329,13 @@ namespace Coffee.UIExtensions
|
|||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
ResolveResolutionChange(psPos, scale);
|
ResolveResolutionChange(psPos, scale);
|
||||||
|
|
||||||
|
// fix: second and subsequent bursts not displayed when world simulation and non-looping. (#326)
|
||||||
|
if (!_particleSystem.IsLocalSpace() && !main.loop && _particleSystem.time == 0)
|
||||||
|
{
|
||||||
|
_delay = true;
|
||||||
|
}
|
||||||
|
|
||||||
Simulate(scale, _parent.isPaused || _delay);
|
Simulate(scale, _parent.isPaused || _delay);
|
||||||
|
|
||||||
if (_delay && !_parent.isPaused)
|
if (_delay && !_parent.isPaused)
|
||||||
@@ -710,7 +731,7 @@ namespace Coffee.UIExtensions
|
|||||||
if (s_Mpb.isEmpty) return;
|
if (s_Mpb.isEmpty) return;
|
||||||
|
|
||||||
// #41: Copy the value from MaterialPropertyBlock to CanvasRenderer
|
// #41: Copy the value from MaterialPropertyBlock to CanvasRenderer
|
||||||
if (!materialForRendering) return;
|
if (materialForRendering == null) return;
|
||||||
|
|
||||||
for (var i = 0; i < _parent.m_AnimatableProperties.Length; i++)
|
for (var i = 0; i < _parent.m_AnimatableProperties.Length; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -16,25 +16,25 @@ namespace Coffee.UIExtensions
|
|||||||
|
|
||||||
public static void Register(UIParticle particle)
|
public static void Register(UIParticle particle)
|
||||||
{
|
{
|
||||||
if (!particle) return;
|
if (particle == null) return;
|
||||||
s_ActiveParticles.Add(particle);
|
s_ActiveParticles.Add(particle);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Unregister(UIParticle particle)
|
public static void Unregister(UIParticle particle)
|
||||||
{
|
{
|
||||||
if (!particle) return;
|
if (particle == null) return;
|
||||||
s_ActiveParticles.Remove(particle);
|
s_ActiveParticles.Remove(particle);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Register(UIParticleAttractor attractor)
|
public static void Register(UIParticleAttractor attractor)
|
||||||
{
|
{
|
||||||
if (!attractor) return;
|
if (attractor == null) return;
|
||||||
s_ActiveAttractors.Add(attractor);
|
s_ActiveAttractors.Add(attractor);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void Unregister(UIParticleAttractor attractor)
|
public static void Unregister(UIParticleAttractor attractor)
|
||||||
{
|
{
|
||||||
if (!attractor) return;
|
if (attractor == null) return;
|
||||||
s_ActiveAttractors.Remove(attractor);
|
s_ActiveAttractors.Remove(attractor);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ namespace Coffee.UIExtensions
|
|||||||
for (var i = 0; i < s_ActiveParticles.Count; i++)
|
for (var i = 0; i < s_ActiveParticles.Count; i++)
|
||||||
{
|
{
|
||||||
var uip = s_ActiveParticles[i];
|
var uip = s_ActiveParticles[i];
|
||||||
if (!uip || !uip.canvas || !uip.isPrimary || !s_UpdatedGroupIds.Add(uip.groupId)) continue;
|
if (uip == null || uip.canvas == null || !uip.isPrimary || !s_UpdatedGroupIds.Add(uip.groupId)) continue;
|
||||||
|
|
||||||
uip.UpdateTransformScale();
|
uip.UpdateTransformScale();
|
||||||
uip.UpdateRenderers();
|
uip.UpdateRenderers();
|
||||||
@@ -81,7 +81,7 @@ namespace Coffee.UIExtensions
|
|||||||
for (var i = 0; i < s_ActiveParticles.Count; i++)
|
for (var i = 0; i < s_ActiveParticles.Count; i++)
|
||||||
{
|
{
|
||||||
var uip = s_ActiveParticles[i];
|
var uip = s_ActiveParticles[i];
|
||||||
if (!uip || !uip.canvas) continue;
|
if (uip == null || uip.canvas == null) continue;
|
||||||
|
|
||||||
uip.UpdateTransformScale();
|
uip.UpdateTransformScale();
|
||||||
|
|
||||||
@@ -125,7 +125,7 @@ namespace Coffee.UIExtensions
|
|||||||
var uip = s_ActiveParticles[i];
|
var uip = s_ActiveParticles[i];
|
||||||
if (!uip.useMeshSharing || uip.groupId != groupId) continue;
|
if (!uip.useMeshSharing || uip.groupId != groupId) continue;
|
||||||
if (uip.isPrimary) return uip;
|
if (uip.isPrimary) return uip;
|
||||||
if (!primary && uip.canSimulate) primary = uip;
|
if (primary == null && uip.canSimulate) primary = uip;
|
||||||
}
|
}
|
||||||
|
|
||||||
return primary;
|
return primary;
|
||||||
|
|||||||
@@ -13,11 +13,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
{
|
{
|
||||||
if (s_TmpParticles.Length < size)
|
if (s_TmpParticles.Length < size)
|
||||||
{
|
{
|
||||||
while (s_TmpParticles.Length < size)
|
size = Mathf.NextPowerOfTwo(size);
|
||||||
{
|
|
||||||
size = Mathf.NextPowerOfTwo(size);
|
|
||||||
}
|
|
||||||
|
|
||||||
s_TmpParticles = new ParticleSystem.Particle[size];
|
s_TmpParticles = new ParticleSystem.Particle[size];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -88,11 +84,11 @@ namespace Coffee.UIParticleInternal
|
|||||||
var bRenderer = b.GetComponent<ParticleSystemRenderer>();
|
var bRenderer = b.GetComponent<ParticleSystemRenderer>();
|
||||||
|
|
||||||
// Render queue: ascending
|
// Render queue: ascending
|
||||||
var aMat = aRenderer.sharedMaterial ? aRenderer.sharedMaterial : aRenderer.trailMaterial;
|
var aMat = aRenderer.sharedMaterial != null ? aRenderer.sharedMaterial : aRenderer.trailMaterial;
|
||||||
var bMat = bRenderer.sharedMaterial ? bRenderer.sharedMaterial : bRenderer.trailMaterial;
|
var bMat = bRenderer.sharedMaterial != null ? bRenderer.sharedMaterial : bRenderer.trailMaterial;
|
||||||
if (!aMat && !bMat) return 0;
|
if (aMat == null && bMat == null) return 0;
|
||||||
if (!aMat) return -1;
|
if (aMat == null) return -1;
|
||||||
if (!bMat) return 1;
|
if (bMat == null) return 1;
|
||||||
|
|
||||||
if (sortByMaterial)
|
if (sortByMaterial)
|
||||||
{
|
{
|
||||||
@@ -146,7 +142,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
|
|
||||||
public static Texture2D GetTextureForSprite(this ParticleSystem self)
|
public static Texture2D GetTextureForSprite(this ParticleSystem self)
|
||||||
{
|
{
|
||||||
if (!self) return null;
|
if (self == null) return null;
|
||||||
|
|
||||||
// Get sprite's texture.
|
// Get sprite's texture.
|
||||||
var tsaModule = self.textureSheetAnimation;
|
var tsaModule = self.textureSheetAnimation;
|
||||||
@@ -155,7 +151,7 @@ namespace Coffee.UIParticleInternal
|
|||||||
for (var i = 0; i < tsaModule.spriteCount; i++)
|
for (var i = 0; i < tsaModule.spriteCount; i++)
|
||||||
{
|
{
|
||||||
var sprite = tsaModule.GetSprite(i);
|
var sprite = tsaModule.GetSprite(i);
|
||||||
if (!sprite) continue;
|
if (sprite == null) continue;
|
||||||
|
|
||||||
return sprite.GetActualTexture();
|
return sprite.GetActualTexture();
|
||||||
}
|
}
|
||||||
@@ -167,14 +163,14 @@ namespace Coffee.UIParticleInternal
|
|||||||
{
|
{
|
||||||
foreach (var p in self)
|
foreach (var p in self)
|
||||||
{
|
{
|
||||||
if (!p) continue;
|
if (p == null) continue;
|
||||||
action.Invoke(p);
|
action.Invoke(p);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static ParticleSystem GetMainEmitter(this ParticleSystem self, List<ParticleSystem> list)
|
public static ParticleSystem GetMainEmitter(this ParticleSystem self, List<ParticleSystem> list)
|
||||||
{
|
{
|
||||||
if (!self || list == null || list.Count == 0) return null;
|
if (self == null || list == null || list.Count == 0) return null;
|
||||||
|
|
||||||
for (var i = 0; i < list.Count; i++)
|
for (var i = 0; i < list.Count; i++)
|
||||||
{
|
{
|
||||||
@@ -187,7 +183,11 @@ namespace Coffee.UIParticleInternal
|
|||||||
|
|
||||||
public static bool IsSubEmitterOf(this ParticleSystem self, ParticleSystem parent)
|
public static bool IsSubEmitterOf(this ParticleSystem self, ParticleSystem parent)
|
||||||
{
|
{
|
||||||
|
if (self == null || parent == null) return false;
|
||||||
|
|
||||||
var subEmitters = parent.subEmitters;
|
var subEmitters = parent.subEmitters;
|
||||||
|
if (!subEmitters.enabled) return false; // No sub emitters.
|
||||||
|
|
||||||
var count = subEmitters.subEmittersCount;
|
var count = subEmitters.subEmittersCount;
|
||||||
for (var i = 0; i < count; i++)
|
for (var i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ namespace Coffee.UIExtensions.Demo
|
|||||||
|
|
||||||
private void Start()
|
private void Start()
|
||||||
{
|
{
|
||||||
if (!m_Origin) return;
|
if (m_Origin == null) return;
|
||||||
m_Origin.SetActive(false);
|
m_Origin.SetActive(false);
|
||||||
|
|
||||||
var parent = m_Origin.transform.parent;
|
var parent = m_Origin.transform.parent;
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ public class UIElementDragger : MonoBehaviour, IBeginDragHandler, IDragHandler,
|
|||||||
break;
|
break;
|
||||||
case Target.Custom:
|
case Target.Custom:
|
||||||
_rectTransform.localPosition += delta;
|
_rectTransform.localPosition += delta;
|
||||||
if (m_CustomTarget)
|
if (m_CustomTarget != null)
|
||||||
{
|
{
|
||||||
if (m_UseCanvasScale)
|
if (m_UseCanvasScale)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -2,8 +2,8 @@
|
|||||||
"name": "com.coffee.ui-particle",
|
"name": "com.coffee.ui-particle",
|
||||||
"displayName": "UI Particle",
|
"displayName": "UI Particle",
|
||||||
"description": "This package provides a component to render particle effects for uGUI.\nThe particle rendering is maskable and sortable, without the need for an extra Camera, RenderTexture, or Canvas.",
|
"description": "This package provides a component to render particle effects for uGUI.\nThe particle rendering is maskable and sortable, without the need for an extra Camera, RenderTexture, or Canvas.",
|
||||||
"version": "4.11.1",
|
"version": "5.0.0-preview.16",
|
||||||
"unity": "2018.2",
|
"unity": "2019.3",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
|||||||
Reference in New Issue
Block a user