Compare commits

...

40 Commits

Author SHA1 Message Date
semantic-release-bot
84ac11e6b7 chore(release): 4.6.2 [skip ci]
## [4.6.2](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v4.6.1...v4.6.2) (2024-02-01)

### Bug Fixes

* fix compile error in Unity 2021.1 or older ([fcae60b](fcae60bf29))
* fix demos ([ad20d12](ad20d128a2))
* fix warning ([7fd4a8e](7fd4a8e343))
2024-02-01 07:23:21 +00:00
mob-sakai
cc2be37b9e test: update test workflow 2024-02-01 16:22:52 +09:00
mob-sakai
ad20d128a2 fix: fix demos 2024-02-01 16:18:17 +09:00
mob-sakai
fcae60bf29 fix: fix compile error in Unity 2021.1 or older 2024-02-01 16:18:17 +09:00
mob-sakai
7fd4a8e343 fix: fix warning 2024-02-01 16:14:15 +09:00
mob-sakai
2052dda953 docs: update contributing 2024-02-01 16:14:11 +09:00
semantic-release-bot
e88bc54c2c chore(release): 4.6.1 [skip ci]
## [4.6.1](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v4.6.0...v4.6.1) (2024-01-26)

### Bug Fixes

* unintended scaling occurs when `AutoScalingMode=UIParticle` and `ScalingMode=Local` ([1627de1](1627de10eb)), closes [#292](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/292)
2024-01-26 11:41:10 +00:00
mob-sakai
1627de10eb fix: unintended scaling occurs when AutoScalingMode=UIParticle and ScalingMode=Local
close #292
2024-01-26 20:40:36 +09:00
semantic-release-bot
88890ff159 chore(release): 4.6.0 [skip ci]
# [4.6.0](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v4.5.2...v4.6.0) (2024-01-26)

### Bug Fixes

* fix abnormal mesh bounds error ([772bf50](772bf50d16)), closes [#213](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/213)
* fix warning ([93d3919](93d3919b6f))
* fix warning ([8a78ec1](8a78ec13ad))

### Features

* "[generated]" GameObjects on the hierarchy is disturbing ([7c42421](7c4242150b)), closes [#288](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/288)
* add explicit dependencies ([9a0187a](9a0187a72a))
* add icon ([0c1022c](0c1022c622))
* remove samples ([f53a7fa](f53a7faed3))
2024-01-26 09:56:34 +00:00
mob-sakai
25582dc51f docs: update readme 2024-01-26 18:55:20 +09:00
semantic-release-bot
76c6dcfd76 chore(release): 4.6.0-preview.1 [skip ci]
# [4.6.0-preview.1](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v4.5.2...v4.6.0-preview.1) (2024-01-24)

### Bug Fixes

* fix abnormal mesh bounds error ([772bf50](772bf50d16)), closes [#213](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/213)
* fix warning ([93d3919](93d3919b6f))
* fix warning ([8a78ec1](8a78ec13ad))

### Features

* "[generated]" GameObjects on the hierarchy is disturbing ([7c42421](7c4242150b)), closes [#288](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/288)
* add explicit dependencies ([9a0187a](9a0187a72a))
* add icon ([0c1022c](0c1022c622))
* remove samples ([f53a7fa](f53a7faed3))
2024-01-24 07:29:29 +00:00
wmltogether
772bf50d16 fix: fix abnormal mesh bounds error
close #213
2024-01-24 16:20:56 +09:00
mob-sakai
93d3919b6f fix: fix warning 2024-01-24 16:07:36 +09:00
mob-sakai
0c1022c622 feat: add icon 2024-01-24 00:40:12 +09:00
mob-sakai
c61d22d221 refactor: apply refactor 2024-01-23 23:27:46 +09:00
mob-sakai
cbe3105b0f refactor: fix package structure 2024-01-23 23:17:31 +09:00
mob-sakai
7c4242150b feat: "[generated]" GameObjects on the hierarchy is disturbing
close #288
2024-01-23 23:01:45 +09:00
mob-sakai
c6b25c73bf refactor: (remove code) sub emitters option is not work in editor playing 2024-01-23 19:55:30 +09:00
mob-sakai
2f4a963a56 chore: release workflow 2024-01-23 15:07:10 +09:00
mob-sakai
4c5b1287a4 docs: fix readme 2023-11-21 11:55:34 +09:00
mob-sakai
15e31abc3c chore: support CFXR for demo 2023-11-26 17:16:37 +09:00
mob-sakai
8a78ec13ad fix: fix warning 2023-11-26 17:15:26 +09:00
mob-sakai
f53a7faed3 feat: remove samples 2023-11-21 16:33:27 +09:00
mob-sakai
0af2042132 style: update package.json 2024-01-23 11:48:00 +09:00
mob-sakai
9a0187a72a feat: add explicit dependencies 2024-01-23 11:38:45 +09:00
mob-sakai
e4f5fde11c chore: remove workflow in the package 2024-01-23 12:39:27 +09:00
mob-sakai
974aff72d7 Add 'Packages/src/' from commit '32b93d3eeb52c6471244c324d0a6572b756c561a'
git-subtree-dir: Packages/src
git-subtree-mainline: 2aa8d41950
git-subtree-split: 32b93d3eeb
2024-01-23 14:55:04 +09:00
mob-sakai
2aa8d41950 init 2024-01-23 14:54:17 +09:00
semantic-release-bot
32b93d3eeb chore(release): 4.5.2 [skip ci]
## [4.5.2](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/4.5.1...4.5.2) (2024-01-18)

### Bug Fixes

* (editor) sometimes crashes when entering play mode ([b80c3e6](b80c3e6c9f))
2024-01-18 10:41:58 +00:00
mob-sakai
86de8b6e03 Merge pull request #289 from wmltogether/fix-deserialize-crash
Fix Editor sometimes crashes when entering Play Mode
2024-01-18 19:41:27 +09:00
wmltogether
b80c3e6c9f fix: (editor) sometimes crashes when entering play mode
If there are particle prefabs created using version 3.x in the project, there is a possibility that the editor may crash when entering Play Mode due to deserialization.
2024-01-18 19:40:12 +09:00
semantic-release-bot
6a1fef4150 chore(release): 4.5.1 [skip ci]
## [4.5.1](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/4.5.0...4.5.1) (2023-12-23)

### Bug Fixes

* fix material for mesh sharing group ([6126af9](6126af9f37))
* the changes made to the material used by the ParticleSystem are not immediately reflected ([3184ba9](3184ba94ae)), closes [#280](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/280)
2023-12-23 10:48:34 +00:00
mob-sakai
3184ba94ae fix: the changes made to the material used by the ParticleSystem are not immediately reflected
close #280
2023-12-23 19:43:50 +09:00
mob-sakai
6126af9f37 fix: fix material for mesh sharing group 2023-12-23 19:23:20 +09:00
semantic-release-bot
c6b816c312 chore(release): 4.5.0 [skip ci]
# [4.5.0](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/4.4.0...4.5.0) (2023-12-23)

### Bug Fixes

* incorrect rendering of world-space simulated particles while animating scale ([ac58475](ac58475539)), closes [#285](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/285)
* remove obsolete warning ([5d5eb34](5d5eb34590))

### Features

* Automatically generated objects are no longer editable (NotEditable). ([5607dc4](5607dc4eed))
* support IMeshModifier ([5c3232f](5c3232faf3)), closes [#282](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/282)
2023-12-23 07:32:51 +00:00
mob-sakai
5d5eb34590 fix: remove obsolete warning 2023-12-23 14:48:37 +09:00
mob-sakai
5c3232faf3 feat: support IMeshModifier
Custom vertex effects and CompositeCanvasRenderer are supported
close #282
2023-12-23 14:46:39 +09:00
mob-sakai
ac58475539 fix: incorrect rendering of world-space simulated particles while animating scale
close #285
2023-12-23 14:32:04 +09:00
mob-sakai
5607dc4eed feat: Automatically generated objects are no longer editable (NotEditable).
The automatically generated objects (UIParticleRenderer, UIParticleOverlayCamera) are not editable and will not be saved in scenes or prefabs.
2023-12-23 14:28:55 +09:00
mob-sakai
4e4b9eb2a7 doc: update readme 2023-11-09 14:18:16 +09:00
214 changed files with 6898 additions and 3997 deletions

208
.editorconfig Normal file
View File

@@ -0,0 +1,208 @@
root = true
[*.json]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 2
trim_trailing_whitespace = true
insert_final_newline = true
[*.asmdef]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
# C# files
[*.cs]
charset = utf-8
end_of_line = lf
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
csharp_style_implicit_object_creation_when_type_is_apparent = false
resharper_object_creation_when_type_evident = explicitly_typed
# Keep
csharp_keep_existing_attribute_arrangement = true
csharp_keep_existing_embedded_arrangement = true
csharp_keep_user_linebreaks = true
csharp_keep_existing_linebreaks = true
csharp_place_simple_embedded_statement_on_same_line = false
csharp_place_simple_blocks_on_single_line = false
csharp_keep_existing_initializer_arrangement = true
csharp_keep_existing_arrangement = true
# Standard properties
end_of_line = lf
insert_final_newline = true
# Brace preferences
csharp_brace_style = next_line
csharp_braces_for_ifelse = required_for_multiline_statement
csharp_braces_for_for = required
csharp_braces_for_foreach = required
csharp_braces_for_while = required
csharp_braces_for_dowhile = required
csharp_braces_for_using = required
csharp_case_block_braces = next_line
csharp_initializer_braces = next_line
# New line preferences
csharp_new_line_before_open_brace = all
csharp_new_line_before_else = true
csharp_new_line_before_catch = true
csharp_new_line_before_finally = true
csharp_new_line_before_members_in_object_initializers = true
csharp_new_line_before_members_in_anonymous_types = true
csharp_new_line_between_query_expression_clauses = true
# Indentation preferences
csharp_indent_block_contents = true
csharp_indent_braces = false
csharp_indent_case_contents = true
csharp_indent_case_contents_when_block = false
csharp_indent_switch_labels = true
csharp_indent_labels = one_less_than_current
# Modifier preferences
csharp_preferred_modifier_order = public,private,protected,internal,static,extern,new,virtual,abstract,sealed,override,readonly,unsafe,volatile,async:suggestion
# avoid this. unless absolutely necessary
dotnet_style_qualification_for_field = false:suggestion
dotnet_style_qualification_for_property = false:suggestion
dotnet_style_qualification_for_method = false:suggestion
dotnet_style_qualification_for_event = false:suggestion
# Types: use keywords instead of BCL types, and permit var only when the type is clear
csharp_style_var_for_built_in_types = true:suggestion
csharp_style_var_when_type_is_apparent = true:none
csharp_style_var_elsewhere = true:suggestion
dotnet_style_predefined_type_for_locals_parameters_members = true:suggestion
dotnet_style_predefined_type_for_member_access = true:suggestion
# Arguments
csharp_arguments_literal = named:suggestion
csharp_arguments_string_literal = named:suggestion
# Naming: public and protected fields -> camelCase
dotnet_naming_rule.protected_public_fields.severity = suggestion
dotnet_naming_rule.protected_public_fields.symbols = protected_public_fields
dotnet_naming_rule.protected_public_fields.style = camel_case
dotnet_naming_symbols.protected_public_fields.applicable_kinds = field, event
dotnet_naming_symbols.protected_public_fields.applicable_accessibilities = public, protected
dotnet_naming_style.camel_case.capitalization = camel_case
# Naming: properties -> camelCase
dotnet_naming_rule.properties.severity = suggestion
dotnet_naming_rule.properties.symbols = properties
dotnet_naming_rule.properties.style = camel_case
dotnet_naming_symbols.properties.applicable_kinds = property
# Naming: constant fields -> k_PascalCase
dotnet_naming_rule.constant_fields.severity = suggestion
dotnet_naming_rule.constant_fields.symbols = constant_fields
dotnet_naming_rule.constant_fields.style = k_pascal_case
dotnet_naming_symbols.constant_fields.applicable_kinds = field
dotnet_naming_symbols.constant_fields.required_modifiers = const
dotnet_naming_style.k_pascal_case.required_prefix = k_
dotnet_naming_style.k_pascal_case.capitalization = pascal_case
# Naming: static fields -> s_PascalCase
dotnet_naming_rule.static_fields_should_have_prefix.severity = suggestion
dotnet_naming_rule.static_fields_should_have_prefix.symbols = static_fields
dotnet_naming_rule.static_fields_should_have_prefix.style = s_pascal_case
dotnet_naming_symbols.static_fields.applicable_kinds = field, property
dotnet_naming_symbols.static_fields.required_modifiers = static
dotnet_naming_symbols.static_fields.applicable_accessibilities = private, internal, private_protected
dotnet_naming_style.s_pascal_case.required_prefix = s_
dotnet_naming_style.s_pascal_case.capitalization = pascal_case
# Naming: internal and private fields -> _camelCase
dotnet_naming_rule.private_internal_fields.severity = suggestion
dotnet_naming_rule.private_internal_fields.symbols = private_internal_fields
dotnet_naming_rule.private_internal_fields.style = _camel_case
dotnet_naming_symbols.private_internal_fields.applicable_kinds = field
dotnet_naming_symbols.private_internal_fields.applicable_accessibilities = private, internal
dotnet_naming_style._camel_case.required_prefix = _
dotnet_naming_style._camel_case.capitalization = camel_case
# Code style defaults
dotnet_sort_system_directives_first = true
csharp_preserve_single_line_statements = false:none
csharp_prefer_static_local_function = true:suggestion
csharp_prefer_simple_using_statement = false:none
csharp_style_prefer_switch_expression = true:suggestion
dotnet_style_readonly_field = true:suggestion
# Expression-level preferences
dotnet_style_object_initializer = true:suggestion
dotnet_style_collection_initializer = true:suggestion
dotnet_style_explicit_tuple_names = true:suggestion
dotnet_style_coalesce_expression = true:suggestion
dotnet_style_null_propagation = true:suggestion
dotnet_style_prefer_is_null_check_over_reference_equality_method = true:suggestion
dotnet_style_prefer_inferred_tuple_names = true:suggestion
dotnet_style_prefer_inferred_anonymous_type_member_names = true:suggestion
dotnet_style_prefer_auto_properties = true:suggestion
dotnet_style_prefer_conditional_expression_over_assignment = true:silent
dotnet_style_prefer_conditional_expression_over_return = true:silent
csharp_prefer_simple_default_expression = true:suggestion
# Expression-bodied members
csharp_style_expression_bodied_accessors = when_on_single_line:suggestion
csharp_style_expression_bodied_methods = false:suggestion
csharp_style_expression_bodied_constructors = false:suggestion
csharp_style_expression_bodied_operators = false:suggestion
csharp_style_expression_bodied_properties = when_on_single_line:suggestion
csharp_style_expression_bodied_indexers = false:suggestion
csharp_style_expression_bodied_lambdas = when_on_single_line:silent
csharp_style_expression_bodied_local_functions = false:suggestion
# Pattern matching
csharp_style_pattern_matching_over_is_with_cast_check = true:suggestion
csharp_style_pattern_matching_over_as_with_null_check = true:suggestion
csharp_style_inlined_variable_declaration = true:suggestion
# Null checking preferences
csharp_style_throw_expression = true:suggestion
csharp_style_conditional_delegate_call = true:suggestion
# Other features
csharp_style_prefer_index_operator = false:none
csharp_style_prefer_range_operator = false:none
csharp_style_pattern_local_over_anonymous_function = false:none
# Space preferences
csharp_space_after_cast = false
csharp_space_after_colon_in_inheritance_clause = true
csharp_space_after_comma = true
csharp_space_after_dot = false
csharp_space_after_keywords_in_control_flow_statements = true
csharp_space_after_semicolon_in_for_statement = true
csharp_space_around_binary_operators = before_and_after
csharp_space_around_declaration_statements = do_not_ignore
csharp_space_before_colon_in_inheritance_clause = true
csharp_space_before_comma = false
csharp_space_before_dot = false
csharp_space_before_open_square_brackets = false
csharp_space_before_semicolon_in_for_statement = false
csharp_space_between_empty_square_brackets = false
csharp_space_between_method_call_empty_parameter_list_parentheses = false
csharp_space_between_method_call_name_and_opening_parenthesis = false
csharp_space_between_method_call_parameter_list_parentheses = false
csharp_space_between_method_declaration_empty_parameter_list_parentheses = false
csharp_space_between_method_declaration_name_and_open_parenthesis = false
csharp_space_between_method_declaration_parameter_list_parentheses = false
csharp_space_between_parentheses = false
csharp_space_between_square_brackets = false
# ReSharper inspection severities
resharper_check_namespace_highlighting = none
resharper_for_can_be_converted_to_foreach_highlighting = none
resharper_xmldoc_indent_text = ZeroIndent

View File

@@ -10,39 +10,26 @@ 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)**
- Package version [e.g. 4.2.0, 3.3.14]
- Platform: [e.g. Editor(Windows/Mac), Standalone(Windows/Mac), iOS, Android, WebGL]
- Unity version: [e.g. 2021.3.7f1]
- Project options: [e.g. Mono/IL2CPP, .Net Standard 2.1/.Net 4.x, URP/HDRP, GraphicAPIs]
**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**
Please add any other context about the issue here.
It will help us resolve the issue.
- Error messages and crash dump
- Screenshots, gif animations and movie files
- Reproducible minimal project
- The entire project (zipped Assets, Packages, ProjectSettings) is preferred over `.unitypackage`
Add any other context about the problem here.

View File

@@ -10,17 +10,13 @@ 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 issue is. (e.g. I'm always frustrated when [...])
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.

9
.github/pull_request_template.md vendored Normal file
View File

@@ -0,0 +1,9 @@
---
name: Pull Request
about: Create a pull request
title: ''
assignees: mob-sakai
---
**NOTE: Create a pull request to merge into `develop` branch**

View File

@@ -1,24 +1,87 @@
name: release
name: 🔖 Release
on:
workflow_dispatch:
push:
branches:
- preview
- main
- v*.x
- release
tags-ignore:
- "**"
jobs:
release:
name: 🔖 Release (${{ github.ref_name }})
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write
issues: write
outputs:
channel: ${{ steps.release.outputs.new_release_channel }}
released: ${{ steps.release.outputs.new_release_published }}
tag: ${{ steps.release.outputs.new_release_git_tag }}
version: ${{ steps.release.outputs.new_release_version }}
notes: ${{ steps.release.outputs.new_release_notes }}
steps:
- uses: actions/checkout@v3
- name: 🚚 Checkout (${{ github.ref_name }})
uses: actions/checkout@v4
- uses: cycjimmy/semantic-release-action@v3
- name: 🔖 Run semantic release
uses: cycjimmy/semantic-release-action@v4
id: release
with:
working_directory: Packages/src
extra_plugins: |
@semantic-release/changelog
@semantic-release/git
env:
GITHUB_TOKEN: ${{ github.token }}
- run: |
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 git tag: '${{ steps.release.outputs.new_release_git_tag }}'" | tee -a $GITHUB_STEP_SUMMARY
echo '${{ steps.release.outputs.new_release_notes }}' | tee -a $GITHUB_STEP_SUMMARY
merge-to-develop:
if: needs.release.outputs.released == 'true'
needs: release
name: 🔀 Merge to develop
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: 🚚 Checkout (develop)
uses: actions/checkout@v4
with:
ref: develop
fetch-depth: 0
- name: 🔀 Merge '${{ needs.release.outputs.tag }}' into 'develop'
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 develop
split-to-main:
if: needs.release.outputs.released == 'true'
needs: release
name: 🔀 Split package
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 'main'
run: |
git branch main origin/main
git subtree split --prefix=Packages/src --branch main
git tag ${{ needs.release.outputs.version }} main
git push origin ${{ needs.release.outputs.version }} main:main

View File

@@ -1,13 +1,23 @@
# Secrets
# UNITY_LICENSE:
name: test
# Required secrets
# UNITY_LICENSE: The contents of Unity license file
# UNITY_EMAIL: Unity user email to login
# UNITY_PASSWORD: Unity user password to login
name: 🧪 Test
env:
# MINIMUM_VERSION: The minimum version of Unity.
MINIMUM_VERSION: 2019.4
EXCLUDE_FILTER: '(2020.2.0)'
on:
workflow_dispatch:
push:
branches:
- develop
tags:
- "!*"
paths-ignore:
- "*.md"
pull_request:
types:
- opened
@@ -15,55 +25,66 @@ on:
jobs:
setup:
name: ⚙️ Setup
runs-on: ubuntu-latest
outputs:
versions: ${{ steps.setup.outputs.versions }}
unityVersions: ${{ steps.setup.outputs.unityVersions }}
steps:
- id: setup
- name: ⚙️ Find target Unity versions
id: setup
run: |
VERSIONS=`npx unity-changeset list --versions --all --latest-patch --min 2018.3 --json`
echo "==== Target Unity Versions ===="
echo "${VERSIONS}"
echo "::set-output name=versions::${VERSIONS}"
LATEST_VERSIONS=`npx unity-changeset list --versions --latest-patch --min ${MINIMUM_VERSION} --json --all`
ADDITIONAL_VERSIONS=`npx unity-changeset list --versions --grep '0f' --min ${MINIMUM_VERSION} --json`
VERSIONS=`echo "[${LATEST_VERSIONS}, ${ADDITIONAL_VERSIONS}]" \
| jq -c '[ flatten | sort | unique | .[] | select( test("${{ env.EXCLUDE_FILTER }}") | not ) ]'`
echo "unityVersions=${VERSIONS}" | tee $GITHUB_OUTPUT
test:
name: 🧪 Run tests
runs-on: ubuntu-latest
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
permissions:
checks: write
contents: read
needs: setup
strategy:
fail-fast: false
matrix:
version: ${{ fromJson(needs.setup.outputs.versions) }}
unityVersion: ${{ fromJson(needs.setup.outputs.unityVersions) }}
steps:
# Checkout sandbox project
- uses: actions/checkout@v3
with:
ref: sandbox
submodules: true
fetch-depth: 0
- name: 🚚 Checkout
uses: actions/checkout@v4
# Update package submodule
- name: "Update package submodule"
working-directory: Packages/dev
run: git checkout ${{ github.sha }}
# Cache
- uses: actions/cache@v3
- name: 📥 Cache library
uses: actions/cache@v4
with:
path: Library
key: Library-${{ matrix.version }}-${{ github.sha }}
key: Library-${{ matrix.unityVersion }}-${{ github.sha }}
restore-keys: |
Library-${{ matrix.version }}-
Library-${{ matrix.unityVersion }}-
Library-
# Run tests
- name: "Run tests"
uses: game-ci/unity-test-runner@v2
- name: 🛠️ Build Unity Project
uses: game-ci/unity-builder@v4
timeout-minutes: 45
with:
customImage: mobsakai/unity3d:${{ matrix.version }}
customImage: ghcr.io/mob-sakai/unity3d:${{ matrix.unityVersion }}
targetPlatform: StandaloneLinux64
allowDirtyBuild: true
customParameters: -nographics
# unityVersion: ${{ matrix.version }}
checkName: ${{ matrix.version }} Test Results
- name: 🧪 Run tests
uses: game-ci/unity-test-runner@v4
timeout-minutes: 45
with:
customImage: ghcr.io/mob-sakai/unity3d:${{ matrix.unityVersion }}
# unityVersion: ${{ matrix.unityVersion }}
customParameters: -nographics
checkName: ${{ matrix.unityVersion }} Test Results
githubToken: ${{ github.token }}
env:
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
coverageOptions: "dontClear;generateHtmlReport;generateBadgeReport;pathFilters:+**/Packages/src/**;assemblyFilters:+<packages>,-*.Editor,-*.Test"

30
.gitignore vendored Normal file
View File

@@ -0,0 +1,30 @@
# Windows
Thumbs.db
Desktop.ini
/*.csproj
/*.sln
# macOS
.DS_Store
# Vim
*.swp
# Unity
/Logs
/Library
/Temp
Assets/Plugins.meta
Assets/JMO Assets.meta
Assets/JMO Assets
Assets/EffectExamples/
Assets/EffectExamples.meta
Assets/Plugins/
# VS
.vs/
.vscode/
.idea/
obj/
bin/
UserSettings/

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: fa6e3b593bf274861b2eab47082d9b1e
guid: 7c9f7735cc2f24a7ca1c23043e63a6be
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -1,4 +1,4 @@
using System;
using System;
using System.Linq;
using System.Reflection;
using UnityEngine;
@@ -11,6 +11,7 @@ namespace Coffee.UIExtensions.Demo
public class CFX_Demo_With_UIParticle : MonoBehaviour
{
private MonoBehaviour _demo;
private string _demoType;
private Toggle _spawnOnUI;
private UIParticle _uiParticle;
@@ -20,7 +21,9 @@ namespace Coffee.UIExtensions.Demo
_uiParticle = GetComponentInChildren<UIParticle>();
_spawnOnUI = GetComponentInChildren<Toggle>();
_demo = FindObjectOfType("CFX_Demo_New") as MonoBehaviour
?? FindObjectOfType("WFX_Demo_New") as MonoBehaviour;
?? FindObjectOfType("WFX_Demo_New") as MonoBehaviour
?? FindObjectOfType("CFXR_Demo") as MonoBehaviour;
_demoType = _demo?.GetType().Name;
SetCanvasWidth(800);
SetCanvasRenderOverlay(true);
@@ -31,18 +34,44 @@ namespace Coffee.UIExtensions.Demo
{
if (!_spawnOnUI.isOn || !_demo || !Input.GetMouseButtonDown(0)) return;
foreach (Transform child in _uiParticle.transform)
if (_demoType == "CFX_Demo_New" || _demoType == "WFX_Demo_New")
{
Destroy(child.gameObject);
SpawnParticleCFX();
}
else if (_demoType == "CFXR_Demo")
{
SpawnParticleCFXR();
}
}
private void SpawnParticleCFXR()
{
var particle = _demo.GetType()
.GetField("currentEffect", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public)
?.GetValue(_demo) as GameObject;
if (!particle) return;
var instance = Instantiate(particle);
foreach (var c in instance.GetComponentsInChildren<MonoBehaviour>())
{
if (c.GetType().Name == "CFXR_Effect")
{
c.enabled = false;
}
}
_uiParticle.SetParticleSystemInstance(instance, true);
}
private void SpawnParticleCFX()
{
var particle = _demo.GetType()
.GetMethod("spawnParticle", BindingFlags.Instance | BindingFlags.NonPublic | BindingFlags.Public)
?.Invoke(_demo, Array.Empty<object>()) as GameObject;
if (!particle) return;
particle.transform.localScale = Vector3.one;
_uiParticle.SetParticleSystemInstance(particle);
_uiParticle.SetParticleSystemInstance(particle, true);
}
private static Object FindObjectOfType(string typeName)

View File

@@ -1,4 +1,4 @@
using UnityEngine;
using UnityEngine;
using UnityEngine.Serialization;
namespace Coffee.UIExtensions.Demo

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: f0b370726e57248da97c1c2f3bfd8bdf
guid: 64db617a76e9a4f1e90d0731175c1f7b
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -0,0 +1,33 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 194d2f2eb25c64ec0af5c323c74eb518, type: 3}
m_Name: NanoMonitor
m_EditorClassIdentifier:
m_NanoMonitorEnabled: 1
m_BootSceneNameRegex: .*
m_DevelopmentBuildOnly: 1
m_EnabledInEditor: 1
m_AlwaysIncludeAssembly: 1
m_InstantiateOnLoad: 1
m_Prefab: {fileID: 7211429669315726685, guid: b73940fc30a2f4eb9a73783e9c1f8da6,
type: 3}
m_Opened: 1
m_Interval: 0.5
m_Anchor: 1
m_CustomMonitorItems:
- m_Format: Screen:{0}x{1}
m_Arg0:
m_Path: UnityEngine.Screen, UnityEngine.CoreModule;width
m_Arg1:
m_Path: UnityEngine.Screen, UnityEngine.CoreModule;height
m_Arg2:
m_Path:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 86087a0847f384b538391745dad4565c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 784696794bc6345bc80bf49623581c2e
guid: b73940fc30a2f4eb9a73783e9c1f8da6
PrefabImporter:
externalObjects: {}
userData:

View File

@@ -0,0 +1,20 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 94e8c16a26d334eafa227ee444387432, type: 3}
m_Name: SimpleSceneNavigator
m_EditorClassIdentifier:
m_NavigatorEnabled: 1
m_EnabledInEditor: 1
m_AlwaysIncludeAssembly: 1
m_InstantiateOnLoad: 1
m_Prefab: {fileID: 7211429669315726685, guid: 46deb9632f6a14713b8460bd01e879c9,
type: 3}

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: be3e05903ef7041d39b3ef8ecdd47f08
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,513 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &3877588430955763108
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3877588430955763111}
- component: {fileID: 3877588430955763105}
- component: {fileID: 3877588430955763110}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3877588430955763111
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3877588430955763108}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 3877588431231610297}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &3877588430955763105
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3877588430955763108}
m_CullTransparentMesh: 0
--- !u!114 &3877588430955763110
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3877588430955763108}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 1
m_VerticalOverflow: 1
m_LineSpacing: 1
m_Text: '>>'
--- !u!1 &3877588431231610301
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3877588431231610297}
- component: {fileID: 3877588431231610302}
- component: {fileID: 3877588431231610303}
- component: {fileID: 3877588431231610300}
m_Layer: 5
m_Name: Button - >>
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3877588431231610297
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3877588431231610301}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 3877588430955763111}
m_Father: {fileID: 7211429669315725985}
m_RootOrder: 1
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 1, y: 1}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 30, y: 30}
m_Pivot: {x: 1, y: 1}
--- !u!222 &3877588431231610302
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3877588431231610301}
m_CullTransparentMesh: 0
--- !u!114 &3877588431231610303
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3877588431231610301}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &3877588431231610300
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3877588431231610301}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 3877588431231610303}
m_OnClick:
m_PersistentCalls:
m_Calls: []
--- !u!1 &3877588432219069602
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 3877588432219069614}
- component: {fileID: 3877588432219069615}
- component: {fileID: 3877588432219069612}
- component: {fileID: 3877588432219069613}
m_Layer: 5
m_Name: Button - <<
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &3877588432219069614
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3877588432219069602}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children:
- {fileID: 1738594088889562266}
m_Father: {fileID: 7211429669315725985}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 30, y: 30}
m_Pivot: {x: 0, y: 1}
--- !u!222 &3877588432219069615
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3877588432219069602}
m_CullTransparentMesh: 0
--- !u!114 &3877588432219069612
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3877588432219069602}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_Sprite: {fileID: 10905, guid: 0000000000000000f000000000000000, type: 0}
m_Type: 1
m_PreserveAspect: 0
m_FillCenter: 1
m_FillMethod: 4
m_FillAmount: 1
m_FillClockwise: 1
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &3877588432219069613
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 3877588432219069602}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Navigation:
m_Mode: 3
m_SelectOnUp: {fileID: 0}
m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0}
m_Transition: 1
m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1}
m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608}
m_ColorMultiplier: 1
m_FadeDuration: 0.1
m_SpriteState:
m_HighlightedSprite: {fileID: 0}
m_PressedSprite: {fileID: 0}
m_SelectedSprite: {fileID: 0}
m_DisabledSprite: {fileID: 0}
m_AnimationTriggers:
m_NormalTrigger: Normal
m_HighlightedTrigger: Highlighted
m_PressedTrigger: Pressed
m_SelectedTrigger: Selected
m_DisabledTrigger: Disabled
m_Interactable: 1
m_TargetGraphic: {fileID: 3877588432219069612}
m_OnClick:
m_PersistentCalls:
m_Calls: []
--- !u!1 &7211429669315726685
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 7211429669315725985}
- component: {fileID: 7211429669315726686}
- component: {fileID: 7211429669315726687}
- component: {fileID: 7143702096253919615}
- component: {fileID: 3330778306119167604}
m_Layer: 5
m_Name: SimpleSceneNavigator
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &7211429669315725985
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7211429669315726685}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_Children:
- {fileID: 3877588432219069614}
- {fileID: 3877588431231610297}
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 0}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!223 &7211429669315726686
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7211429669315726685}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 0
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_AdditionalShaderChannelsFlag: 0
m_SortingLayerID: 0
m_SortingOrder: 32000
m_TargetDisplay: 0
--- !u!114 &7211429669315726687
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7211429669315726685}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 1
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 600, y: 40}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
--- !u!114 &7143702096253919615
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7211429669315726685}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!114 &3330778306119167604
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7211429669315726685}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e7db36469bd2a46658ff432d65cb62ca, type: 3}
m_Name:
m_EditorClassIdentifier:
m_PrevButton: {fileID: 3877588432219069613}
m_NextButton: {fileID: 3877588431231610300}
m_PrevName: {fileID: 0}
m_NextName: {fileID: 0}
--- !u!1 &8570858711609111474
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1738594088889562266}
- component: {fileID: 5485386222362727379}
- component: {fileID: 3877588430751452752}
m_Layer: 5
m_Name: Text
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &1738594088889562266
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8570858711609111474}
m_LocalRotation: {x: -0, y: -0, z: -0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_Children: []
m_Father: {fileID: 3877588432219069614}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &5485386222362727379
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8570858711609111474}
m_CullTransparentMesh: 0
--- !u!114 &3877588430751452752
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 8570858711609111474}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, a: 1}
m_RaycastTarget: 1
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_FontData:
m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0}
m_FontSize: 14
m_FontStyle: 0
m_BestFit: 0
m_MinSize: 10
m_MaxSize: 40
m_Alignment: 4
m_AlignByGeometry: 0
m_RichText: 1
m_HorizontalOverflow: 1
m_VerticalOverflow: 1
m_LineSpacing: 1
m_Text: <<

View File

@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: be075f23fcc314d319e4f4ebfa6eefdd
TextScriptImporter:
guid: 46deb9632f6a14713b8460bd01e879c9
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:

1
Assets/Samples Symbolic link
View File

@@ -0,0 +1 @@
../Packages/src/Samples~

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: c5a6b37697e71473cb1ecc90047622d0
guid: 2132c9464acf94912a959f8cc6a68fa6
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: b888c253a15224f1fa518bed74028211
guid: 57d832714402a4bc5a0ed550741823ad
folderAsset: yes
DefaultImporter:
externalObjects: {}

View File

@@ -1,7 +1,11 @@
{
"name": "Coffee.NanoMonitor",
"references": [],
"optionalUnityReferences": [],
"name": "Coffee.UIParticle.Tests",
"references": [
"Coffee.UIParticle"
],
"optionalUnityReferences": [
"TestAssemblies"
],
"includePlatforms": [],
"excludePlatforms": [],
"allowUnsafeCode": false,

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 3d6cc132218a845708ce317bd33e5500
guid: 0253956e76ec342d49f1377578eb86be
AssemblyDefinitionImporter:
externalObjects: {}
userData:

8
Assets/Tests/Editor.meta Normal file
View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c49dbc815ad044a919bd5b7d4e6c59cf
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,19 @@
{
"name": "Coffee.UIParticle.Editor.Tests",
"references": [
"Coffee.UIParticle",
"Coffee.UIParticle.Editor"
],
"optionalUnityReferences": [
"TestAssemblies"
],
"includePlatforms": [
"Editor"
],
"excludePlatforms": [],
"allowUnsafeCode": false,
"overrideReferences": false,
"precompiledReferences": [],
"autoReferenced": false,
"defineConstraints": []
}

View File

@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 78daa55fa55814a33a3377d6ede8c43d
AssemblyDefinitionImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,26 @@
using System.Collections;
using NUnit.Framework;
using UnityEngine.TestTools;
namespace Coffee.UIParticle.Editor.Tests
{
public class NewTestScript
{
// A Test behaves as an ordinary method
[Test]
public void NewTestScriptSimplePasses()
{
// Use the Assert class to test conditions
}
// A UnityTest behaves like a coroutine in Play Mode. In Edit Mode you can use
// `yield return null;` to skip a frame.
[UnityTest]
public IEnumerator NewTestScriptWithEnumeratorPasses()
{
// Use the Assert class to test conditions.
// Use yield to skip a frame.
yield return null;
}
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 19e83f45e7d5648f2bd10122dc7fed14
guid: 5623180b85e024006b9a6772c3f241c5
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -0,0 +1,26 @@
using System.Collections;
using NUnit.Framework;
using UnityEngine.TestTools;
namespace Coffee.UIParticle.Tests
{
public class NewTestScript
{
// A Test behaves as an ordinary method
[Test]
public void NewTestScriptSimplePasses()
{
// Use the Assert class to test conditions
}
// A UnityTest behaves like a coroutine in Play Mode. In Edit Mode you can use
// `yield return null;` to skip a frame.
[UnityTest]
public IEnumerator NewTestScriptWithEnumeratorPasses()
{
// Use the Assert class to test conditions.
// Use yield to skip a frame.
yield return null;
}
}
}

View File

@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 87fefa9f373e8411596b00238a65f3c3
guid: d52f7d64d782c421284267dd1c197210
MonoImporter:
externalObjects: {}
serializedVersion: 2

View File

@@ -1,30 +0,0 @@
# Contributing
## How to Contribute
#### Code of Conduct
This repository has adopted the Contributor Covenant as it's
Code of Conduct. It is expected that participants adhere to it.
#### Proposing a Change
If you are unsure about whether or not a change is desired,
you can create an issue. This is useful because it creates
the possibility for a discussion that's visible to everyone.
When fixing a bug it is fine to submit a pull request right away.
#### Sending a Pull Request
Steps to be performed to submit a pull request:
1. Fork the repository and create your branch from `develop`.
2. If you have fixed a bug or added code that should be tested, add tests.
3. Click `Window > Generals > Test Runner` to test
4. Commit with a massage based on [Angular Commit Message Conventions](https://gist.github.com/stephenparish/9941e89d80e2bc58a153).
5. Fill out the description, link any related issues and submit your pull request.
#### License
By contributing to this repository, you agree that your contributions will be licensed under its MIT license.

8
Packages/manifest.json Normal file
View File

@@ -0,0 +1,8 @@
{
"dependencies": {
"com.unity.ide.rider": "3.0.27",
"com.unity.test-framework": "1.1.33",
"com.unity.modules.animation": "1.0.0",
"com.unity.modules.physics": "1.0.0"
}
}

View File

@@ -0,0 +1,85 @@
{
"dependencies": {
"com.coffee.ui-particle": {
"version": "file:src",
"depth": 0,
"source": "embedded",
"dependencies": {
"com.unity.ugui": "1.0.0",
"com.unity.modules.particlesystem": "1.0.0"
}
},
"com.unity.ext.nunit": {
"version": "1.0.6",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.ide.rider": {
"version": "3.0.27",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ext.nunit": "1.0.6"
},
"url": "https://packages.unity.com"
},
"com.unity.test-framework": {
"version": "1.1.33",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.ext.nunit": "1.0.6",
"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.ugui": {
"version": "1.0.0",
"depth": 1,
"source": "builtin",
"dependencies": {
"com.unity.modules.ui": "1.0.0",
"com.unity.modules.imgui": "1.0.0"
}
},
"com.unity.modules.animation": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.imgui": {
"version": "1.0.0",
"depth": 1,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.jsonserialize": {
"version": "1.0.0",
"depth": 1,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.particlesystem": {
"version": "1.0.0",
"depth": 1,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.physics": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.ui": {
"version": "1.0.0",
"depth": 2,
"source": "builtin",
"dependencies": {}
}
}
}

View File

@@ -1,14 +1,11 @@
{
"branches": [
"+([0-9])?(.{+([0-9]),x}).x",
"master",
"main",
"release",
{
"name": "preview",
"prerelease": true
}
],
"tagFormat": "${version}",
"plugins": [
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",

View File

@@ -1,3 +1,82 @@
## [4.6.2](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v4.6.1...v4.6.2) (2024-02-01)
### Bug Fixes
* fix compile error in Unity 2021.1 or older ([fcae60b](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/fcae60bf29079bac07463bd3a86f8644151d72ba))
* fix demos ([ad20d12](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/ad20d128a2ad033d9f30b98f0a0dab6091f5aa19))
* fix warning ([7fd4a8e](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/7fd4a8e343ce587dffa9db5ff186061b3ebb38a6))
## [4.6.1](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v4.6.0...v4.6.1) (2024-01-26)
### Bug Fixes
* unintended scaling occurs when `AutoScalingMode=UIParticle` and `ScalingMode=Local` ([1627de1](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/1627de10eb1e742a015603ae9939071665a5bd89)), closes [#292](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/292)
# [4.6.0](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v4.5.2...v4.6.0) (2024-01-26)
### Bug Fixes
* fix abnormal mesh bounds error ([772bf50](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/772bf50d168982bd401c30e58172e0a60fbafe46)), closes [#213](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/213)
* fix warning ([93d3919](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/93d3919b6fb6ac186b3e99f8baaef9a044f583f2))
* fix warning ([8a78ec1](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/8a78ec13ad2aad9138a22b67c332871e064a38cc))
### Features
* "[generated]" GameObjects on the hierarchy is disturbing ([7c42421](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/7c4242150b591daf64390588afa27efa27368af3)), closes [#288](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/288)
* add explicit dependencies ([9a0187a](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/9a0187a72a35d378ff7be965bfcb7475f423fe0f))
* add icon ([0c1022c](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/0c1022c6224394713f62b41e5e4ef0c289610ae1))
* remove samples ([f53a7fa](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/f53a7faed3ee73ac22d745a778284e818624b510))
# [4.6.0-preview.1](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/v4.5.2...v4.6.0-preview.1) (2024-01-24)
### Bug Fixes
* fix abnormal mesh bounds error ([772bf50](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/772bf50d168982bd401c30e58172e0a60fbafe46)), closes [#213](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/213)
* fix warning ([93d3919](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/93d3919b6fb6ac186b3e99f8baaef9a044f583f2))
* fix warning ([8a78ec1](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/8a78ec13ad2aad9138a22b67c332871e064a38cc))
### Features
* "[generated]" GameObjects on the hierarchy is disturbing ([7c42421](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/7c4242150b591daf64390588afa27efa27368af3)), closes [#288](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/288)
* add explicit dependencies ([9a0187a](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/9a0187a72a35d378ff7be965bfcb7475f423fe0f))
* add icon ([0c1022c](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/0c1022c6224394713f62b41e5e4ef0c289610ae1))
* remove samples ([f53a7fa](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/f53a7faed3ee73ac22d745a778284e818624b510))
## [4.5.2](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/4.5.1...4.5.2) (2024-01-18)
### Bug Fixes
* (editor) sometimes crashes when entering play mode ([b80c3e6](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/b80c3e6c9fdd2a8fb72ff233edb85df2e3dbba3d))
## [4.5.1](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/4.5.0...4.5.1) (2023-12-23)
### Bug Fixes
* fix material for mesh sharing group ([6126af9](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/6126af9f376dd4c100a1b9d19d9499bdef7d5566))
* the changes made to the material used by the ParticleSystem are not immediately reflected ([3184ba9](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/3184ba94ae08264223c0c71443ad70acc1a1ccb2)), closes [#280](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/280)
# [4.5.0](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/4.4.0...4.5.0) (2023-12-23)
### Bug Fixes
* incorrect rendering of world-space simulated particles while animating scale ([ac58475](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/ac584755393d87bda2e80d9653370b7e4c68912f)), closes [#285](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/285)
* remove obsolete warning ([5d5eb34](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/5d5eb34590b7cefb0e4ac26c0441e104176ce522))
### Features
* Automatically generated objects are no longer editable (NotEditable). ([5607dc4](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/5607dc4eed0c086b4651941953df6c7d535712e0))
* support IMeshModifier ([5c3232f](https://github.com/mob-sakai/ParticleEffectForUGUI/commit/5c3232faf3d2cfad1e3e1a9349b8346c7982a608)), closes [#282](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/282)
# [4.4.0](https://github.com/mob-sakai/ParticleEffectForUGUI/compare/4.3.0...4.4.0) (2023-11-08)

View File

@@ -0,0 +1,43 @@
# Contributing
## How to Contribute
#### Code of Conduct
This repository has adopted the Contributor Covenant as it's
Code of Conduct. It is expected that participants adhere to it.
#### Proposing a Change
If you are unsure about whether or not a change is desired,
you can create an issue. This is useful because it creates
the possibility for a discussion that's visible to everyone.
When fixing a bug it is fine to submit a pull request right away.
#### Sending a Pull Request
Steps to be performed to submit a pull request:
1. Fork the repository.
2. Clone the repository.
3. Checkout `develop` branch.
4. Develop the package.
5. Test the package with the test runner (`Window > Generals > Test Runner`).
6. Commit with a message based
on [Angular Commit Message Conventions](https://gist.github.com/stephenparish/9941e89d80e2bc58a153) as follows:
- `fix:` fix a bug
- `feat:` new feature
- `docs:` changes only in documentation
- `style:` changes only in formatting, white-space, etc
- `refactor:` changes only in code structure (extract method, rename variable, move method, etc)
- `perf:` changes only in code performance
- `test:` add or update tests
- `chore:` changes to the build process or auxiliary tools and libraries such as documentation generation
7. Create a pull request on GitHub. Fill out the description, link any related issues and submit your pull request.
#### License
By contributing to this repository, you agree that your contributions will be licensed under its MIT license.

View File

@@ -1,24 +1,24 @@
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using UnityEditor;
using UnityEditor.UI;
using UnityEditorInternal;
using UnityEngine;
using UnityEngine.UI;
using Coffee.UIParticleExtensions;
#if UNITY_2021_2_OR_NEWER
using UnityEditor.Overlays;
#else
using System;
using System.Reflection;
using Object = UnityEngine.Object;
#endif
#if UNITY_2021_2_OR_NEWER
using UnityEditor.SceneManagement;
#elif UNITY_2018_3_OR_NEWER
using UnityEditor.Experimental.SceneManagement;
#endif
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using Coffee.UIParticleExtensions;
using UnityEditor;
using UnityEditor.UI;
using UnityEditorInternal;
using UnityEngine;
using UnityEngine.UI;
using Object = UnityEngine.Object;
namespace Coffee.UIExtensions
{
@@ -29,9 +29,9 @@ namespace Coffee.UIExtensions
#if UNITY_2021_2_OR_NEWER
#if UNITY_2022_1_OR_NEWER
[Overlay(typeof(SceneView), "Scene View/UI Particles", "UI Particles", true,
defaultDockPosition = DockPosition.Bottom,
defaultDockZone = DockZone.Floating,
defaultLayout = Layout.Panel)]
defaultDockPosition = DockPosition.Bottom,
defaultDockZone = DockZone.Floating,
defaultLayout = Layout.Panel)]
#else
[Overlay(typeof(SceneView), "Scene View/UI Particles", "UI Particles", true)]
#endif
@@ -43,7 +43,7 @@ namespace Coffee.UIExtensions
{
if (visible)
{
WindowFunction(null, null);
WindowFunction();
}
}
}
@@ -75,8 +75,9 @@ namespace Coffee.UIExtensions
private bool _showMax;
private static readonly HashSet<Shader> s_Shaders = new HashSet<Shader>();
#if UNITY_2018 || UNITY_2019
private static readonly List<ParticleSystemVertexStream> s_Streams = new List<ParticleSystemVertexStream>();
#endif
private static readonly List<string> s_MaskablePropertyNames = new List<string>
{
"_Stencil",
@@ -128,6 +129,7 @@ namespace Coffee.UIExtensions
.Concat(Selection.gameObjects.Select(x => x.GetComponent<UIParticle>())
.Where(x => x && x.canvas))
.Distinct()
.OfType<Object>()
.ToArray();
return 0 < uiParticles.Length ? new SerializedObject(uiParticles) : null;
}
@@ -327,11 +329,15 @@ namespace Coffee.UIExtensions
// UIParticle for trail should be removed.
var label = "This UIParticle component should be removed. The UIParticle for trails is no longer needed.";
#pragma warning disable CS0612
if (FixButton(current.m_IsTrail, label))
#pragma warning restore CS0612
{
DestroyUIParticle(current);
}
#if UNITY_2018 || UNITY_2019
// (2018, 2019) Check to use 'TEXCOORD*.zw' components as custom vertex stream.
var allPsRenderers = targets.OfType<UIParticle>()
.SelectMany(x => x.particles)
.Where(x => x)
@@ -357,6 +363,7 @@ namespace Coffee.UIExtensions
s_Streams.Clear();
}
}
#endif
}
private bool IsBuiltInObject(Object obj)
@@ -365,6 +372,7 @@ namespace Coffee.UIExtensions
&& Regex.IsMatch(guid, "^0{16}.0{15}$", RegexOptions.Compiled);
}
#if UNITY_2018 || UNITY_2019
private static int GetUsedComponentCount(ParticleSystemVertexStream s)
{
switch (s)
@@ -423,6 +431,7 @@ namespace Coffee.UIExtensions
return 3;
}
#endif
private static bool DrawMeshSharing(SerializedProperty spMeshSharing, SerializedProperty spGroupId,
SerializedProperty spGroupMaxId, bool showMax)
@@ -482,12 +491,16 @@ namespace Coffee.UIExtensions
};
}
private static void WindowFunction(Object target, SceneView sceneView)
#if UNITY_2021_2_OR_NEWER
private static void WindowFunction()
#else
private static void WindowFunction(Object _, SceneView __)
#endif
{
try
{
if (s_SerializedObject == null || !s_SerializedObject.targetObject) return;
var uiParticles = s_SerializedObject.targetObjects.OfType<UIParticle>();
var uiParticles = s_SerializedObject.targetObjects.OfType<UIParticle>().ToArray();
if (uiParticles.Any(x => !x || !x.canvas)) return;
s_SerializedObject.Update();
@@ -523,7 +536,7 @@ namespace Coffee.UIExtensions
if (stage != null && stage.scene.isLoaded)
{
#if UNITY_2020_1_OR_NEWER
string prefabAssetPath = stage.assetPath;
var prefabAssetPath = stage.assetPath;
#else
var prefabAssetPath = stage.prefabAssetPath;
#endif

8
Packages/src/Icons.meta Normal file
View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7a55e246f37df405bac88eac692e3a86
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

Binary file not shown.

After

Width:  |  Height:  |  Size: 418 B

View File

@@ -0,0 +1,127 @@
fileFormatVersion: 2
guid: 5f0675613942149309588d556e33d990
TextureImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 12
mipmaps:
mipMapMode: 0
enableMipMap: 0
sRGBTexture: 1
linearTexture: 0
fadeOut: 0
borderMipMap: 0
mipMapsPreserveCoverage: 0
alphaTestReferenceValue: 0.5
mipMapFadeDistanceStart: 1
mipMapFadeDistanceEnd: 3
bumpmap:
convertToNormalMap: 0
externalNormalMap: 0
heightScale: 0.25
normalMapFilter: 0
flipGreenChannel: 0
isReadable: 0
streamingMipmaps: 0
streamingMipmapsPriority: 0
vTOnly: 0
ignoreMipmapLimit: 0
grayScaleToAlpha: 0
generateCubemap: 6
cubemapConvolution: 0
seamlessCubemap: 0
textureFormat: 1
maxTextureSize: 2048
textureSettings:
serializedVersion: 2
filterMode: 1
aniso: 1
mipBias: 0
wrapU: 1
wrapV: 1
wrapW: 0
nPOTScale: 0
lightmap: 0
compressionQuality: 50
spriteMode: 0
spriteExtrude: 1
spriteMeshType: 1
alignment: 0
spritePivot: {x: 0.5, y: 0.5}
spritePixelsToUnits: 100
spriteBorder: {x: 0, y: 0, z: 0, w: 0}
spriteGenerateFallbackPhysicsShape: 1
alphaUsage: 1
alphaIsTransparency: 1
spriteTessellationDetail: -1
textureType: 2
textureShape: 1
singleChannelComponent: 0
flipbookRows: 1
flipbookColumns: 1
maxTextureSizeSet: 0
compressionQualitySet: 0
textureFormatSet: 0
ignorePngGamma: 0
applyGammaDecoding: 0
swizzle: 50462976
cookieLightType: 0
platformSettings:
- serializedVersion: 3
buildTarget: DefaultTexturePlatform
maxTextureSize: 64
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Standalone
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
- serializedVersion: 3
buildTarget: Server
maxTextureSize: 2048
resizeAlgorithm: 0
textureFormat: -1
textureCompression: 1
compressionQuality: 50
crunchedCompression: 0
allowsAlphaSplitting: 0
overridden: 0
ignorePlatformSupport: 0
androidETC2FallbackOverride: 0
forceMaximumCompressionQuality_BC6H_BC7: 0
spriteSheet:
serializedVersion: 2
sprites: []
outline: []
physicsShape: []
bones: []
spriteID:
internalID: 0
vertices: []
indices:
edges: []
weights: []
secondaryTextures: []
nameFileIdTable: {}
mipmapLimitGroupName:
pSDRemoveMatte: 0
userData:
assetBundleName:
assetBundleVariant:

483
Packages/src/README.md Normal file
View File

@@ -0,0 +1,483 @@
# Particle Effect For UGUI (UI Particle)
This package provides a component to render particle effects for uGUI in Unity 2018.2 or later.
The particle rendering is maskable and sortable, without the need for an extra Camera, RenderTexture, or Canvas.
[![](https://img.shields.io/npm/v/com.coffee.ui-particle?label=openupm&registry_uri=https://package.openupm.com)](https://openupm.com/packages/com.coffee.ui-particle/)
[![](https://img.shields.io/github/v/release/mob-sakai/ParticleEffectForUGUI?include_prereleases)](https://github.com/mob-sakai/ParticleEffectForUGUI/releases)
[![](https://img.shields.io/github/license/mob-sakai/ParticleEffectForUGUI.svg)](https://github.com/mob-sakai/ParticleEffectForUGUI/blob/main/LICENSE.txt)
![](https://img.shields.io/badge/Unity-2018.2+-57b9d3.svg?style=flat&logo=unity)
![](https://github.com/mob-sakai/ParticleEffectForUGUI/actions/workflows/test.yml/badge.svg?branch=develop)
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-orange.svg)](http://makeapullrequest.com)
[![](https://img.shields.io/twitter/follow/mob_sakai.svg?label=Follow&style=social)](https://twitter.com/intent/follow?screen_name=mob_sakai)
<< [📝 Description](#-description) | [🎮 Demo](#-demo) | [⚙ Installation](#-installation) | [🚀 Usage](#-usage) | [🛠 Development Note](#-development-note) | [🤝 Contributing](#-contributing) >>
<br><br>
## 📝 Description
![](https://user-images.githubusercontent.com/12690315/41771577-8da4b968-7650-11e8-9524-cd162c422d9d.gif)
This package utilizes the new APIs `MeshBake/MashTrailBake` (introduced with Unity 2018.2) to render particles through
CanvasRenderer.
You can render, mask, and sort your ParticleSystems for UI without the necessity of an additional Camera, RenderTexture,
or Canvas.
### Features
* Easy to use: The package is ready to use out of the box.
* Sort particle effects and other UI by sibling index.
* No extra Camera, RenderTexture, or Canvas required.
* Masking options for Mask or RectMask2D.
* Support for the Trail module.
* Support for CanvasGroup alpha.
* No allocations needed to render particles.
* Compatibility with overlay, camera space, and world space.
* Support for Universal Render Pipeline (URP) and High Definition Render Pipeline (HDRP).
* Support for disabling `Enter Play Mode Options > Reload Domain`.
* Support for changing material property with AnimationClip (AnimatableProperty).
![AnimatableProperty.gif][AnimatableProperty.gif]
* [4.0.0+] Support for 8+ materials.
* [4.0.0+] Correct world space particle position adjustment when changing window size for standalone platforms (Windows,
MacOSX, and Linux).
* [4.0.0+] Adaptive scaling for UI.
* [4.0.0+] Mesh sharing group to improve performance.
![MeshSharing.gif][MeshSharing.gif]
* [4.0.0+] Particle attractor component.
![ParticleAttractor.gif][ParticleAttractor.gif]
* [4.1.0+] Relative/Absolute particle position mode.
![AbsolutePosition.gif][AbsolutePosition.gif]
[AnimatableProperty.gif]: https://user-images.githubusercontent.com/12690315/53286323-2d94a980-37b0-11e9-8afb-c4a207805ff2.gif
[MeshSharing.gif]: https://user-images.githubusercontent.com/12690315/174311048-c882df81-6c34-4eba-b0aa-5645457692f1.gif
[ParticleAttractor.gif]: https://user-images.githubusercontent.com/12690315/174311027-462929a4-13f0-4ec4-86ea-9c832f2eecf1.gif
[AbsolutePosition.gif]: https://user-images.githubusercontent.com/12690315/175751579-5a2357e8-2ecf-4afd-83c8-66e9771bde39.gif
<br><br>
## 🎮 Demo
* [WebGL Demo](https://mob-sakai.github.io/demos/UIParticle_Demo/index.html)
> ![](https://user-images.githubusercontent.com/12690315/174311768-1843a5f2-f776-491b-aaa8-2a131a8b6a16.gif)
* [WebGL Demo (Cartoon FX & War FX)](https://mob-sakai.github.io/Demos/ParticleEffectForUGUI_CFX)
* [Cartoon FX Free][CFX] & [War FX][WFX] (by [Jean Moreno (JMO)][JMO]) with UIParticle
> ![](https://user-images.githubusercontent.com/12690315/91664766-3e07ac00-eb2c-11ea-978b-ef723be80619.gif)
[CFX]: https://assetstore.unity.com/packages/vfx/particles/cartoon-fx-free-109565
[WFX]: https://assetstore.unity.com/packages/vfx/particles/war-fx-5669
[JMO]: https://assetstore.unity.com/publishers/1669
<br><br>
## ⚙ Installation
_This package requires Unity 2018.3 or later._
#### Install via OpenUPM
This package is available on [OpenUPM](https://openupm.com) package registry.
This is the preferred method of installation, as you can easily receive updates as they're released.
If you have [openupm-cli](https://github.com/openupm/openupm-cli) installed, then run the following command in your
project's directory:
```sh
openupm add com.coffee.ui-particle
```
#### Install via UPM (using Git URL)
Navigate to your project's Packages folder and open the `manifest.json` file. Then add this package somewhere in
the `dependencies` block:
```json
{
"dependencies": {
"com.coffee.ui-particle": "https://github.com/mob-sakai/ParticleEffectForUGUI.git",
...
}
}
```
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.6.0",`
Or, use [UpmGitExtension](https://github.com/mob-sakai/UpmGitExtension) to install and update the package.
<br><br>
## 🚀 Usage
### UIParticle Component
`UIParticle` controls the ParticleSystems that are attached to its own game objects and child game objects.
![](https://github.com/mob-sakai/ParticleEffectForUGUI/assets/12690315/3559df45-63e7-4c4c-9233-f455779efa29)
- **Maskable**: Does this graphic allow masking.
- **Scale**: Scale the rendering. When the `3D` toggle is enabled, 3D scale (x, y, z) is supported.
- **Animatable Properties**: If you want to update material properties (e.g., `_MainTex_ST`, `_Color`) in AnimationClip,
use this to mark the changes.
- **Mesh Sharing**: Particle simulation results are shared within the same group. A large number of the same effects can
be displayed with a small load. When the `Random` toggle is enabled, it will be grouped randomly.
- **Position Mode**: Emission position mode.
- **Absolute:** Emit from the world position of the `ParticleSystem`.
- **Relative:** Emit from the scaled position of the `ParticleSystem`.
- **Auto Scaling**: `Transform.lossyScale` (=world scale) will be set to `(1, 1, 1)` on update. It prevents the
root-Canvas scale from affecting the hierarchy-scaled `ParticleSystem`.
- **Rendering Order**: The ParticleSystem list to be rendered. You can change the order and the materials.
**NOTE:** Press the `Refresh` button to reconstruct the rendering order based on children ParticleSystem's sorting order
and z-position.
<br><br>
#### Basic Usage
1. Select `GameObject/UI/ParticleSystem` to create UIParticle with a ParticleSystem.
![particle](https://user-images.githubusercontent.com/12690315/95007361-cad0e880-0649-11eb-8835-f145d62c5977.png)
2. Adjust the ParticleSystem as you like.
![particle1](https://user-images.githubusercontent.com/12690315/95007359-ca385200-0649-11eb-8383-627c9750bda8.png)
<br>
#### With Your Existing ParticleSystem Prefab
1. Select `GameObject/UI/ParticleSystem (Empty)` to create UIParticle.
![empty](https://user-images.githubusercontent.com/12690315/95007362-cb697f00-0649-11eb-8a09-29b0a13791e4.png)
2. Drag and drop your ParticleSystem prefab onto UIParticle.
![particle3](https://user-images.githubusercontent.com/12690315/95007356-c6a4cb00-0649-11eb-9316-562f4bce3f31.png)
<br>
#### With `Mask` or `RectMask2D` Component
If you want to mask particles, set a stencil-supported shader (such as `UI/UIAdditive`) to the material for
ParticleSystem.
If you use some custom shaders, see
the [How to Make a Custom Shader to Support Mask/RectMask2D Component](#how-to-make-a-custom-shader-to-support-maskrectmask2d-component)
section.
![](https://user-images.githubusercontent.com/12690315/95017591-3b512700-0695-11eb-864e-04166ea1809a.png)
<br><br>
### Script usage
```cs
// Instant ParticleSystem prefab with UIParticle on runtime.
var go = GameObject.Instantiate(prefab);
var uiParticle = go.AddComponent<UIParticle>();
// Control by ParticleSystem.
particleSystem.Play();
particleSystem.Emit(10);
// Control by UIParticle.
uiParticle.Play();
uiParticle.Stop();
```
<br><br>
### UIParticleAttractor component
`UIParticleAttractor` attracts particles generated by the specified ParticleSystem.
![](https://github.com/mob-sakai/ParticleEffectForUGUI/assets/12690315/ea6ae0ed-f9a8-437c-8baa-47526303391e)
![](https://user-images.githubusercontent.com/12690315/174311027-462929a4-13f0-4ec4-86ea-9c832f2eecf1.gif)
- **Particle System**: Attracts particles generated by the specified particle system.
- **Destination Radius**: Once the particle is within the radius, the particle lifetime will become 0, and `OnAttracted`
will be called.
- **Delay Rate**: Delay to start attracting. It is a percentage of the particle's start lifetime.
- **Max Speed**: Maximum speed of attracting. If this value is too small, attracting may not be completed by the end of
the lifetime, and `OnAttracted` may not be called.
- **Movement**: Attracting movement type. (`Linear`, `Smooth`, `Sphere`)
- **Update Mode**: Update mode.
- **Normal:** Update with scaled delta time.
- **Unscaled Time:** Update with unscaled delta time.
- **OnAttracted**: An event called when attracting is complete (per particle).
<br><br>
## 🛠 Development Note
### Compares the Baking mesh approach with the conventional approach
- **Baking mesh approach (=UIParticle)**
![](https://user-images.githubusercontent.com/12690315/41765089-0302b9a2-763e-11e8-88b3-b6ffa306bbb0.gif)
- ✅ Rendered as is.
- ✅ Maskable.
- ✅ Sortable.
- ✅ Less objects.
- **Do nothing (=Plain ParticleSystem)**
![](https://user-images.githubusercontent.com/12690315/41765090-0329828a-763e-11e8-8d8a-f1d269ea3bc7.gif)
- ✅ Rendered as is.
- ❌ Looks like a glitch.
- ❌ Not maskable.
- ❌ Not sortable.
- **Convert particle to UIVertex (=[UIParticleSystem][UIParticleSystem])**
![](https://user-images.githubusercontent.com/12690315/41765088-02deb9c6-763e-11e8-98d0-9e0c1766ef39.gif)
- ✅ Maskable.
- ✅ Sortable.
- ❌ Adjustment is difficult.
- ❌ Requires UI shaders.
- ❌ Difficult to adjust scale.
- ❌ Force hierarchy scalling.
- ❌ Simulation results are incorrect.
- ❌ Trail, rotation of transform, time scaling are not supported.
- ❌ Generate heavy GC every frame.
- **Use Canvas to sort (Sorting By Canvas )**
![](https://user-images.githubusercontent.com/12690315/41765087-02b866ea-763e-11e8-8c33-081c9ad852f8.gif)
- ✅ Rendered as is.
- ✅ Sortable.
- ❌ You must to manage sorting orders.
- ❌ Not maskable.
- ❌ More batches.
- ❌ Requires Canvas.
- **Use RenderTexture**
![](https://user-images.githubusercontent.com/12690315/41765085-0291b3e2-763e-11e8-827b-72e5ee9bc556.gif)
- ✅ Maskable.
- ✅ Sortable.
- ❌ Requires Camera and RenderTexture.
- ❌ Difficult to adjust position and size.
- ❌ Quality depends on the RenderTexture's setting.
[UIParticleSystem]: https://forum.unity.com/threads/free-script-particle-systems-in-ui-screen-space-overlay.406862/
#### [Performance test results](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/193#issuecomment-1160028374)
| Approach | FPS on Editor | FPS on iPhone6 | FPS on Xperia XZ |
|-----------------------------|---------------|----------------|------------------|
| Particle System | 43 | 57 | 22 |
| UIParticleSystem | 4 | 3 | 0 (unmeasurable) |
| Sorting By Canvas | 43 | 44 | 18 |
| UIParticle | 17 | 12 | 4 |
| UIParticle with MeshSharing | 44 | 45 | 30 |
### 🔍 FAQ: Why Are My UIParticles Not Displayed Correctly?
If `ParticleSystem` alone displays particles correctly but `UIParticle` does not, please check the following points:
- [Shader Limitation](#shader-limitation)
- `UIParticle` does not support all built-in shaders except for `UI/Default`.
- Most cases can be solved by using `UI/Additive` or `UI/Default`.
- Particles are not masked
- `UIParticle` is maskable.
- Set `Mask` or `RectMask2D` component properly.
- [Use maskable/clipable shader](#how-to-make-a-custom-shader-to-support-maskrectmask2d-component) (such
as `UI/Additive` or `UI/Default`)
- Particles are too small
- If particles are small enough, they will not appear on the screen.
- Increase the `Scale` value.
- If you don't want to change the apparent size depending on the resolution, try the `Auto Scaling` option.
- Particles are too many
- No more than 65535 vertices can be displayed (for mesh combination limitations).
- Please set `Emission` module and `Max Particles` of ParticleSystem properly.
- Particles are emitted off-screen.
- When `Position Mode = Relative`, particles are emitted from the scaled position of the ParticleSystem, not from
the screen point of the ParticleSystem.
- Place the ParticleSystem in the proper position or try `Position Mode = Absolute`.
- Attaching `UIParticle` to the same object as `ParticleSystem`
- `Transform.localScale` will be overridden by the `Auto Scaling` option.
- It is recommended to place `ParticleSystem` under `UIParticle`.
- If `Transform.localScale` contains 0, rendering will be skipped.
- Displayed particles are in the correct position but too large/too small
- Adjust `ParticleSystem.renderer.Min/MaxParticleSize`.
<br>
### Shader Limitation
The use of UI shaders is recommended.
- If you need a simple Additive shader, use the `UI/Additive` shader instead.
- If you need a simple alpha-blend shader, use the `UI/Default` shader instead.
- If your custom shader does not work properly with UIParticle, consider creating a custom UI shader.
#### Built-in shaders are not supported
`UIParticle` does not support all built-in shaders except for `UI/Default`.
If their use is detected, an error is displayed in the inspector.
Use UI shaders instead.
#### (Unity 2018 or 2019) UV.zw components will be discarded
UIParticleRenderer renders the particles based on UIVertex.
Therefore, only the xy components are available for each UV in the shader. (zw components will be discarded).
So unfortunately, UIParticles will not work well with some shaders.
#### (Unity 2018 or 2019) Custom vertex streams
When using custom vertex streams, you can fill zw components with "unnecessary" data.
Refer to [this issue](https://github.com/mob-sakai/ParticleEffectForUGUI/issues/191) for more information.
<br>
### Overheads
UIParticle has some overheads, and the batching depends on uGUI.
When improving performance, keep the following in mind:
- If you are displaying a large number of the same effect, consider the `Mesh Sharing` feature in
the [UIParticle Component](#uiparticle-component).
- If you don't like the uniform output, consider the `Random Group` feature.
![](https://user-images.githubusercontent.com/12690315/174311048-c882df81-6c34-4eba-b0aa-5645457692f1.gif)
- If you are using multiple materials, you will have more draw calls.
- Consider a single material, atlasing the sprites, and using `Sprite` mode in the `Texture Sheet Animation` module
in the ParticleSystem.
### How to Make a Custom Shader to Support Mask/RectMask2D Component
<details>
<summary>Shader tips</summary>
```ShaderLab
Shader "Your/Custom/Shader"
{
Properties
{
// ...
// #### required for Mask ####
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0
}
SubShader
{
Tags
{
// ...
}
// #### required for Mask ####
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
ColorMask [_ColorMask]
// ...
Pass
{
// ...
// #### required for RectMask2D ####
#include "UnityUI.cginc"
#pragma multi_compile __ UNITY_UI_CLIP_RECT
float4 _ClipRect;
// #### required for Mask ####
#pragma multi_compile __ UNITY_UI_ALPHACLIP
struct appdata_t
{
// ...
};
struct v2f
{
// ...
// #### required for RectMask2D ####
float4 worldPosition : TEXCOORD1;
};
v2f vert(appdata_t v)
{
v2f OUT;
// ...
// #### required for RectMask2D ####
OUT.worldPosition = v.vertex;
return OUT;
}
fixed4 frag(v2f IN) : SV_Target
{
// ...
// #### required for RectMask2D ####
#ifdef UNITY_UI_CLIP_RECT
color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
#endif
// #### required for Mask ####
#ifdef UNITY_UI_ALPHACLIP
clip (color.a - 0.001);
#endif
return color;
}
ENDCG
}
}
}
```
</details>
<br><br>
## 🤝 Contributing
### Issues
Issues are incredibly valuable to this project:
- Ideas provide a valuable source of contributions that others can make.
- Problems help identify areas where this project needs improvement.
- Questions indicate where contributors can enhance the user experience.
### Pull Requests
Pull requests offer a fantastic way to contribute your ideas to this repository.
Please refer to [CONTRIBUTING.md](https://github.com/mob-sakai/ParticleEffectForUGUI/blob/main/CONTRIBUTING.md)
and [develop branch](https://github.com/mob-sakai/ParticleEffectForUGUI/tree/develop) for guidelines.
### Support
This is an open-source project developed during my spare time.
If you appreciate it, consider supporting me.
Your support allows me to dedicate more time to development. 😊
[![](https://user-images.githubusercontent.com/12690315/50731629-3b18b480-11ad-11e9-8fad-4b13f27969c1.png)](https://www.patreon.com/join/2343451?)
[![](https://user-images.githubusercontent.com/12690315/66942881-03686280-f085-11e9-9586-fc0b6011029f.png)](https://github.com/users/mob-sakai/sponsorship)
<br><br>
## License
* MIT
## Author
* ![](https://user-images.githubusercontent.com/12690315/96986908-434a0b80-155d-11eb-8275-85138ab90afa.png) [mob-sakai](https://github.com/mob-sakai) [![](https://img.shields.io/twitter/follow/mob_sakai.svg?label=Follow&style=social)](https://twitter.com/intent/follow?screen_name=mob_sakai) ![GitHub followers](https://img.shields.io/github/followers/mob-sakai?style=social)
## See Also
* GitHub page : https://github.com/mob-sakai/ParticleEffectForUGUI
* Releases : https://github.com/mob-sakai/ParticleEffectForUGUI/releases
* Issue tracker : https://github.com/mob-sakai/ParticleEffectForUGUI/issues
* Change log : https://github.com/mob-sakai/ParticleEffectForUGUI/blob/main/CHANGELOG.md

View File

@@ -1,4 +1,4 @@
using System;
using System;
using UnityEngine;
namespace Coffee.UIExtensions
@@ -19,10 +19,7 @@ namespace Coffee.UIExtensions
[SerializeField] private ShaderPropertyType m_Type = ShaderPropertyType.Vector;
public int id { get; private set; }
public ShaderPropertyType type
{
get { return m_Type; }
}
public ShaderPropertyType type => m_Type;
void ISerializationCallbackReceiver.OnBeforeSerialize()
{

View File

@@ -1,4 +1,4 @@
using System.Collections.Generic;
using System.Collections.Generic;
using UnityEngine;
namespace Coffee.UIParticleExtensions
@@ -7,13 +7,13 @@ namespace Coffee.UIParticleExtensions
{
private static readonly List<MatEntry> s_Entries = new List<MatEntry>();
public static Material Add(Material baseMat, Texture texture, int id)
public static Material Add(Material baseMat, Texture texture, int id, int props)
{
MatEntry e;
for (var i = 0; i < s_Entries.Count; i++)
{
e = s_Entries[i];
if (e.baseMat != baseMat || e.texture != texture || e.id != id) continue;
if (e.baseMat != baseMat || e.texture != texture || e.id != id || e.props != props) continue;
++e.count;
return e.customMat;
}
@@ -24,10 +24,11 @@ namespace Coffee.UIParticleExtensions
baseMat = baseMat,
texture = texture,
id = id,
props = props,
customMat = new Material(baseMat)
{
name = $"{baseMat.name}_{id}",
hideFlags = HideFlags.HideAndDontSave,
hideFlags = HideFlags.DontSave | HideFlags.NotEditable,
mainTexture = texture ? texture : null
}
};
@@ -64,6 +65,7 @@ namespace Coffee.UIParticleExtensions
public int count;
public Material customMat;
public int id;
public int props;
public Texture texture;
}
}

View File

@@ -21,6 +21,13 @@ namespace Coffee.UIExtensions
[RequireComponent(typeof(CanvasRenderer))]
public class UIParticle : MaskableGraphic, ISerializationCallbackReceiver
{
public enum AutoScalingMode
{
None,
UIParticle,
Transform
}
public enum MeshSharing
{
None,
@@ -36,13 +43,6 @@ namespace Coffee.UIExtensions
Absolute
}
public enum AutoScalingMode
{
None,
UIParticle,
Transform
}
[HideInInspector]
[SerializeField]
internal bool m_IsTrail;
@@ -113,7 +113,7 @@ namespace Coffee.UIExtensions
/// </summary>
public override bool raycastTarget
{
get { return false; }
get => false;
set { }
}
@@ -127,8 +127,8 @@ namespace Coffee.UIExtensions
/// </summary>
public MeshSharing meshSharing
{
get { return m_MeshSharing; }
set { m_MeshSharing = value; }
get => m_MeshSharing;
set => m_MeshSharing = value;
}
/// <summary>
@@ -137,7 +137,7 @@ namespace Coffee.UIExtensions
/// </summary>
public int groupId
{
get { return _groupId; }
get => _groupId;
set
{
if (m_GroupId == value) return;
@@ -151,7 +151,7 @@ namespace Coffee.UIExtensions
public int groupMaxId
{
get { return m_GroupMaxId; }
get => m_GroupMaxId;
set
{
if (m_GroupMaxId == value) return;
@@ -167,8 +167,8 @@ namespace Coffee.UIExtensions
/// </summary>
public PositionMode positionMode
{
get { return m_PositionMode; }
set { m_PositionMode = value; }
get => m_PositionMode;
set => m_PositionMode = value;
}
/// <summary>
@@ -178,8 +178,8 @@ namespace Coffee.UIExtensions
/// </summary>
public bool absoluteMode
{
get { return m_PositionMode == PositionMode.Absolute; }
set { positionMode = value ? PositionMode.Absolute : PositionMode.Relative; }
get => m_PositionMode == PositionMode.Absolute;
set => positionMode = value ? PositionMode.Absolute : PositionMode.Relative;
}
/// <summary>
@@ -188,11 +188,8 @@ namespace Coffee.UIExtensions
[Obsolete("The autoScaling is now obsolete. Please use the autoScalingMode instead.", false)]
public bool autoScaling
{
get { return m_AutoScalingMode != AutoScalingMode.None; }
set
{
autoScalingMode = value ? AutoScalingMode.Transform : AutoScalingMode.None;
}
get => m_AutoScalingMode != AutoScalingMode.None;
set => autoScalingMode = value ? AutoScalingMode.Transform : AutoScalingMode.None;
}
/// <summary>
@@ -202,7 +199,7 @@ namespace Coffee.UIExtensions
/// </summary>
public AutoScalingMode autoScalingMode
{
get { return m_AutoScalingMode; }
get => m_AutoScalingMode;
set
{
if (m_AutoScalingMode == value) return;
@@ -211,49 +208,31 @@ namespace Coffee.UIExtensions
}
}
internal bool useMeshSharing
{
get { return m_MeshSharing != MeshSharing.None; }
}
internal bool useMeshSharing => m_MeshSharing != MeshSharing.None;
internal bool isPrimary
{
get
{
return m_MeshSharing == MeshSharing.Primary
|| m_MeshSharing == MeshSharing.PrimarySimulator;
}
}
internal bool isPrimary =>
m_MeshSharing == MeshSharing.Primary
|| m_MeshSharing == MeshSharing.PrimarySimulator;
internal bool canSimulate
{
get
{
return m_MeshSharing == MeshSharing.None
|| m_MeshSharing == MeshSharing.Auto
|| m_MeshSharing == MeshSharing.Primary
|| m_MeshSharing == MeshSharing.PrimarySimulator;
}
}
internal bool canSimulate =>
m_MeshSharing == MeshSharing.None
|| m_MeshSharing == MeshSharing.Auto
|| m_MeshSharing == MeshSharing.Primary
|| m_MeshSharing == MeshSharing.PrimarySimulator;
internal bool canRender
{
get
{
return m_MeshSharing == MeshSharing.None
|| m_MeshSharing == MeshSharing.Auto
|| m_MeshSharing == MeshSharing.Primary
|| m_MeshSharing == MeshSharing.Replica;
}
}
internal bool canRender =>
m_MeshSharing == MeshSharing.None
|| m_MeshSharing == MeshSharing.Auto
|| m_MeshSharing == MeshSharing.Primary
|| m_MeshSharing == MeshSharing.Replica;
/// <summary>
/// Particle effect scale.
/// </summary>
public float scale
{
get { return m_Scale3D.x; }
set { m_Scale3D = new Vector3(value, value, value); }
get => m_Scale3D.x;
set => m_Scale3D = new Vector3(value, value, value);
}
/// <summary>
@@ -261,22 +240,18 @@ namespace Coffee.UIExtensions
/// </summary>
public Vector3 scale3D
{
get { return m_Scale3D; }
set { m_Scale3D = value; }
get => m_Scale3D;
set => m_Scale3D = value;
}
/// <summary>
/// Particle effect scale.
/// </summary>
public Vector3 scale3DForCalc
{
get { return autoScalingMode == AutoScalingMode.UIParticle ? m_Scale3D.GetScaled(canvasScale) : m_Scale3D; }
}
public Vector3 scale3DForCalc => autoScalingMode == AutoScalingMode.UIParticle
? m_Scale3D.GetScaled(canvasScale)
: m_Scale3D;
public List<ParticleSystem> particles
{
get { return m_Particles; }
}
public List<ParticleSystem> particles => m_Particles;
/// <summary>
/// Get all base materials to render.
@@ -294,10 +269,7 @@ namespace Coffee.UIExtensions
}
}
public override Material materialForRendering
{
get { return null; }
}
public override Material materialForRendering => null;
/// <summary>
/// Paused.
@@ -378,7 +350,7 @@ namespace Coffee.UIExtensions
#if UNITY_EDITOR
EditorApplication.delayCall += () =>
{
if (!this || !gameObject || !transform) return;
if (!this || !gameObject || !transform || Application.isPlaying) return;
transform.localScale = Vector3.one;
m_ResetScaleOnEnable = false;
EditorUtility.SetDirty(this);
@@ -565,16 +537,6 @@ namespace Coffee.UIExtensions
}
}
internal void UpdateParticleCount()
{
for (var i = 0; i < _renderers.Count; i++)
{
var r = _renderers[i];
if (!r) continue;
r.UpdateParticleCount();
}
}
internal void ResetGroupId()
{
_groupId = m_GroupId == m_GroupMaxId
@@ -647,7 +609,10 @@ namespace Coffee.UIExtensions
// Create ortho-camera.
if (!_orthoCamera)
{
var go = new GameObject("[generated] UIParticleOverlayCamera") { hideFlags = HideFlags.DontSave };
var go = new GameObject("[generated] UIParticleOverlayCamera")
{
hideFlags = HideFlags.HideAndDontSave
};
go.SetActive(false);
go.transform.SetParent(transform, false);
_orthoCamera = go.AddComponent<Camera>();
@@ -667,7 +632,9 @@ namespace Coffee.UIExtensions
private void UpdateTracker()
{
#pragma warning disable CS0618 // Type or member is obsolete
if (!enabled || !autoScaling || autoScalingMode != AutoScalingMode.Transform)
#pragma warning restore CS0618 // Type or member is obsolete
{
_tracker.Clear();
}

View File

@@ -5,7 +5,7 @@ MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
icon: {fileID: 2800000, guid: 5f0675613942149309588d556e33d990, type: 3}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,4 +1,4 @@
using System;
using System;
using Coffee.UIParticleExtensions;
using UnityEngine;
using UnityEngine.Events;
@@ -49,47 +49,50 @@ namespace Coffee.UIExtensions
public float destinationRadius
{
get { return m_DestinationRadius; }
set { m_DestinationRadius = Mathf.Clamp(value, 0.1f, 10f); }
get => m_DestinationRadius;
set => m_DestinationRadius = Mathf.Clamp(value, 0.1f, 10f);
}
public float delay
{
get { return m_DelayRate; }
set { m_DelayRate = value; }
get => m_DelayRate;
set => m_DelayRate = value;
}
public float maxSpeed
{
get { return m_MaxSpeed; }
set { m_MaxSpeed = value; }
get => m_MaxSpeed;
set => m_MaxSpeed = value;
}
public Movement movement
{
get { return m_Movement; }
set { m_Movement = value; }
get => m_Movement;
set => m_Movement = value;
}
public UpdateMode updateMode
{
get { return m_UpdateMode; }
set { m_UpdateMode = value; }
get => m_UpdateMode;
set => m_UpdateMode = value;
}
public UnityEvent onAttracted
{
get { return m_OnAttracted; }
set { m_OnAttracted = value; }
get => m_OnAttracted;
set => m_OnAttracted = value;
}
/// <summary>
/// The target ParticleSystem to attract.
/// </summary>
#if UNITY_EDITOR
public new ParticleSystem particleSystem
#else
public ParticleSystem particleSystem
#endif
{
get { return m_ParticleSystem; }
get => m_ParticleSystem;
set
{
m_ParticleSystem = value;

Some files were not shown because too many files have changed in this diff Show More