mirror of
https://github.com/mob-sakai/UIEffect.git
synced 2026-11-20 01:42:37 +08:00
Compare commits
81 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| a2c550c523 | |||
| 44cf12173f | |||
| d7abcc47f1 | |||
| 57031c3e3c | |||
| cd68b364c4 | |||
| f3da972c0c | |||
| 2d6f7ed63d | |||
| 70937d2ce3 | |||
| 4a4e50e01f | |||
| 815162eab9 | |||
| 7fc0c7364d | |||
| 20e7f2fa61 | |||
| 1b292febb7 | |||
| 6b79864a39 | |||
| 4e30651290 | |||
| 87760570ec | |||
| ef7ac0aaad | |||
| 2fd87e909a | |||
| 2cc5c5b68e | |||
| 4a8d341625 | |||
| a885fc5bc1 | |||
| 4fdd9636fa | |||
| 06a280ec5a | |||
| e6fb78a0f6 | |||
| 451cbe4302 | |||
| 3cae638bdd | |||
| 533d7b8c0a | |||
| 9380f96572 | |||
| b4adb32512 | |||
| 59874ddffe | |||
| c4202b45d2 | |||
| ce692580a3 | |||
| 6c808aa341 | |||
| a975cf347a | |||
| 3207105a06 | |||
| 4cca2fb5ab | |||
| d1adb33884 | |||
| b077d97ed7 | |||
| 6f90044ec8 | |||
| 83128ebb09 | |||
| 9dffdb0ed8 | |||
| 16be53e145 | |||
| fd2d1b8059 | |||
| cf43bfffb9 | |||
| a2f4a2d5c9 | |||
| 0d7fb1eb63 | |||
| 145f56968a | |||
| cadbb8d68d | |||
| a0c3e4997a | |||
| ec57c2a994 | |||
| 804b48c73e | |||
| 01be18bb28 | |||
| 8addbad494 | |||
| dc5b3805d7 | |||
| bbb5ae0f3e | |||
| ffdeaa7e2f | |||
| f879424b3f | |||
| effdd6d06e | |||
| b39ba58a85 | |||
| 742a5cd8dc | |||
| 1a923dd72c | |||
| c0fec32d50 | |||
| 4f2c9f12b5 | |||
| 264c453bb6 | |||
| 4c6cd11d86 | |||
| 50f6b3c5d2 | |||
| f98929d7e9 | |||
| 179ec89a02 | |||
| ed4716d7ad | |||
| 6af520ed40 | |||
| 9b1af29cd4 | |||
| 65a00b480f | |||
| f508eb32ca | |||
| ecd265e482 | |||
| 58b197e551 | |||
| 8a0e7d6b26 | |||
| 3b52c3a8fc | |||
| 88261e2af0 | |||
| 791d867076 | |||
| 68ebae28e0 | |||
| 5cd48a4633 |
@@ -22,7 +22,7 @@ jobs:
|
||||
find _site -name __MACOSX | xargs rm -rf
|
||||
|
||||
- name: 📦 Upload '_site'
|
||||
uses: actions/upload-pages-artifact@v3
|
||||
uses: actions/upload-pages-artifact@v5
|
||||
|
||||
- name: 🚀 Deploy To GitHub Pages
|
||||
uses: actions/deploy-pages@v4
|
||||
uses: actions/deploy-pages@v5
|
||||
|
||||
@@ -25,10 +25,10 @@ jobs:
|
||||
tag: ${{ steps.release.outputs.new_release_git_tag }}
|
||||
steps:
|
||||
- name: 🚚 Checkout (${{ github.ref_name }})
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: 🔖 Run semantic release
|
||||
uses: cycjimmy/semantic-release-action@v4
|
||||
uses: cycjimmy/semantic-release-action@v6
|
||||
id: release
|
||||
with:
|
||||
working_directory: Packages/src
|
||||
|
||||
@@ -9,7 +9,7 @@ env:
|
||||
# MINIMUM_VERSION: The minimum version of Unity.
|
||||
MINIMUM_VERSION: 6000.0
|
||||
# EXCLUDE_FILTER: The excluded versions of Unity.
|
||||
EXCLUDE_FILTER: "(2020.2.0|2021.1|2023.2|2023.3)"
|
||||
EXCLUDE_FILTER: "(2017|2018)"
|
||||
PROJECT_PATH: UIEffectURP
|
||||
|
||||
on:
|
||||
@@ -46,9 +46,9 @@ jobs:
|
||||
id: setup
|
||||
run: |
|
||||
echo "==== Target Unity Versions ===="
|
||||
LATEST_VERSIONS=`npx unity-changeset list --versions --latest-patch --min ${MINIMUM_VERSION} --json --all`
|
||||
LATEST_VERSIONS=`npx unity-changeset@latest list --versions --latest-patch --min ${MINIMUM_VERSION} --json --all --ignore-alpha`
|
||||
if [ "${{ inputs.usePeriodVersions }}" = "true" ]; then
|
||||
ADDITIONAL_VERSIONS=`npx unity-changeset list --versions --grep '0f' --min ${MINIMUM_VERSION} --json`
|
||||
ADDITIONAL_VERSIONS=`npx unity-changeset list --versions --grep '0f' --min ${MINIMUM_VERSION} --json --ignore-alpha`
|
||||
else
|
||||
ADDITIONAL_VERSIONS=[]
|
||||
fi
|
||||
@@ -72,11 +72,11 @@ jobs:
|
||||
steps:
|
||||
- name: 🚚 Checkout ($${{ github.ref }})
|
||||
if: github.event_name == 'push'
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: 🚚 Checkout pull request (pull_request_target)
|
||||
if: github.event_name == 'pull_request_target'
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 0
|
||||
@@ -86,19 +86,20 @@ jobs:
|
||||
run: |
|
||||
git config user.name "GitHub Actions"
|
||||
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
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: Library
|
||||
key: Library-${{ matrix.unityVersion }}-${{ github.event.pull_request.head.sha || github.sha }}
|
||||
path: ${{ env.PROJECT_PATH }}/Library
|
||||
key: ${{ env.PROJECT_PATH }}-Library-${{ matrix.unityVersion }}-${{ github.event.pull_request.head.sha || github.sha }}
|
||||
restore-keys: |
|
||||
Library-${{ matrix.unityVersion }}-
|
||||
Library-
|
||||
${{ env.PROJECT_PATH }}-Library-${{ matrix.unityVersion }}-
|
||||
${{ env.PROJECT_PATH }}-Library-
|
||||
|
||||
- name: 🛠️ Build Unity Project (Test)
|
||||
uses: game-ci/unity-builder@v4
|
||||
uses: game-ci/unity-builder@v5
|
||||
timeout-minutes: 45
|
||||
with:
|
||||
customImage: ghcr.io/mob-sakai/unity3d:${{ matrix.unityVersion }}
|
||||
|
||||
+13
-12
@@ -9,7 +9,7 @@ env:
|
||||
# MINIMUM_VERSION: The minimum version of Unity.
|
||||
MINIMUM_VERSION: 2020.3
|
||||
# EXCLUDE_FILTER: The excluded versions of Unity.
|
||||
EXCLUDE_FILTER: "(2020.2.0|2021.1|2023.2|2023.3)"
|
||||
EXCLUDE_FILTER: "(2017|2018|2023.3)"
|
||||
PROJECT_PATH: .
|
||||
|
||||
on:
|
||||
@@ -46,9 +46,9 @@ jobs:
|
||||
id: setup
|
||||
run: |
|
||||
echo "==== Target Unity Versions ===="
|
||||
LATEST_VERSIONS=`npx unity-changeset list --versions --latest-patch --min ${MINIMUM_VERSION} --json --all`
|
||||
LATEST_VERSIONS=`npx unity-changeset@latest list --versions --latest-patch --min ${MINIMUM_VERSION} --json --all --ignore-alpha`
|
||||
if [ "${{ inputs.usePeriodVersions }}" = "true" ]; then
|
||||
ADDITIONAL_VERSIONS=`npx unity-changeset list --versions --grep '0f' --min ${MINIMUM_VERSION} --json`
|
||||
ADDITIONAL_VERSIONS=`npx unity-changeset list --versions --grep '0f' --min ${MINIMUM_VERSION} --json --ignore-alpha`
|
||||
else
|
||||
ADDITIONAL_VERSIONS=[]
|
||||
fi
|
||||
@@ -72,11 +72,11 @@ jobs:
|
||||
steps:
|
||||
- name: 🚚 Checkout ($${{ github.ref }})
|
||||
if: github.event_name == 'push'
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: 🚚 Checkout pull request (pull_request_target)
|
||||
if: github.event_name == 'pull_request_target'
|
||||
uses: actions/checkout@v4
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
ref: ${{ github.event.pull_request.head.sha }}
|
||||
fetch-depth: 0
|
||||
@@ -86,19 +86,20 @@ jobs:
|
||||
run: |
|
||||
git config user.name "GitHub Actions"
|
||||
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
|
||||
uses: actions/cache@v4
|
||||
uses: actions/cache@v5
|
||||
with:
|
||||
path: Library
|
||||
key: Library-${{ matrix.unityVersion }}-${{ github.event.pull_request.head.sha || github.sha }}
|
||||
path: ${{ env.PROJECT_PATH }}/Library
|
||||
key: ${{ env.PROJECT_PATH }}-Library-${{ matrix.unityVersion }}-${{ github.event.pull_request.head.sha || github.sha }}
|
||||
restore-keys: |
|
||||
Library-${{ matrix.unityVersion }}-
|
||||
Library-
|
||||
${{ env.PROJECT_PATH }}-Library-${{ matrix.unityVersion }}-
|
||||
${{ env.PROJECT_PATH }}-Library-
|
||||
|
||||
- name: 🛠️ Build Unity Project (Test)
|
||||
uses: game-ci/unity-builder@v4
|
||||
uses: game-ci/unity-builder@v5
|
||||
timeout-minutes: 45
|
||||
with:
|
||||
customImage: ghcr.io/mob-sakai/unity3d:${{ matrix.unityVersion }}
|
||||
|
||||
+6145
-10314
File diff suppressed because it is too large
Load Diff
@@ -31,6 +31,8 @@ ShaderVariantCollection:
|
||||
passType: 0
|
||||
- keywords: GLOW_ON TONE_RETRO UNDERLAY_ON
|
||||
passType: 0
|
||||
- keywords: GLOW_ON TRANSITION_BLAZE UNDERLAY_ON
|
||||
passType: 0
|
||||
- keywords: GLOW_ON TRANSITION_BURN UNDERLAY_ON
|
||||
passType: 0
|
||||
- keywords: GLOW_ON TRANSITION_DISSOLVE UNDERLAY_ON
|
||||
@@ -72,6 +74,8 @@ ShaderVariantCollection:
|
||||
passType: 0
|
||||
- keywords: DETAIL_MULTIPLY
|
||||
passType: 0
|
||||
- keywords: DETAIL_MULTIPLY GRADATION_GRADIENT
|
||||
passType: 0
|
||||
- keywords: DETAIL_MULTIPLY_ADDITIVE
|
||||
passType: 0
|
||||
- keywords: DETAIL_REPLACE
|
||||
@@ -126,6 +130,10 @@ ShaderVariantCollection:
|
||||
passType: 0
|
||||
- keywords: TONE_SEPIA
|
||||
passType: 0
|
||||
- keywords: TRANSITION_BLAZE
|
||||
passType: 0
|
||||
- keywords: TRANSITION_BLAZE UNITY_UI_CLIP_RECT
|
||||
passType: 0
|
||||
- keywords: TRANSITION_BURN
|
||||
passType: 0
|
||||
- keywords: TRANSITION_BURN UNITY_UI_CLIP_RECT
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
"com.coffee.minimal-resource": "https://github.com/mob-sakai/Coffee.Internal.git?path=Packages/MinimalResource",
|
||||
"com.coffee.nano-monitor": "https://github.com/mob-sakai/Coffee.Internal.git?path=Packages/NanoMonitor",
|
||||
"com.coffee.symbolic-linker": "https://github.com/mob-sakai/Coffee.Internal.git?path=Packages/SymbolicLinker",
|
||||
"com.unity.ide.rider": "3.0.36",
|
||||
"com.unity.ide.rider": "3.0.38",
|
||||
"com.unity.test-framework": "1.1.33",
|
||||
"com.unity.textmeshpro": "3.0.9",
|
||||
"com.unity.modules.animation": "1.0.0"
|
||||
|
||||
@@ -46,7 +46,7 @@
|
||||
"url": "https://packages.unity.com"
|
||||
},
|
||||
"com.unity.ide.rider": {
|
||||
"version": "3.0.36",
|
||||
"version": "3.0.38",
|
||||
"depth": 0,
|
||||
"source": "registry",
|
||||
"dependencies": {
|
||||
|
||||
@@ -1,3 +1,185 @@
|
||||
## [5.10.9](https://github.com/mob-sakai/UIEffect/compare/5.10.8...5.10.9) (2026-06-08)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* ambiguous call to 'lerp' in shader ([cd68b36](https://github.com/mob-sakai/UIEffect/commit/cd68b364c48e979d6ef227e53a522f096e0df47a)), closes [#390](https://github.com/mob-sakai/UIEffect/issues/390)
|
||||
* Clarify that the `ShaderGraph support` is available only in Unity 2023.2/6.0 or later ([57031c3](https://github.com/mob-sakai/UIEffect/commit/57031c3e3c2d64ee76d3e568d378cd54a5e84af5)), closes [#391](https://github.com/mob-sakai/UIEffect/issues/391)
|
||||
* support Unity 6.5 or later ([2d6f7ed](https://github.com/mob-sakai/UIEffect/commit/2d6f7ed63dd83b3f90c2fa6d93a3c84afd6de866)), closes [#392](https://github.com/mob-sakai/UIEffect/issues/392) [#398](https://github.com/mob-sakai/UIEffect/issues/398)
|
||||
* UIEffect.detailColor is not working ([f3da972](https://github.com/mob-sakai/UIEffect/commit/f3da972c0cba526f7784207c2d8ab48b5dd692f3)), closes [#399](https://github.com/mob-sakai/UIEffect/issues/399)
|
||||
|
||||
## [5.10.8](https://github.com/mob-sakai/UIEffect/compare/5.10.7...5.10.8) (2026-01-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* Canvas not properly cached when objects are outside Canvas ([4a4e50e](https://github.com/mob-sakai/UIEffect/commit/4a4e50e01fb50925352c73b27901024494ae933c))
|
||||
|
||||
## [5.10.7](https://github.com/mob-sakai/UIEffect/compare/5.10.6...5.10.7) (2025-12-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* support Unity 6000.4 ([7fc0c73](https://github.com/mob-sakai/UIEffect/commit/7fc0c7364d8dc39e26eac3c3b79797b139f09817))
|
||||
|
||||
## [5.10.6](https://github.com/mob-sakai/UIEffect/compare/5.10.5...5.10.6) (2025-12-18)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fixed an issue where shader variants were not registered automatically ([6b79864](https://github.com/mob-sakai/UIEffect/commit/6b79864a394d79e6ad13f64af1d521fab1f781a7)), closes [#383](https://github.com/mob-sakai/UIEffect/issues/383)
|
||||
|
||||
## [5.10.5](https://github.com/mob-sakai/UIEffect/compare/5.10.4...5.10.5) (2025-11-20)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* graphic disappears when changing filters from code ([8776057](https://github.com/mob-sakai/UIEffect/commit/87760570ec7f4e2ca395cfaa0d2ab5d28c9cf9f3)), closes [#382](https://github.com/mob-sakai/UIEffect/issues/382)
|
||||
|
||||
## [5.10.4](https://github.com/mob-sakai/UIEffect/compare/5.10.3...5.10.4) (2025-10-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* remove `sealed` from `UIEffect` and `UIEffectReplica` ([2fd87e9](https://github.com/mob-sakai/UIEffect/commit/2fd87e909af65bf88a9c39cd157dfb06a56b3af0)), closes [#379](https://github.com/mob-sakai/UIEffect/issues/379)
|
||||
|
||||
## [5.10.3](https://github.com/mob-sakai/UIEffect/compare/5.10.2...5.10.3) (2025-10-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* displays as black rectangle when opening editor ([4a8d341](https://github.com/mob-sakai/UIEffect/commit/4a8d341625f73d70c512f7e6f0b864be1adbf459)), closes [#376](https://github.com/mob-sakai/UIEffect/issues/376)
|
||||
|
||||
## [5.10.2](https://github.com/mob-sakai/UIEffect/compare/5.10.1...5.10.2) (2025-10-16)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* [improve performance] code optimization ([e6fb78a](https://github.com/mob-sakai/UIEffect/commit/e6fb78a0f67ed6f70be08259f674ab2f83364bd7))
|
||||
|
||||
## [5.10.1](https://github.com/mob-sakai/UIEffect/compare/5.10.0...5.10.1) (2025-10-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* [improve performance] `UpdateViewMatrix` is called even though (direct-)parent canvas is disabled ([533d7b8](https://github.com/mob-sakai/UIEffect/commit/533d7b8c0a33871b1849fbda862d4fa1899822f4)), closes [#373](https://github.com/mob-sakai/UIEffect/issues/373)
|
||||
|
||||
# [5.10.0](https://github.com/mob-sakai/UIEffect/compare/5.9.7...5.10.0) (2025-09-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `TmpProxy` causes loss of modifications from other `IMeshModifiers` ([c4202b4](https://github.com/mob-sakai/UIEffect/commit/c4202b45d28fa84567a5671baaef8fa3e3df85dc)), closes [#371](https://github.com/mob-sakai/UIEffect/issues/371)
|
||||
* display may disappear when using TMP SubMesh (multi-language or sprites, etc.) ([b4adb32](https://github.com/mob-sakai/UIEffect/commit/b4adb325120eeed64af1d9cb2468a1e1e8e10812)), closes [#372](https://github.com/mob-sakai/UIEffect/issues/372)
|
||||
* TMP Text sprite submesh lost when changing fontMaterial ([59874dd](https://github.com/mob-sakai/UIEffect/commit/59874ddffe356f927dc8ff9b157c54043e149522)), closes [#368](https://github.com/mob-sakai/UIEffect/issues/368)
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* [improve performance] merged apply_color function and reduced shader compilation size ([ce69258](https://github.com/mob-sakai/UIEffect/commit/ce692580a33c0c433fd7fadb64a3dcda0121b2ff))
|
||||
* [improve performance] various view matrices are only updated when necessary ([6c808aa](https://github.com/mob-sakai/UIEffect/commit/6c808aa3417450fd1ce0fc6fbfe0adffdff9a79a))
|
||||
|
||||
## [5.9.7](https://github.com/mob-sakai/UIEffect/compare/5.9.6...5.9.7) (2025-09-01)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* edges of `TransitionFilter.Shiny` appear sharp ([b077d97](https://github.com/mob-sakai/UIEffect/commit/b077d97ed706acbbdd3b20e765ec0552fa464f9b)), closes [#366](https://github.com/mob-sakai/UIEffect/issues/366)
|
||||
* error message sometimes after importing assets ([3207105](https://github.com/mob-sakai/UIEffect/commit/3207105a067801696de789d282c74a93b798ed57)), closes [#365](https://github.com/mob-sakai/UIEffect/issues/365)
|
||||
* flickering issue when scale Y changes when used `ShadowMode` with TextMeshPro ([4cca2fb](https://github.com/mob-sakai/UIEffect/commit/4cca2fb5ab34ea454ff8df3def5f1730a71a198c)), closes [#367](https://github.com/mob-sakai/UIEffect/issues/367)
|
||||
* skip monitoring TMP objects that can ignore Y-axis scaling ([d1adb33](https://github.com/mob-sakai/UIEffect/commit/d1adb33884971aa7d6c473fcd08cdf25e58cd261))
|
||||
|
||||
## [5.9.6](https://github.com/mob-sakai/UIEffect/compare/5.9.5...5.9.6) (2025-07-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `ColorFilter` does not output intended color when vertex color is not white ([9dffdb0](https://github.com/mob-sakai/UIEffect/commit/9dffdb0ed88750a915fdd5e437b79ab766ce45c2)), closes [#363](https://github.com/mob-sakai/UIEffect/issues/363)
|
||||
* draw calls increase even when using `UIEffectReplica` ([83128eb](https://github.com/mob-sakai/UIEffect/commit/83128ebb09305e4c15a58968a94550179e96ffac)), closes [#364](https://github.com/mob-sakai/UIEffect/issues/364)
|
||||
|
||||
## [5.9.5](https://github.com/mob-sakai/UIEffect/compare/5.9.4...5.9.5) (2025-06-26)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `GetGradientKeys` and `GetTransitionGradientKeys` cannot get GradientMode ([fd2d1b8](https://github.com/mob-sakai/UIEffect/commit/fd2d1b80592ac4ea62e15b6150be63964b113fa2)), closes [#358](https://github.com/mob-sakai/UIEffect/issues/358)
|
||||
|
||||
## [5.9.4](https://github.com/mob-sakai/UIEffect/compare/5.9.3...5.9.4) (2025-06-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* colors specified in UIEffect are output differently in linear color space ([0d7fb1e](https://github.com/mob-sakai/UIEffect/commit/0d7fb1eb63881b67f2658567750a83c92187df35)), closes [#359](https://github.com/mob-sakai/UIEffect/issues/359)
|
||||
|
||||
## [5.9.3](https://github.com/mob-sakai/UIEffect/compare/5.9.2...5.9.3) (2025-06-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add `GetGradientKeys` and `GetTransitionGradientKeys` APIs ([a0c3e49](https://github.com/mob-sakai/UIEffect/commit/a0c3e4997af181ae16744c53ad3867e2106ccff3)), closes [#358](https://github.com/mob-sakai/UIEffect/issues/358)
|
||||
* support world canvas without UI events ([cadbb8d](https://github.com/mob-sakai/UIEffect/commit/cadbb8d68d17a2ec7e2d6e8e885d711e61fa53af)), closes [#356](https://github.com/mob-sakai/UIEffect/issues/356) [#357](https://github.com/mob-sakai/UIEffect/issues/357)
|
||||
|
||||
## [5.9.2](https://github.com/mob-sakai/UIEffect/compare/5.9.1...5.9.2) (2025-06-12)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* TextMeshPro 3.2.0-pre support ([804b48c](https://github.com/mob-sakai/UIEffect/commit/804b48c73ec648eaceb720cb79551fdbf3729fc9)), closes [#355](https://github.com/mob-sakai/UIEffect/issues/355)
|
||||
|
||||
## [5.9.1](https://github.com/mob-sakai/UIEffect/compare/5.9.0...5.9.1) (2025-06-11)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* prefabs will be deselected when editing them ([8addbad](https://github.com/mob-sakai/UIEffect/commit/8addbad4941340807d824e295280473d197d889f)), closes [#354](https://github.com/mob-sakai/UIEffect/issues/354)
|
||||
|
||||
# [5.9.0](https://github.com/mob-sakai/UIEffect/compare/5.8.7...5.9.0) (2025-06-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `GradationMode.RadialFast` and `GradationMode.RadialDetail` are obsolete ([1a923dd](https://github.com/mob-sakai/UIEffect/commit/1a923dd72c263de5480d71bd17b697feca317ef1))
|
||||
* soft masking not working with `DetailFilter.Masking` ([ffdeaa7](https://github.com/mob-sakai/UIEffect/commit/ffdeaa7e2f1c2a9ccb7eb21d5674e2c19021aef9))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* `GradationGradient` supports HDR color ([50f6b3c](https://github.com/mob-sakai/UIEffect/commit/50f6b3c5d20b93a2245f6d54b6eb4bc13565c3b5))
|
||||
* add `Clear` method to reset properties via script ([264c453](https://github.com/mob-sakai/UIEffect/commit/264c453bb6ebad08ef950b0cec2f38e60a1710d8)), closes [#337](https://github.com/mob-sakai/UIEffect/issues/337)
|
||||
* add `GradationMode.RadialGradient` feature ([179ec89](https://github.com/mob-sakai/UIEffect/commit/179ec89a0215af9d8046e150d98fa06371155e93)), closes [#348](https://github.com/mob-sakai/UIEffect/issues/348)
|
||||
* add `GradationReverse` option for gradient ([c0fec32](https://github.com/mob-sakai/UIEffect/commit/c0fec32d502ec1f9d03172ed200f4d9233506eb9)), closes [#348](https://github.com/mob-sakai/UIEffect/issues/348)
|
||||
* add `GradationWrapMode` option ([f98929d](https://github.com/mob-sakai/UIEffect/commit/f98929d7e9656b4c02d5545b3893748c963d1118))
|
||||
* add `TransitionFilter.Blaze` feature ([ed4716d](https://github.com/mob-sakai/UIEffect/commit/ed4716d7ada102fe0053480941925e9f27b1c2c3))
|
||||
* add new built-in presets ([4f2c9f1](https://github.com/mob-sakai/UIEffect/commit/4f2c9f12b5e115bab1418a7a0b1187269a041fc4))
|
||||
* improve performance for TextMeshPro ([6af520e](https://github.com/mob-sakai/UIEffect/commit/6af520ed408f2e5eb4d84ec0df484338719ebc8e))
|
||||
* timeline package support ([742a5cd](https://github.com/mob-sakai/UIEffect/commit/742a5cd8dc47500de4b111a132d7a8b242844342)), closes [#347](https://github.com/mob-sakai/UIEffect/issues/347)
|
||||
* update shaders in samples ([4c6cd11](https://github.com/mob-sakai/UIEffect/commit/4c6cd11d86582f2351c40374180828ad1c8955c3))
|
||||
|
||||
## [5.8.7](https://github.com/mob-sakai/UIEffect/compare/5.8.6...5.8.7) (2025-06-09)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* `GradationGradient` and `TransitionGradient` in reprica will be not dirty (editor) ([58b197e](https://github.com/mob-sakai/UIEffect/commit/58b197e551aea8efca10e12da8df132853d4a24e))
|
||||
* changes not reflected in rendering when TextMeshPro is cleared ([f508eb3](https://github.com/mob-sakai/UIEffect/commit/f508eb32caf6757eb4c27b98ac29a1582dcd14b4)), closes [#351](https://github.com/mob-sakai/UIEffect/issues/351)
|
||||
* setting `gradationScale` to 0 throws `DivideByZeroException` ([ecd265e](https://github.com/mob-sakai/UIEffect/commit/ecd265e4828c7f81c96a76c16df147b6c4804429))
|
||||
|
||||
## [5.8.6](https://github.com/mob-sakai/UIEffect/compare/5.8.5...5.8.6) (2025-05-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* some methods may be called multiple times when domain reload on play is disabled (editor) ([3b52c3a](https://github.com/mob-sakai/UIEffect/commit/3b52c3a8fc67980d426b8e4e2ed2067c725ca262))
|
||||
|
||||
## [5.8.5](https://github.com/mob-sakai/UIEffect/compare/5.8.4...5.8.5) (2025-05-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* skip processing when graphic is invalid ([5cd48a4](https://github.com/mob-sakai/UIEffect/commit/5cd48a463309270ec3d6501bde2add9944bbaf02))
|
||||
* TextMeshPro strikethrough and underline not displaying ([68ebae2](https://github.com/mob-sakai/UIEffect/commit/68ebae28e02045cb45996bf5b77d7d93d2f0ca82)), closes [#344](https://github.com/mob-sakai/UIEffect/issues/344)
|
||||
* TMP SubMeshUI generates overhead every frame (since 5.6.0) ([791d867](https://github.com/mob-sakai/UIEffect/commit/791d8670761902466d81412d832cddf013cd28cd)), closes [#343](https://github.com/mob-sakai/UIEffect/issues/343) [#345](https://github.com/mob-sakai/UIEffect/issues/345)
|
||||
|
||||
## [5.8.4](https://github.com/mob-sakai/UIEffect/compare/5.8.3...5.8.4) (2025-04-30)
|
||||
|
||||
|
||||
|
||||
@@ -3,7 +3,9 @@
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:6055be8ebefd69e48b49212b09b47b2f",
|
||||
"GUID:735c8f008d0ad4caa9cdc4306f1c3042"
|
||||
"GUID:735c8f008d0ad4caa9cdc4306f1c3042",
|
||||
"GUID:f06555f75b070af458a003d92f9efb00",
|
||||
"GUID:02f771204943f4a40949438e873e3eff"
|
||||
],
|
||||
"includePlatforms": [
|
||||
"Editor"
|
||||
@@ -24,6 +26,11 @@
|
||||
"name": "com.unity.ugui",
|
||||
"expression": "2.0.0",
|
||||
"define": "TMP_ENABLE"
|
||||
},
|
||||
{
|
||||
"name": "com.unity.timeline",
|
||||
"expression": "1.0.0",
|
||||
"define": "TIMELINE_ENABLE"
|
||||
}
|
||||
],
|
||||
"noEngineReferences": false
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3150c4c70d45b46d389368100b181ee4
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,183 @@
|
||||
#if TIMELINE_ENABLE
|
||||
using System;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using UnityEditor;
|
||||
using UnityEditor.Timeline;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
namespace Coffee.UIEffects.Timeline
|
||||
{
|
||||
public abstract class UIEffectClipEditor : ClipEditor
|
||||
{
|
||||
public override void DrawBackground(TimelineClip clip, ClipBackgroundRegion region)
|
||||
{
|
||||
var director = TimelineEditor.inspectedDirector;
|
||||
if (!director) return;
|
||||
|
||||
var viewDuration = region.endTime - region.startTime;
|
||||
var inDuration = (float)Math.Max(clip.easeInDuration, clip.blendInDuration);
|
||||
var outDuration = (float)Math.Max(clip.easeOutDuration, clip.blendOutDuration);
|
||||
inDuration = 0 < inDuration ? Mathf.Max(inDuration - (float)region.startTime, 0) : 0f;
|
||||
outDuration = 0 < outDuration ? Mathf.Max(outDuration - (float)(clip.duration - region.endTime), 0) : 0f;
|
||||
|
||||
var p = region.position;
|
||||
p.x += p.width * (float)(inDuration / viewDuration);
|
||||
p.width -= p.width * (float)((inDuration + outDuration) / viewDuration);
|
||||
|
||||
DrawBackground(p, clip);
|
||||
}
|
||||
|
||||
public override void OnCreate(TimelineClip clip, TrackAsset track, TimelineClip clonedFrom)
|
||||
{
|
||||
clip.displayName = ObjectNames.NicifyVariableName(track.GetType().Name.Replace("Track", ""));
|
||||
if (clip.asset is UIEffectClip uiEffectClip)
|
||||
{
|
||||
uiEffectClip.timelineClip = clip;
|
||||
}
|
||||
|
||||
var floatClip = clip.asset as UIEffectFloatClip;
|
||||
if (floatClip)
|
||||
{
|
||||
if (track is GradationRotationTrack || track is GradationOffsetTrack)
|
||||
{
|
||||
floatClip.m_Data.m_From = 0f;
|
||||
floatClip.m_Data.m_Value = 0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
protected abstract void DrawBackground(Rect rect, TimelineClip clip);
|
||||
}
|
||||
|
||||
[CustomTimelineEditor(typeof(UIEffectFloatClip))]
|
||||
public class UIEffectFloatClipEditor : UIEffectClipEditor
|
||||
{
|
||||
private static GUIStyle s_FromStyle;
|
||||
private static GUIStyle s_ToStyle;
|
||||
|
||||
protected override void DrawBackground(Rect rect, TimelineClip clip)
|
||||
{
|
||||
var asset = clip.asset as UIEffectFloatClip;
|
||||
if (!asset) return;
|
||||
|
||||
if (s_FromStyle == null)
|
||||
{
|
||||
s_FromStyle = new GUIStyle(GUI.skin.label) { alignment = TextAnchor.UpperLeft, fontSize = 9 };
|
||||
s_ToStyle = new GUIStyle(GUI.skin.label) { alignment = TextAnchor.UpperRight, fontSize = 9 };
|
||||
}
|
||||
|
||||
var d = asset.m_Data;
|
||||
if (d.m_Tween)
|
||||
{
|
||||
DrawLabelWithShadow(rect, asset.m_Data.m_From.ToString("F2"), s_FromStyle);
|
||||
DrawLabelWithShadow(rect, asset.m_Data.m_Value.ToString("F2"), s_ToStyle);
|
||||
}
|
||||
else
|
||||
{
|
||||
DrawLabelWithShadow(rect, asset.m_Data.m_Value.ToString("F2"), s_FromStyle);
|
||||
}
|
||||
}
|
||||
|
||||
private static void DrawLabelWithShadow(Rect position, string text, GUIStyle style)
|
||||
{
|
||||
GUI.color = Color.black;
|
||||
EditorGUI.LabelField(position, text, style);
|
||||
GUI.color = Color.white;
|
||||
position.x -= 1f;
|
||||
position.y -= 1f;
|
||||
EditorGUI.LabelField(position, text, style);
|
||||
}
|
||||
}
|
||||
|
||||
[CustomTimelineEditor(typeof(UIEffectColorClip))]
|
||||
public class UIEffectColorClipEditor : UIEffectClipEditor
|
||||
{
|
||||
protected override void DrawBackground(Rect p, TimelineClip clip)
|
||||
{
|
||||
var asset = clip.asset as UIEffectColorClip;
|
||||
if (!asset) return;
|
||||
|
||||
var d = asset.m_Data;
|
||||
if (d.m_Tween)
|
||||
{
|
||||
EditorGUIUtility.DrawColorSwatch(new Rect(p.x + 2, p.y, 8, 8), d.m_From);
|
||||
EditorGUIUtility.DrawColorSwatch(new Rect(p.x + p.width - 8, p.y, 8, 8), d.m_Value);
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorGUIUtility.DrawColorSwatch(new Rect(p.x + 2, p.y, 8, 8), d.m_Value);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[CustomEditor(typeof(UIEffectClip<>), true)]
|
||||
public class UIEffectClipAssetEditor : Editor
|
||||
{
|
||||
private SerializedProperty _tween;
|
||||
private SerializedProperty _from;
|
||||
private SerializedProperty _curve;
|
||||
private SerializedProperty _value;
|
||||
private FloatClipUsageAttribute _floatUsage;
|
||||
private ColorClipUsageAttribute _colorUsage;
|
||||
private GUIContent _label;
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
var data = serializedObject.FindProperty("m_Data");
|
||||
_tween = data.FindPropertyRelative("m_Tween");
|
||||
_from = data.FindPropertyRelative("m_From");
|
||||
_curve = data.FindPropertyRelative("m_Curve");
|
||||
_value = data.FindPropertyRelative("m_Value");
|
||||
|
||||
var clip = target as UIEffectClip;
|
||||
var type = clip.timelineClip.GetParentTrack().GetType();
|
||||
_floatUsage = type.GetCustomAttribute<FloatClipUsageAttribute>();
|
||||
_colorUsage = type.GetCustomAttribute<ColorClipUsageAttribute>();
|
||||
_label = new GUIContent(ObjectNames.NicifyVariableName(type.Name).Replace(" Track", ""));
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
serializedObject.Update();
|
||||
EditorGUILayout.PropertyField(_tween);
|
||||
|
||||
if (_tween.boolValue)
|
||||
{
|
||||
EditorGUI.indentLevel++;
|
||||
DrawProperty(_from, EditorGUIUtility.TrTempContent("From"));
|
||||
EditorGUILayout.PropertyField(_curve);
|
||||
EditorGUI.indentLevel--;
|
||||
}
|
||||
|
||||
DrawProperty(_value, _label);
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
}
|
||||
|
||||
private void DrawProperty(SerializedProperty property, GUIContent label)
|
||||
{
|
||||
if (_floatUsage != null)
|
||||
{
|
||||
EditorGUILayout.Slider(property, _floatUsage.min, _floatUsage.max, label);
|
||||
}
|
||||
else if (property.propertyType == SerializedPropertyType.Color)
|
||||
{
|
||||
var hdr = UIEffectProjectSettings.useHdrColorPicker;
|
||||
var alpha = _colorUsage?.alpha ?? true;
|
||||
|
||||
EditorGUI.BeginChangeCheck();
|
||||
var color = EditorGUILayout.ColorField(label, property.colorValue, true, alpha, hdr);
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
property.colorValue = color;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
EditorGUILayout.PropertyField(property, label);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7f0dee01a862040a58ac6b6057944cd3
|
||||
guid: 3d108727fec4d48d28c1609b01a3a8c6
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
@@ -47,6 +47,7 @@ namespace Coffee.UIEffects.Editors
|
||||
private SerializedProperty _transitionColorGlow;
|
||||
private SerializedProperty _transitionPatternReverse;
|
||||
private SerializedProperty _transitionAutoPlaySpeed;
|
||||
private SerializedProperty _transitionGradient;
|
||||
|
||||
private SerializedProperty _targetMode;
|
||||
private SerializedProperty _targetColor;
|
||||
@@ -80,6 +81,8 @@ namespace Coffee.UIEffects.Editors
|
||||
private SerializedProperty _gradationOffset;
|
||||
private SerializedProperty _gradationScale;
|
||||
private SerializedProperty _gradationRotation;
|
||||
private SerializedProperty _gradationWrapMode;
|
||||
private SerializedProperty _gradationReverse;
|
||||
|
||||
private SerializedProperty _edgeMode;
|
||||
private SerializedProperty _edgeWidth;
|
||||
@@ -135,6 +138,7 @@ namespace Coffee.UIEffects.Editors
|
||||
_transitionColorGlow = serializedObject.FindProperty("m_TransitionColorGlow");
|
||||
_transitionPatternReverse = serializedObject.FindProperty("m_TransitionPatternReverse");
|
||||
_transitionAutoPlaySpeed = serializedObject.FindProperty("m_TransitionAutoPlaySpeed");
|
||||
_transitionGradient = serializedObject.FindProperty("m_TransitionGradient");
|
||||
|
||||
s_RotationLabel.tooltip = _transitionRotation.tooltip;
|
||||
s_KeepAspectRatioLabel.tooltip = _transitionKeepAspectRatio.tooltip;
|
||||
@@ -181,6 +185,8 @@ namespace Coffee.UIEffects.Editors
|
||||
_gradationOffset = serializedObject.FindProperty("m_GradationOffset");
|
||||
_gradationScale = serializedObject.FindProperty("m_GradationScale");
|
||||
_gradationRotation = serializedObject.FindProperty("m_GradationRotation");
|
||||
_gradationWrapMode = serializedObject.FindProperty("m_GradationWrapMode");
|
||||
_gradationReverse = serializedObject.FindProperty("m_GradationReverse");
|
||||
|
||||
_detailFilter = serializedObject.FindProperty("m_DetailFilter");
|
||||
_detailIntensity = serializedObject.FindProperty("m_DetailIntensity");
|
||||
@@ -269,6 +275,11 @@ namespace Coffee.UIEffects.Editors
|
||||
EditorGUIUtility.TrTempContent("Pattern Reverse"));
|
||||
DrawColor(_transitionColorFilter, _transitionColor, null);
|
||||
}
|
||||
else if (_transitionFilter.intValue == (int)TransitionFilter.Blaze)
|
||||
{
|
||||
EditorGUILayout.PropertyField(_transitionWidth);
|
||||
DrawGradientField(_transitionGradient);
|
||||
}
|
||||
else if (2 < _transitionFilter.intValue)
|
||||
{
|
||||
EditorGUILayout.PropertyField(_transitionWidth);
|
||||
@@ -363,7 +374,12 @@ namespace Coffee.UIEffects.Editors
|
||||
case GradationMode.HorizontalGradient:
|
||||
case GradationMode.VerticalGradient:
|
||||
case GradationMode.AngleGradient:
|
||||
case GradationMode.RadialGradient:
|
||||
DrawGradientField(_gradationGradient);
|
||||
EditorGUI.indentLevel++;
|
||||
EditorGUILayout.PropertyField(_gradationWrapMode, EditorGUIUtility.TrTempContent("Wrap Mode"));
|
||||
EditorGUILayout.PropertyField(_gradationReverse, EditorGUIUtility.TrTempContent("Reverse"));
|
||||
EditorGUI.indentLevel--;
|
||||
break;
|
||||
case GradationMode.Diagonal:
|
||||
DrawColorPickerField("Top", _gradationColor1, _gradationColor2);
|
||||
|
||||
+46
-16
@@ -7,6 +7,7 @@
|
||||

|
||||

|
||||

|
||||

|
||||

|
||||

|
||||
[](https://github.com/mob-sakai/UIEffect/blob/main/LICENSE.md)
|
||||
@@ -20,9 +21,12 @@
|
||||
|
||||
## 📝 Description <!-- omit in toc -->
|
||||
|
||||
**_"Decorate your UI, simply and powerfully."_**
|
||||
UIEffect is an open-source package that allows you to intuitively apply rich Unity UI effects directly from the Inspector or via code.
|
||||
Combine various filters, such as grayscale, blur, and dissolve, to decorate your UI with a unique visual style!
|
||||
**_"Decorate your UI, simply and powerfully."_**
|
||||
|
||||
UIEffect is a powerful, open-source Unity package that transforms your UI with stunning visual effects.
|
||||
Apply professional-grade filters like grayscale, blur, and dissolve directly from the Inspector—no coding required!
|
||||
|
||||
✨ **Perfect for**: Game developers, UI designers, and anyone looking to enhance their Unity UI with minimal effort
|
||||
|
||||

|
||||
|
||||
@@ -55,6 +59,7 @@ Combine various filters, such as grayscale, blur, and dissolve, to decorate your
|
||||
- [Usage with TextMeshPro](#usage-with-textmeshpro)
|
||||
- [Usage with SoftMaskForUGUI](#usage-with-softmaskforugui)
|
||||
- [Usage with ShaderGraph](#usage-with-shadergraph)
|
||||
- [Usage with Timeline](#usage-with-timeline)
|
||||
- [Runtime/Editor Preset for UIEffect](#runtimeeditor-preset-for-uieffect)
|
||||
- [Usage with Code](#usage-with-code)
|
||||
- [Project Settings](#project-settings)
|
||||
@@ -88,18 +93,18 @@ Combine various filters, such as grayscale, blur, and dissolve, to decorate your
|
||||
- **v4 compatible components (optional)**: For easy upgrading with minimal changes, compatible v4 components are available optionally.
|
||||
- **SoftMaskForUGUI support (optional)**: Compatible with SoftMaskForUGUI for creating soft masks for UI elements. See for more details [here](#usage-with-softmaskforugui).
|
||||
- **ShaderGraph support (optional)**: Add `Canvas (UIEffect)` sub target (material) for UIEffect shaders. See for more details [here](#usage-with-shadergraph).
|
||||
- **Timeline support**: Control UIEffect using Timeline with `ControlTrack` and `UIEffect Tracks`. See for more details [here](#usage-with-timeline).
|
||||
|
||||
<br><br>
|
||||
|
||||
## 🎮 Demo
|
||||
|
||||
|
||||

|
||||

|
||||
<img src="https://github.com/mob-sakai/mob-sakai/releases/download/docs/uieffect5.7.0-demo-pattern.gif" width="582"/>
|
||||

|
||||

|
||||
|
||||
[WebGL Demo](https://mob-sakai.github.io/UIEffect/)
|
||||
[Try the WebGL Demo](https://mob-sakai.github.io/UIEffect/)
|
||||
|
||||
<br><br>
|
||||
|
||||
@@ -117,7 +122,7 @@ _This package requires **Unity 2020.3 or later**._
|
||||
```
|
||||
- To update the package, use Package Manager UI (`Window > Package Manager`) or run the following command with `@{version}`:
|
||||
```
|
||||
openupm add com.coffee.ui-effect@5.7.0
|
||||
openupm add com.coffee.ui-effect@5.9.0
|
||||
```
|
||||
|
||||
### Install via UPM (with Package Manager UI)
|
||||
@@ -126,7 +131,7 @@ _This package requires **Unity 2020.3 or later**._
|
||||
- Click `+ > Add package from git URL...` and input the repository URL: `https://github.com/mob-sakai/UIEffect.git?path=Packages/src`
|
||||

|
||||
- To update the package, change suffix `#{version}` to the target version.
|
||||
- e.g. `https://github.com/mob-sakai/UIEffect.git?path=Packages/src#5.7.0`
|
||||
- e.g. `https://github.com/mob-sakai/UIEffect.git?path=Packages/src#5.9.0`
|
||||
|
||||
### Install via UPM (Manually)
|
||||
|
||||
@@ -141,7 +146,7 @@ _This package requires **Unity 2020.3 or later**._
|
||||
```
|
||||
|
||||
- To update the package, change suffix `#{version}` to the target version.
|
||||
- e.g. `"com.coffee.ui-effect": "https://github.com/mob-sakai/UIEffect.git?path=Packages/src#5.7.0",`
|
||||
- e.g. `"com.coffee.ui-effect": "https://github.com/mob-sakai/UIEffect.git?path=Packages/src#5.9.0",`
|
||||
|
||||
### Install as Embedded Package
|
||||
|
||||
@@ -198,10 +203,17 @@ If upgrading from UIEffect v4 to v5, note the following breaking changes:
|
||||
2. Add a `UIEffect` component to a UI element (Image, RawImage, Text, TextMeshProUGUI, etc...) from the `Add Component` in the inspector or `Component > UI > UIEffect` menu.
|
||||

|
||||
|
||||
3. Adjust the effect filters and parameters in the inspector.
|
||||
3. Set `Tone Filter` to `Grayscale` and `Tone Intensity` to `1.0`.
|
||||
<img src="https://github.com/mob-sakai/mob-sakai/releases/download/docs/1749029605043.png" width="480"/>
|
||||
|
||||
4. Try other effect filters and parameters in the inspector.
|
||||

|
||||
|
||||
4. From the top menu, you can load/append preset.
|
||||
5. From the top menu, you can load/append preset.
|
||||
> [!TIP]
|
||||
> `Load` overwrites all properties with the preset, while `Append` only overwrites enabled filters and modes with the preset.
|
||||
> You can easily build effects by combining them with `Append`.
|
||||
|
||||

|
||||
|
||||
5. Enjoy!
|
||||
@@ -256,8 +268,8 @@ The `UIEffect` component applies visual effects to UI elements, allowing various
|
||||
|
||||

|
||||
|
||||
- **Transition Filter**: `None`, `Fade`, `Cutoff`, `Dissolve`, `Shiny`, `Mask`, `Melt`, `Burn`, `Pattern`
|
||||

|
||||
- **Transition Filter**: `None`, `Fade`, `Cutoff`, `Dissolve`, `Shiny`, `Mask`, `Melt`, `Burn`, `Blaze`, `Pattern`
|
||||

|
||||
- **Transition Rate**: 0.0 (no effect) - 1.0 (full effect).
|
||||
- **Transition Tex**: The texture used for the transition filter.
|
||||
- **Scale**, **Offset**, **Speed**, **Rotation**, **Keep Aspect Ratio**, **Reverse**: Additional properties for the texture.
|
||||
@@ -271,6 +283,7 @@ The `UIEffect` component applies visual effects to UI elements, allowing various
|
||||
- **Transition Color**: The color of the transition.
|
||||
- **Transition Color Glow**: Set the transition color to glow.
|
||||
- **Transition Auto Play Speed**: The speed of the transition animation (using shader side `_Time`). You can use this property to loop the `TransitionRate` without tweener or animation.
|
||||
- ⚠️ NOTE: This uses scaled time (affected by `Time.timeScale`). If you need unscaled time (useful for pause-resistant effects), use the [UIEffectTweener](#component-uieffecttweener) component instead.
|
||||
|
||||
> [!TIP]
|
||||
> **Transition Tex** applies transitions using its alpha channel.
|
||||
@@ -325,10 +338,10 @@ The `UIEffect` component applies visual effects to UI elements, allowing various
|
||||
|
||||

|
||||
|
||||
- **Gradation Mode**: `None`, `Horizontal`, `HorizontalGradient`, `Vertical`, `VerticalGradient`, `Radial`, `Diagonal`, `DiagonalToRightBottom`, `DiagonalToLeftBottom`, `Angle`, `AngleGradient`
|
||||

|
||||
- **Gradation Mode**: `None`, `Horizontal`, `HorizontalGradient`, `Vertical`, `VerticalGradient`, `Radial`, `RadialGradient`, `Diagonal`, `DiagonalToRightBottom`, `DiagonalToLeftBottom`, `Angle`, `AngleGradient`
|
||||

|
||||
- **Gradation Color Filter**: `None`, `Multiply`, `Additive`, `Subtractive`, `Replace`, `Multiply Luminance`, `Multiply Additive`
|
||||
- **Gradation Gradient**: The gradient of the gradation.
|
||||
- **Gradation Gradient**: The gradient of the gradation. HDR colors are supported.
|
||||
- `Blend` and `Fixed` modes are available.
|
||||
- **Gradation Color 1**: The first color of the gradation.
|
||||
- **Gradation Color 2**: The second color of the gradation.
|
||||
@@ -336,6 +349,8 @@ The `UIEffect` component applies visual effects to UI elements, allowing various
|
||||
- **Gradation Offset**: The offset of the gradation range.
|
||||
- **Gradation Scale**: The scale of the gradation range.
|
||||
- **Gradation Rotation** (`Angle` or `AngleGradient` only): The rotation of the gradation range.
|
||||
- **Gradation Wrap Mode**: `Repaet`, `Clamp`, `Mirror`, `Mirror Once`
|
||||
- **Gradation Reverse**: Reverse the gradient.
|
||||
- **Keep Aspect Ratio**:
|
||||
- ⚠️ NOTE: `Keep Aspect Ratio` is shared with `Transition Filter` and `Gradation Mode` and `Detail Filter`.
|
||||
|
||||
@@ -353,6 +368,7 @@ The `UIEffect` component applies visual effects to UI elements, allowing various
|
||||
- **Edge Color Glow**: Set the shadow color to glow.
|
||||
- **Edge Shiny Width**: The width of the edge shiny.
|
||||
- **Edge Shiny Auto Play Speed**: The speed of the edge shiny (using shader side `_Time`).
|
||||
- ⚠️ NOTE: This uses scaled time (affected by `Time.timeScale`). If you need unscaled time (useful for pause-resistant effects), use the [UIEffectTweener](#component-uieffecttweener) component instead.
|
||||
|
||||
<br>
|
||||
|
||||
@@ -498,6 +514,8 @@ Click the `Import` button.
|
||||
|
||||
### Usage with ShaderGraph
|
||||
|
||||
⚠️ ShaderGraph support is available only in Unity 2023.2/6.0 or later.
|
||||
|
||||

|
||||
|
||||
To use UIEffect with ShaderGraph, you need to import additional resources.
|
||||
@@ -515,6 +533,18 @@ To use UIEffect with ShaderGraph, you need to import additional resources.
|
||||
|
||||
<br><br>
|
||||
|
||||
### Usage with Timeline
|
||||
|
||||

|
||||
|
||||
Timeline is a powerful animation tool that can control UIEffect using `ControlTrack` and UIEffect tracks.
|
||||
|
||||
- `Control Track`: One of the built-in tracks. When you assign a GameObject with `UIEffect`, `UIEffect` will be enabled during the clip duration.
|
||||
- `UIEffect Tracks`: Tracks for UIEffect. They control `float` or `Color` type properties.
|
||||
- Supports blending, extrapolation, and tween.
|
||||
|
||||
<br><br>
|
||||
|
||||
### Runtime/Editor Preset for UIEffect
|
||||
|
||||

|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
"name": "Coffee.UIEffect",
|
||||
"rootNamespace": "",
|
||||
"references": [
|
||||
"GUID:6055be8ebefd69e48b49212b09b47b2f"
|
||||
"GUID:6055be8ebefd69e48b49212b09b47b2f",
|
||||
"GUID:f06555f75b070af458a003d92f9efb00"
|
||||
],
|
||||
"includePlatforms": [],
|
||||
"excludePlatforms": [],
|
||||
@@ -21,6 +22,16 @@
|
||||
"name": "com.unity.ugui",
|
||||
"expression": "2.0.0",
|
||||
"define": "TMP_ENABLE"
|
||||
},
|
||||
{
|
||||
"name": "com.unity.timeline",
|
||||
"expression": "1.0.0",
|
||||
"define": "TIMELINE_ENABLE"
|
||||
},
|
||||
{
|
||||
"name": "com.unity.textmeshpro",
|
||||
"expression": "[1.0.0,3.2.0-pre.1)",
|
||||
"define": "LEGACY_TMP_ENABLE"
|
||||
}
|
||||
],
|
||||
"noEngineReferences": false
|
||||
|
||||
@@ -59,6 +59,7 @@ namespace Coffee.UIEffects
|
||||
Mask = 5,
|
||||
Melt = 6,
|
||||
Burn = 7,
|
||||
Blaze = 9,
|
||||
Pattern = 8
|
||||
}
|
||||
|
||||
@@ -110,8 +111,14 @@ namespace Coffee.UIEffects
|
||||
HorizontalGradient = 2,
|
||||
Vertical = 3,
|
||||
VerticalGradient = 4,
|
||||
Radial = 5,
|
||||
|
||||
[Obsolete]
|
||||
RadialFast = 5,
|
||||
|
||||
[Obsolete]
|
||||
RadialDetail = 6,
|
||||
RadialGradient = 12,
|
||||
Diagonal = 11,
|
||||
DiagonalToRightBottom = 7,
|
||||
DiagonalToLeftBottom = 8,
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace Coffee.UIEffectInternal
|
||||
private static void GetComponentsInChildren_Internal<T>(this Component self, List<T> results, int depth)
|
||||
where T : Component
|
||||
{
|
||||
if (!self || results == null || depth < 0) return;
|
||||
if (self == null || results == null || depth < 0) return;
|
||||
|
||||
var tr = self.transform;
|
||||
if (tr.TryGetComponent<T>(out var t))
|
||||
@@ -59,7 +59,7 @@ namespace Coffee.UIEffectInternal
|
||||
/// </summary>
|
||||
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)
|
||||
? component
|
||||
: self.gameObject.AddComponent<T>();
|
||||
@@ -166,7 +166,7 @@ namespace Coffee.UIEffectInternal
|
||||
#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
|
||||
{
|
||||
if (!self) return null;
|
||||
if (self == null) return null;
|
||||
if (!includeInactive) return self.GetComponentInParent<T>();
|
||||
|
||||
var current = self.transform;
|
||||
@@ -186,7 +186,7 @@ namespace Coffee.UIEffectInternal
|
||||
/// </summary>
|
||||
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>
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Coffee.UIEffectInternal
|
||||
foreach (var t in TypeCache.GetTypesDerivedFrom(typeof(PreloadedProjectSettings<>)))
|
||||
{
|
||||
var defaultSettings = GetDefaultSettings(t);
|
||||
if (!defaultSettings)
|
||||
if (defaultSettings == null)
|
||||
{
|
||||
// When create a new instance, automatically set it as default settings.
|
||||
defaultSettings = CreateInstance(t) as PreloadedProjectSettings;
|
||||
@@ -48,7 +48,7 @@ namespace Coffee.UIEffectInternal
|
||||
SetDefaultSettings(defaultSettings);
|
||||
}
|
||||
|
||||
if (defaultSettings)
|
||||
if (defaultSettings != null)
|
||||
{
|
||||
defaultSettings.OnInitialize();
|
||||
}
|
||||
@@ -66,7 +66,7 @@ namespace Coffee.UIEffectInternal
|
||||
private static Object[] GetPreloadedSettings(Type type)
|
||||
{
|
||||
return PlayerSettings.GetPreloadedAssets()
|
||||
.Where(x => x && x.GetType() == type)
|
||||
.Where(x => x != null && x.GetType() == type)
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
@@ -76,12 +76,12 @@ namespace Coffee.UIEffectInternal
|
||||
?? AssetDatabase.FindAssets($"t:{nameof(PreloadedProjectSettings)}")
|
||||
.Select(AssetDatabase.GUIDToAssetPath)
|
||||
.Select(AssetDatabase.LoadAssetAtPath<PreloadedProjectSettings>)
|
||||
.FirstOrDefault(x => x && x.GetType() == type);
|
||||
.FirstOrDefault(x => x != null && x.GetType() == type);
|
||||
}
|
||||
|
||||
protected static void SetDefaultSettings(PreloadedProjectSettings asset)
|
||||
{
|
||||
if (!asset) return;
|
||||
if (asset == null) return;
|
||||
|
||||
var type = asset.GetType();
|
||||
if (string.IsNullOrEmpty(AssetDatabase.GetAssetPath(asset)))
|
||||
@@ -103,7 +103,7 @@ namespace Coffee.UIEffectInternal
|
||||
var preloadedAssets = PlayerSettings.GetPreloadedAssets();
|
||||
var projectSettings = GetPreloadedSettings(type);
|
||||
PlayerSettings.SetPreloadedAssets(preloadedAssets
|
||||
.Where(x => x)
|
||||
.Where(x => x != null)
|
||||
.Except(projectSettings.Except(new[] { asset }))
|
||||
.Append(asset)
|
||||
.Distinct()
|
||||
@@ -133,19 +133,19 @@ namespace Coffee.UIEffectInternal
|
||||
#if UNITY_EDITOR
|
||||
private string _jsonText;
|
||||
|
||||
public static bool hasInstance => s_Instance;
|
||||
public static bool hasInstance => s_Instance != null;
|
||||
|
||||
public static T instance
|
||||
{
|
||||
get
|
||||
{
|
||||
if (s_Instance) return s_Instance;
|
||||
if (s_Instance != null) return s_Instance;
|
||||
|
||||
s_Instance = GetDefaultSettings(typeof(T)) as T;
|
||||
if (s_Instance) return s_Instance;
|
||||
if (s_Instance != null) return s_Instance;
|
||||
|
||||
s_Instance = CreateInstance<T>();
|
||||
if (!s_Instance)
|
||||
if (s_Instance == null)
|
||||
{
|
||||
s_Instance = null;
|
||||
return s_Instance;
|
||||
@@ -158,6 +158,8 @@ namespace Coffee.UIEffectInternal
|
||||
|
||||
private void OnPlayModeStateChanged(PlayModeStateChange state)
|
||||
{
|
||||
if (!this) return;
|
||||
|
||||
switch (state)
|
||||
{
|
||||
case PlayModeStateChange.ExitingEditMode:
|
||||
@@ -174,7 +176,7 @@ namespace Coffee.UIEffectInternal
|
||||
}
|
||||
}
|
||||
#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
|
||||
|
||||
/// <summary>
|
||||
@@ -183,7 +185,7 @@ namespace Coffee.UIEffectInternal
|
||||
protected virtual void OnEnable()
|
||||
{
|
||||
#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)
|
||||
{
|
||||
DestroyImmediate(this, true);
|
||||
@@ -193,7 +195,7 @@ namespace Coffee.UIEffectInternal
|
||||
EditorApplication.playModeStateChanged += OnPlayModeStateChanged;
|
||||
#endif
|
||||
|
||||
if (s_Instance) return;
|
||||
if (s_Instance != null) return;
|
||||
s_Instance = this as T;
|
||||
}
|
||||
|
||||
@@ -222,7 +224,7 @@ namespace Coffee.UIEffectInternal
|
||||
|
||||
public override void OnGUI(string searchContext)
|
||||
{
|
||||
if (!_target)
|
||||
if (_target == null)
|
||||
{
|
||||
if (_editor)
|
||||
{
|
||||
|
||||
@@ -20,16 +20,18 @@ namespace Coffee.UIEffectInternal
|
||||
UpdateTmpCgincPath();
|
||||
}
|
||||
|
||||
private static void OnPostprocessAllAssets(string[] _, string[] __, string[] ___, string[] ____)
|
||||
private static void OnPostprocessAllAssets(string[] imported, string[] __, string[] ___, string[] ____)
|
||||
{
|
||||
UpdateTmpCgincPath();
|
||||
if (imported.Any(x => x.EndsWith(".cginc") || x.EndsWith(".shader")))
|
||||
{
|
||||
UpdateTmpCgincPath();
|
||||
}
|
||||
}
|
||||
|
||||
private static void UpdateTmpCgincPath()
|
||||
{
|
||||
if (s_CgincPattern == null || s_ShaderNames == null || s_ShaderNames.Length == 0) return;
|
||||
|
||||
AssetDatabase.StartAssetEditing();
|
||||
string[] cgincs = null;
|
||||
foreach (var shaderName in s_ShaderNames)
|
||||
{
|
||||
@@ -47,8 +49,6 @@ namespace Coffee.UIEffectInternal
|
||||
|
||||
UpdateTmpCgincPath(shader, cgincs);
|
||||
}
|
||||
|
||||
AssetDatabase.StopAssetEditing();
|
||||
}
|
||||
|
||||
private static void UpdateTmpCgincPath(Shader shader, string[] cgincs)
|
||||
|
||||
+5
-5
@@ -11,7 +11,7 @@ using Conditional = System.Diagnostics.ConditionalAttribute;
|
||||
|
||||
namespace Coffee.UIEffectInternal
|
||||
{
|
||||
internal static class Logging
|
||||
internal static class Logger
|
||||
{
|
||||
#if !ENABLE_COFFEE_LOGGER
|
||||
private const string k_DisableSymbol = "DISABLE_COFFEE_LOGGER";
|
||||
@@ -48,7 +48,7 @@ namespace Coffee.UIEffectInternal
|
||||
public static void LogIf(bool enable, object tag, object message, Object context = null)
|
||||
{
|
||||
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
|
||||
@@ -56,7 +56,7 @@ namespace Coffee.UIEffectInternal
|
||||
#endif
|
||||
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
|
||||
@@ -64,13 +64,13 @@ namespace Coffee.UIEffectInternal
|
||||
#endif
|
||||
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)
|
||||
{
|
||||
#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
|
||||
Debug.LogError($"{tag}: {message}", context);
|
||||
#endif
|
||||
@@ -0,0 +1,2 @@
|
||||
fileFormatVersion: 2
|
||||
guid: a2fa34e76bcd14489a1af18b393c3e65
|
||||
@@ -20,7 +20,9 @@ namespace Coffee.UIEffectInternal
|
||||
{
|
||||
public static T[] FindObjectsOfType<T>() where T : Object
|
||||
{
|
||||
#if UNITY_2023_1_OR_NEWER
|
||||
#if UNITY_6000_4_OR_NEWER
|
||||
return Object.FindObjectsByType<T>(FindObjectsInactive.Include);
|
||||
#elif UNITY_2023_1_OR_NEWER
|
||||
return Object.FindObjectsByType<T>(FindObjectsInactive.Include, FindObjectsSortMode.None);
|
||||
#else
|
||||
return Object.FindObjectsOfType<T>();
|
||||
@@ -29,7 +31,7 @@ namespace Coffee.UIEffectInternal
|
||||
|
||||
public static void Destroy(Object obj)
|
||||
{
|
||||
if (!obj) return;
|
||||
if (obj == null) return;
|
||||
#if UNITY_EDITOR
|
||||
if (!Application.isPlaying)
|
||||
{
|
||||
@@ -44,7 +46,7 @@ namespace Coffee.UIEffectInternal
|
||||
|
||||
public static void DestroyImmediate(Object obj)
|
||||
{
|
||||
if (!obj) return;
|
||||
if (obj == null) return;
|
||||
#if UNITY_EDITOR
|
||||
if (Application.isEditor)
|
||||
{
|
||||
@@ -61,7 +63,7 @@ namespace Coffee.UIEffectInternal
|
||||
public static void SetDirty(Object obj)
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
if (!obj) return;
|
||||
if (obj == null) return;
|
||||
EditorUtility.SetDirty(obj);
|
||||
#endif
|
||||
}
|
||||
@@ -117,11 +119,11 @@ namespace Coffee.UIEffectInternal
|
||||
foreach (var type in types)
|
||||
{
|
||||
var script = scripts.FirstOrDefault(x => x.GetClass() == type);
|
||||
if (!script) continue;
|
||||
if (script == null) continue;
|
||||
|
||||
var path = type.GetCustomAttribute<IconAttribute>()?._path;
|
||||
var icon = AssetDatabase.LoadAssetAtPath<Texture2D>(path);
|
||||
if (!icon) continue;
|
||||
if (icon == null) continue;
|
||||
|
||||
s_SetIconForObject(script, icon);
|
||||
}
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Coffee.UIEffectInternal
|
||||
}
|
||||
|
||||
// If there are no instances in the pool, create a new one.
|
||||
Logging.Log(this, $"A new instance is created (pooled: {_pool.CountInactive}, created: {_pool.CountAll}).");
|
||||
Logger.Log(this, $"A new instance is created (pooled: {_pool.CountInactive}, created: {_pool.CountAll}).");
|
||||
return _pool.Get();
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace Coffee.UIEffectInternal
|
||||
if (instance == null) return; // Ignore if already pooled or null.
|
||||
|
||||
_pool.Release(instance);
|
||||
Logging.Log(this, $"An instance is released (pooled: {_pool.CountInactive}, created: {_pool.CountAll}).");
|
||||
Logger.Log(this, $"An instance is released (pooled: {_pool.CountInactive}, created: {_pool.CountAll}).");
|
||||
instance = default; // Set the reference to null.
|
||||
}
|
||||
#else
|
||||
@@ -80,7 +80,7 @@ namespace Coffee.UIEffectInternal
|
||||
}
|
||||
|
||||
// If there are no instances in the pool, create a new one.
|
||||
Logging.Log(this, $"A new instance is created (pooled: {_pool.Count}, created: {++_count}).");
|
||||
Logger.Log(this, $"A new instance is created (pooled: {_pool.Count}, created: {++_count}).");
|
||||
return _onCreate();
|
||||
}
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace Coffee.UIEffectInternal
|
||||
|
||||
_onReturn(instance); // Return the instance to the pool.
|
||||
_pool.Push(instance);
|
||||
Logging.Log(this, $"An instance is released (pooled: {_pool.Count}, created: {_count}).");
|
||||
Logger.Log(this, $"An instance is released (pooled: {_pool.Count}, created: {_count}).");
|
||||
instance = default; // Set the reference to null.
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace Coffee.UIEffectInternal
|
||||
Profiler.BeginSample("(COF)[ObjectRepository] GetFromCache");
|
||||
if (_cache.TryGetValue(hash, out var entry))
|
||||
{
|
||||
if (!entry.storedObject)
|
||||
if (entry.storedObject == null)
|
||||
{
|
||||
Release(ref entry.storedObject);
|
||||
Profiler.EndSample();
|
||||
@@ -103,7 +103,7 @@ namespace Coffee.UIEffectInternal
|
||||
Release(ref obj);
|
||||
++entry.reference;
|
||||
obj = entry.storedObject;
|
||||
Logging.Log(_name, $"Get(total#{count}): {entry}");
|
||||
Logger.Log(_name, $"Get(total#{count}): {entry}");
|
||||
}
|
||||
|
||||
Profiler.EndSample();
|
||||
@@ -116,7 +116,7 @@ namespace Coffee.UIEffectInternal
|
||||
|
||||
private void Add(Hash128 hash, ref T obj, T newObject)
|
||||
{
|
||||
if (!newObject)
|
||||
if (newObject == null)
|
||||
{
|
||||
Release(ref obj);
|
||||
obj = newObject;
|
||||
@@ -130,8 +130,8 @@ namespace Coffee.UIEffectInternal
|
||||
newEntry.hash = hash;
|
||||
newEntry.reference = 1;
|
||||
_cache[hash] = newEntry;
|
||||
_objectKey[newObject.GetInstanceID()] = hash;
|
||||
Logging.Log(_name, $"<color=#03c700>Add</color>(total#{count}): {newEntry}");
|
||||
_objectKey[newObject.GetHashCode()] = hash;
|
||||
Logger.Log(_name, $"<color=#03c700>Add</color>(total#{count}): {newEntry}");
|
||||
Release(ref obj);
|
||||
obj = newObject;
|
||||
Profiler.EndSample();
|
||||
@@ -146,23 +146,23 @@ namespace Coffee.UIEffectInternal
|
||||
|
||||
// Find and release the entry.
|
||||
Profiler.BeginSample("(COF)[ObjectRepository] Release");
|
||||
var id = obj.GetInstanceID();
|
||||
var id = obj.GetHashCode();
|
||||
if (_objectKey.TryGetValue(id, out var hash)
|
||||
&& _cache.TryGetValue(hash, out var entry))
|
||||
{
|
||||
entry.reference--;
|
||||
if (entry.reference <= 0 || !entry.storedObject)
|
||||
if (entry.reference <= 0 || entry.storedObject == null)
|
||||
{
|
||||
Remove(entry);
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Log(_name, $"Release(total#{_cache.Count}): {entry}");
|
||||
Logger.Log(_name, $"Release(total#{_cache.Count}): {entry}");
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Logging.Log(_name, $"Release(total#{_cache.Count}): <color=red>Already released: {obj}</color>");
|
||||
Logger.Log(_name, $"Release(total#{_cache.Count}): <color=red>Already released: {obj}</color>");
|
||||
}
|
||||
|
||||
obj = null;
|
||||
@@ -175,10 +175,10 @@ namespace Coffee.UIEffectInternal
|
||||
|
||||
Profiler.BeginSample("(COF)[ObjectRepository] Remove");
|
||||
_cache.Remove(entry.hash);
|
||||
_objectKey.Remove(entry.storedObject.GetInstanceID());
|
||||
_objectKey.Remove(entry.storedObject.GetHashCode());
|
||||
_pool.Push(entry);
|
||||
entry.reference = 0;
|
||||
Logging.Log(_name, $"<color=#f29e03>Remove</color>(total#{_cache.Count}): {entry}");
|
||||
Logger.Log(_name, $"<color=#f29e03>Remove</color>(total#{_cache.Count}): {entry}");
|
||||
entry.Release(_onRelease);
|
||||
Profiler.EndSample();
|
||||
}
|
||||
@@ -192,7 +192,7 @@ namespace Coffee.UIEffectInternal
|
||||
public void Release(Action<T> onRelease)
|
||||
{
|
||||
reference = 0;
|
||||
if (storedObject)
|
||||
if (storedObject != null)
|
||||
{
|
||||
onRelease?.Invoke(storedObject);
|
||||
}
|
||||
|
||||
@@ -6,6 +6,7 @@ using UnityEngine.Profiling;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using System.Text.RegularExpressions;
|
||||
using UnityEditor;
|
||||
using UnityEditorInternal;
|
||||
@@ -16,7 +17,7 @@ using Object = UnityEngine.Object;
|
||||
namespace Coffee.UIEffectInternal
|
||||
{
|
||||
[Serializable]
|
||||
public class ShaderVariantRegistry
|
||||
public sealed class ShaderVariantRegistry
|
||||
{
|
||||
[Serializable]
|
||||
internal class StringPair : IEquatable<StringPair>
|
||||
@@ -26,9 +27,7 @@ namespace Coffee.UIEffectInternal
|
||||
|
||||
public bool Equals(StringPair other)
|
||||
{
|
||||
if (other == null) return false;
|
||||
if (ReferenceEquals(this, other)) return true;
|
||||
return key == other.key && value == other.value;
|
||||
return other != null && key == other.key && value == other.value;
|
||||
}
|
||||
|
||||
public override bool Equals(object obj)
|
||||
@@ -72,7 +71,7 @@ namespace Coffee.UIEffectInternal
|
||||
if (!shader) return null;
|
||||
|
||||
// Already cached.
|
||||
var id = shader.GetInstanceID();
|
||||
var id = shader.GetHashCode();
|
||||
if (_cachedOptionalShaders.TryGetValue(id, out var optionalShaderName))
|
||||
{
|
||||
return Shader.Find(optionalShaderName);
|
||||
@@ -88,15 +87,15 @@ namespace Coffee.UIEffectInternal
|
||||
|
||||
// Find optional shader.
|
||||
Shader optionalShader;
|
||||
foreach (var pair in m_OptionalShaders)
|
||||
var count = m_OptionalShaders.Count;
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
var pair = m_OptionalShaders[i];
|
||||
if (pair.key != shaderName) continue;
|
||||
optionalShader = Shader.Find(pair.value);
|
||||
if (optionalShader)
|
||||
{
|
||||
_cachedOptionalShaders[id] = pair.value;
|
||||
return optionalShader;
|
||||
}
|
||||
if (!optionalShader) continue;
|
||||
_cachedOptionalShaders[id] = pair.value;
|
||||
return optionalShader;
|
||||
}
|
||||
|
||||
// Find optional shader by format.
|
||||
@@ -122,10 +121,15 @@ namespace Coffee.UIEffectInternal
|
||||
|
||||
#if UNITY_EDITOR
|
||||
private readonly HashSet<StringPair> _logVariants = new HashSet<StringPair>();
|
||||
private readonly StringBuilder _sb = new StringBuilder(1024);
|
||||
|
||||
private readonly Dictionary<Hash128, (ShaderVariantCollection.ShaderVariant, StringPair)> _cachedVariants =
|
||||
new Dictionary<Hash128, (ShaderVariantCollection.ShaderVariant, StringPair)>();
|
||||
|
||||
public void ClearCache()
|
||||
{
|
||||
_cachedOptionalShaders.Clear();
|
||||
_cachedVariants.Clear();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -213,21 +217,10 @@ namespace Coffee.UIEffectInternal
|
||||
if (!material || !material.shader || !m_Asset) return;
|
||||
|
||||
Profiler.BeginSample("(EDITOR/COF)[ShaderVariantRegistry] RegisterVariant");
|
||||
var shaderName = material.shader.name;
|
||||
var validKeywords = material.shaderKeywords
|
||||
.Where(x => !Regex.IsMatch(x, "(_EDITOR|EDITOR_)"))
|
||||
.ToArray();
|
||||
var keywords = string.Join(" ", validKeywords);
|
||||
var variant = new ShaderVariantCollection.ShaderVariant
|
||||
{
|
||||
shader = material.shader,
|
||||
keywords = validKeywords
|
||||
};
|
||||
|
||||
// Already registered.
|
||||
var pair = new StringPair() { key = shaderName, value = keywords };
|
||||
var (variant, pair) = GetVariant(material);
|
||||
if (m_Asset.Contains(variant))
|
||||
{
|
||||
// Already registered.
|
||||
m_UnregisteredVariants.Remove(pair);
|
||||
Profiler.EndSample();
|
||||
return;
|
||||
@@ -243,7 +236,8 @@ namespace Coffee.UIEffectInternal
|
||||
|
||||
if (_logVariants.Add(pair))
|
||||
{
|
||||
keywords = string.IsNullOrEmpty(keywords) ? "no keywords" : keywords;
|
||||
var shaderName = pair.key;
|
||||
var keywords = string.IsNullOrEmpty(pair.value) ? "no keywords" : pair.value;
|
||||
Debug.LogError($"Shader variant '{shaderName} <{keywords}>' is not registered.\n" +
|
||||
$"Register it in 'ProjectSettings > {path}' to use it in player.", m_Asset);
|
||||
}
|
||||
@@ -256,6 +250,55 @@ namespace Coffee.UIEffectInternal
|
||||
m_UnregisteredVariants.Remove(pair);
|
||||
Profiler.EndSample();
|
||||
}
|
||||
|
||||
private (ShaderVariantCollection.ShaderVariant, StringPair) GetVariant(Material material)
|
||||
{
|
||||
Profiler.BeginSample("(EDITOR/COF)[ShaderVariantRegistry] GetVariant");
|
||||
var shader = material.shader;
|
||||
_sb.Length = 0;
|
||||
foreach (var keyword in material.shaderKeywords)
|
||||
{
|
||||
// Ignore editor keyword.
|
||||
if (keyword.Contains("_EDITOR") || keyword.Contains("EDITOR_")) continue;
|
||||
|
||||
_sb.Append(keyword);
|
||||
_sb.Append(' ');
|
||||
}
|
||||
|
||||
if (0 < _sb.Length)
|
||||
{
|
||||
_sb.Length--; // Remove last space.
|
||||
}
|
||||
|
||||
var hash = new Hash128((uint)shader.GetHashCode(), (uint)GetContentsHashCode(_sb), 0, 0);
|
||||
if (_cachedVariants.TryGetValue(hash, out var result))
|
||||
{
|
||||
Profiler.EndSample();
|
||||
return result;
|
||||
}
|
||||
|
||||
var pair = new StringPair() { key = shader.name, value = _sb.ToString() };
|
||||
var variant = new ShaderVariantCollection.ShaderVariant
|
||||
{
|
||||
shader = shader,
|
||||
keywords = pair.value.Split(' ')
|
||||
};
|
||||
|
||||
_cachedVariants.Add(hash, (variant, pair));
|
||||
Profiler.EndSample();
|
||||
return (variant, pair);
|
||||
}
|
||||
|
||||
private static int GetContentsHashCode(StringBuilder sb)
|
||||
{
|
||||
var hash = 17;
|
||||
for (var i = 0; i < sb.Length; i++)
|
||||
{
|
||||
hash = unchecked(hash * 31 + sb[i]);
|
||||
}
|
||||
|
||||
return hash;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using System.Reflection;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
@@ -20,7 +21,7 @@ namespace Coffee.UIEffectInternal
|
||||
static UIExtraCallbacks()
|
||||
{
|
||||
Canvas.willRenderCanvases += OnBeforeCanvasRebuild;
|
||||
Logging.LogMulticast(typeof(Canvas), "willRenderCanvases", message: "ctor");
|
||||
Logger.LogMulticast(typeof(Canvas), "willRenderCanvases", message: "ctor");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -67,9 +68,17 @@ namespace Coffee.UIEffectInternal
|
||||
if (s_IsInitializedAfterCanvasRebuild) return;
|
||||
s_IsInitializedAfterCanvasRebuild = true;
|
||||
|
||||
// Explicitly set `Canvas.willRenderCanvases += CanvasUpdateRegistry.PerformUpdate`.
|
||||
CanvasUpdateRegistry.IsRebuildingLayout();
|
||||
#if TMP_ENABLE
|
||||
// Explicitly set `Canvas.willRenderCanvases += TMP_UpdateManager.DoRebuilds`.
|
||||
typeof(TMPro.TMP_UpdateManager)
|
||||
.GetProperty("instance", BindingFlags.NonPublic | BindingFlags.Static)
|
||||
.GetValue(null);
|
||||
#endif
|
||||
Canvas.willRenderCanvases -= OnAfterCanvasRebuild;
|
||||
Canvas.willRenderCanvases += OnAfterCanvasRebuild;
|
||||
Logging.LogMulticast(typeof(Canvas), "willRenderCanvases",
|
||||
Logger.LogMulticast(typeof(Canvas), "willRenderCanvases",
|
||||
message: "InitializeAfterCanvasRebuild");
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 3278a8b3cb92d4cc69862f0d45f150ad
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 014b76346c11643a89303ed3b5681733
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,44 @@
|
||||
#if TIMELINE_ENABLE
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Coffee.UIEffects.Timeline
|
||||
{
|
||||
[DisplayName("Clip")]
|
||||
public class UIEffectColorClip : UIEffectClip<UIEffectColorBehaviour>
|
||||
{
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class UIEffectColorBehaviour : UIEffectBehaviour, IGetValue<Color>
|
||||
{
|
||||
[ColorUsage(true, true)]
|
||||
public Color m_Value = Color.white;
|
||||
|
||||
[ColorUsage(true, true)]
|
||||
public Color m_From = Color.white;
|
||||
|
||||
public Color Get(float time)
|
||||
{
|
||||
return m_Tween
|
||||
? Color.Lerp(m_From, m_Value, m_Curve.Evaluate(time))
|
||||
: m_Value;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class UIEffectColorMixerBehaviour : UIEffectMixerBehaviour<Color, UIEffectColorBehaviour>
|
||||
{
|
||||
protected override Color Add(Color baseValue, Color value, float weight)
|
||||
{
|
||||
return baseValue + value * weight;
|
||||
}
|
||||
|
||||
protected override Color Lerp(Color defaultValue, Color value, float weight)
|
||||
{
|
||||
return Color.Lerp(defaultValue, value, weight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0c402544dc0be48afa6e9d3eb88120be
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,42 @@
|
||||
#if TIMELINE_ENABLE
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Coffee.UIEffects.Timeline
|
||||
{
|
||||
[DisplayName("Clip")]
|
||||
public class UIEffectFloatClip : UIEffectClip<UIEffectFloatBehaviour>
|
||||
{
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public class UIEffectFloatBehaviour : UIEffectBehaviour, IGetValue<float>
|
||||
{
|
||||
public float m_Value = 1;
|
||||
|
||||
public float m_From = 1;
|
||||
|
||||
public float Get(float time)
|
||||
{
|
||||
return m_Tween
|
||||
? Mathf.Lerp(m_From, m_Value, m_Curve.Evaluate(time))
|
||||
: m_Value;
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class UIEffectFloatMixerBehaviour : UIEffectMixerBehaviour<float, UIEffectFloatBehaviour>
|
||||
{
|
||||
protected override float Add(float baseValue, float value, float weight)
|
||||
{
|
||||
return baseValue + value * weight;
|
||||
}
|
||||
|
||||
protected override float Lerp(float defaultValue, float value, float weight)
|
||||
{
|
||||
return Mathf.Lerp(defaultValue, value, weight);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ffaa25511fc8148839e36bda4414e944
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,177 @@
|
||||
#if TIMELINE_ENABLE
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Playables;
|
||||
using UnityEngine.Timeline;
|
||||
|
||||
namespace Coffee.UIEffects.Timeline
|
||||
{
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class FloatClipUsageAttribute : PropertyAttribute
|
||||
{
|
||||
public readonly float min;
|
||||
public readonly float max;
|
||||
public readonly float defaultValue;
|
||||
|
||||
public FloatClipUsageAttribute(float min, float max, float defaultValue = 0f)
|
||||
{
|
||||
this.min = min;
|
||||
this.max = max;
|
||||
this.defaultValue = defaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
[AttributeUsage(AttributeTargets.Class)]
|
||||
public class ColorClipUsageAttribute : PropertyAttribute
|
||||
{
|
||||
public readonly bool alpha;
|
||||
|
||||
public ColorClipUsageAttribute(bool alpha)
|
||||
{
|
||||
this.alpha = alpha;
|
||||
}
|
||||
}
|
||||
|
||||
public interface IGetValue<out T>
|
||||
{
|
||||
T Get(float time);
|
||||
}
|
||||
|
||||
[TrackColor(0.92f, 0.54f, 0.17f)]
|
||||
[TrackBindingType(typeof(UIEffect), TrackBindingFlags.AllowCreateComponent)]
|
||||
public abstract class UIEffectTrack<T> : TrackAsset
|
||||
where T : PlayableBehaviour, new()
|
||||
{
|
||||
protected abstract string fieldName { get; }
|
||||
|
||||
public override Playable CreateTrackMixer(PlayableGraph graph, GameObject go, int inputCount)
|
||||
{
|
||||
var playable = ScriptPlayable<T>.Create(graph, inputCount);
|
||||
|
||||
foreach (var timelineClip in GetClips())
|
||||
{
|
||||
if (timelineClip.asset is UIEffectClip clip)
|
||||
{
|
||||
clip.timelineClip = timelineClip;
|
||||
}
|
||||
}
|
||||
|
||||
return playable;
|
||||
}
|
||||
|
||||
public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
|
||||
{
|
||||
var trackBinding = director.GetGenericBinding(this) as UIEffect;
|
||||
if (!trackBinding) return;
|
||||
|
||||
driver.AddFromName<UIEffect>(trackBinding.gameObject, fieldName);
|
||||
base.GatherProperties(director, driver);
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class UIEffectClip : PlayableAsset, ITimelineClipAsset
|
||||
{
|
||||
public TimelineClip timelineClip { get; set; }
|
||||
public ClipCaps clipCaps => ClipCaps.Blending | ClipCaps.Extrapolation;
|
||||
|
||||
private void OnValidate()
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
public abstract class UIEffectClip<T> : UIEffectClip
|
||||
where T : UIEffectBehaviour, new()
|
||||
{
|
||||
[NotKeyable]
|
||||
[SerializeField]
|
||||
public T m_Data = new T();
|
||||
|
||||
public override Playable CreatePlayable(PlayableGraph graph, GameObject owner)
|
||||
{
|
||||
var playable = ScriptPlayable<T>.Create(graph, m_Data);
|
||||
var behaviour = playable.GetBehaviour();
|
||||
behaviour.clip = this;
|
||||
return playable;
|
||||
}
|
||||
}
|
||||
|
||||
[Serializable]
|
||||
public abstract class UIEffectBehaviour : PlayableBehaviour
|
||||
{
|
||||
public bool m_Tween;
|
||||
public AnimationCurve m_Curve = AnimationCurve.Linear(0, 0, 1, 1);
|
||||
public UIEffectClip clip { get; set; }
|
||||
}
|
||||
|
||||
public abstract class UIEffectMixerBehaviour<T, TBehavior> : PlayableBehaviour
|
||||
where TBehavior : UIEffectBehaviour, IGetValue<T>, new()
|
||||
{
|
||||
private T _defaultValue;
|
||||
protected abstract T currentValue { get; set; }
|
||||
protected UIEffect effect { get; private set; }
|
||||
|
||||
public override void ProcessFrame(Playable playable, FrameData info, object playerData)
|
||||
{
|
||||
InitializeIfNeeded(playerData as UIEffect);
|
||||
if (!effect) return;
|
||||
|
||||
var inputCount = playable.GetInputCount();
|
||||
var value = default(T);
|
||||
var totalWeight = GetTotalWeight(playable);
|
||||
|
||||
for (var i = 0; i < inputCount; i++)
|
||||
{
|
||||
var weight = playable.GetInputWeight(i);
|
||||
if (weight <= 0) continue;
|
||||
|
||||
var playableInput = (ScriptPlayable<TBehavior>)playable.GetInput(i);
|
||||
var input = playableInput.GetBehaviour();
|
||||
var normalizedTime = (float)(playableInput.GetTime() / input.clip.timelineClip.duration);
|
||||
|
||||
value = Add(value, input.Get(normalizedTime), weight / totalWeight);
|
||||
totalWeight += weight;
|
||||
}
|
||||
|
||||
currentValue = Lerp(_defaultValue, value, totalWeight);
|
||||
}
|
||||
|
||||
public override void OnPlayableDestroy(Playable playable)
|
||||
{
|
||||
if (effect)
|
||||
{
|
||||
currentValue = _defaultValue;
|
||||
}
|
||||
}
|
||||
|
||||
private static float GetTotalWeight(Playable playable)
|
||||
{
|
||||
var totalWeight = 0f;
|
||||
var inputCount = playable.GetInputCount();
|
||||
for (var i = 0; i < inputCount; i++)
|
||||
{
|
||||
totalWeight += playable.GetInputWeight(i);
|
||||
}
|
||||
|
||||
return totalWeight;
|
||||
}
|
||||
|
||||
private void InitializeIfNeeded(UIEffect newEffect)
|
||||
{
|
||||
if (effect == newEffect) return;
|
||||
|
||||
if (effect)
|
||||
{
|
||||
currentValue = _defaultValue;
|
||||
}
|
||||
|
||||
effect = newEffect;
|
||||
_defaultValue = newEffect ? currentValue : default;
|
||||
}
|
||||
|
||||
protected abstract T Add(T current, T value, float weight);
|
||||
|
||||
protected abstract T Lerp(T defaultValue, T value, float weight);
|
||||
}
|
||||
}
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 8a54d6ecf5bae485db4b0df376bebc35
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,25 @@
|
||||
#if TIMELINE_ENABLE
|
||||
using System.ComponentModel;
|
||||
using UnityEngine.Timeline;
|
||||
using Coffee.UIEffects.Timeline;
|
||||
|
||||
namespace Coffee.UIEffects
|
||||
{
|
||||
[FloatClipUsage(0f, 1f)]
|
||||
[TrackClipType(typeof(UIEffectFloatClip))]
|
||||
[DisplayName("UIEffect Tracks/Color Intensity Track")]
|
||||
public class ColorIntensityTrack : UIEffectTrack<ColorIntensityMixer>
|
||||
{
|
||||
protected override string fieldName => "m_ColorIntensity";
|
||||
}
|
||||
|
||||
public class ColorIntensityMixer : UIEffectFloatMixerBehaviour
|
||||
{
|
||||
protected override float currentValue
|
||||
{
|
||||
get => effect.colorIntensity;
|
||||
set => effect.colorIntensity = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 66d61d709d31c4220bc59365f78584ec
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,26 @@
|
||||
#if TIMELINE_ENABLE
|
||||
using System.ComponentModel;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Timeline;
|
||||
using Coffee.UIEffects.Timeline;
|
||||
|
||||
namespace Coffee.UIEffects
|
||||
{
|
||||
[ColorClipUsage(false)]
|
||||
[TrackClipType(typeof(UIEffectColorClip))]
|
||||
[DisplayName("UIEffect Tracks/Color Track")]
|
||||
public class ColorTrack : UIEffectTrack<ColorMixer>
|
||||
{
|
||||
protected override string fieldName => "m_Color";
|
||||
}
|
||||
|
||||
public class ColorMixer : UIEffectColorMixerBehaviour
|
||||
{
|
||||
protected override Color currentValue
|
||||
{
|
||||
get => effect.color;
|
||||
set => effect.color = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: edfa6dc975b3446d8bc2cf6ca1fdd40f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,26 @@
|
||||
#if TIMELINE_ENABLE
|
||||
using System.ComponentModel;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Timeline;
|
||||
using Coffee.UIEffects.Timeline;
|
||||
|
||||
namespace Coffee.UIEffects
|
||||
{
|
||||
[ColorClipUsage(true)]
|
||||
[TrackClipType(typeof(UIEffectColorClip))]
|
||||
[DisplayName("UIEffect Tracks/Detail Color Track")]
|
||||
public class DetailColorTrack : UIEffectTrack<DetailColorMixer>
|
||||
{
|
||||
protected override string fieldName => "m_DetailColor";
|
||||
}
|
||||
|
||||
public class DetailColorMixer : UIEffectColorMixerBehaviour
|
||||
{
|
||||
protected override Color currentValue
|
||||
{
|
||||
get => effect.detailColor;
|
||||
set => effect.detailColor = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 88051c9178d704e47a12db836b6343c0
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,25 @@
|
||||
#if TIMELINE_ENABLE
|
||||
using System.ComponentModel;
|
||||
using UnityEngine.Timeline;
|
||||
using Coffee.UIEffects.Timeline;
|
||||
|
||||
namespace Coffee.UIEffects
|
||||
{
|
||||
[FloatClipUsage(0f, 1f)]
|
||||
[TrackClipType(typeof(UIEffectFloatClip))]
|
||||
[DisplayName("UIEffect Tracks/Detail Intensity Track")]
|
||||
public class DetailIntensityTrack : UIEffectTrack<DetailIntensityMixer>
|
||||
{
|
||||
protected override string fieldName => "m_DetailIntensity";
|
||||
}
|
||||
|
||||
public class DetailIntensityMixer : UIEffectFloatMixerBehaviour
|
||||
{
|
||||
protected override float currentValue
|
||||
{
|
||||
get => effect.detailIntensity;
|
||||
set => effect.detailIntensity = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: e901a5dfc37104d2182dcc49fe370305
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,26 @@
|
||||
#if TIMELINE_ENABLE
|
||||
using System.ComponentModel;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Timeline;
|
||||
using Coffee.UIEffects.Timeline;
|
||||
|
||||
namespace Coffee.UIEffects
|
||||
{
|
||||
[ColorClipUsage(true)]
|
||||
[TrackClipType(typeof(UIEffectColorClip))]
|
||||
[DisplayName("UIEffect Tracks/Detail Color Track")]
|
||||
public class EdgeColorTrack : UIEffectTrack<EdgeColorMixer>
|
||||
{
|
||||
protected override string fieldName => "m_EdgeColor";
|
||||
}
|
||||
|
||||
public class EdgeColorMixer : UIEffectColorMixerBehaviour
|
||||
{
|
||||
protected override Color currentValue
|
||||
{
|
||||
get => effect.edgeColor;
|
||||
set => effect.edgeColor = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: f78a05c2255e94329a1b7bd465ac8f8a
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,25 @@
|
||||
#if TIMELINE_ENABLE
|
||||
using System.ComponentModel;
|
||||
using UnityEngine.Timeline;
|
||||
using Coffee.UIEffects.Timeline;
|
||||
|
||||
namespace Coffee.UIEffects
|
||||
{
|
||||
[FloatClipUsage(0f, 1f)]
|
||||
[TrackClipType(typeof(UIEffectFloatClip))]
|
||||
[DisplayName("UIEffect Tracks/Edge Shiny Rate Track")]
|
||||
public class EdgeShinyRateTrack : UIEffectTrack<EdgeShinyRateMixer>
|
||||
{
|
||||
protected override string fieldName => "m_EdgeShinyRate";
|
||||
}
|
||||
|
||||
public class EdgeShinyRateMixer : UIEffectFloatMixerBehaviour
|
||||
{
|
||||
protected override float currentValue
|
||||
{
|
||||
get => effect.edgeShinyRate;
|
||||
set => effect.edgeShinyRate = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 118c294bc3dfa4e7a96de50b410ad846
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,25 @@
|
||||
#if TIMELINE_ENABLE
|
||||
using System.ComponentModel;
|
||||
using UnityEngine.Timeline;
|
||||
using Coffee.UIEffects.Timeline;
|
||||
|
||||
namespace Coffee.UIEffects
|
||||
{
|
||||
[FloatClipUsage(0f, 1f)]
|
||||
[TrackClipType(typeof(UIEffectFloatClip))]
|
||||
[DisplayName("UIEffect Tracks/Gradation Intensity Track")]
|
||||
public class GradationIntensityTrack : UIEffectTrack<GradationIntensityMixer>
|
||||
{
|
||||
protected override string fieldName => "m_GradationIntensity";
|
||||
}
|
||||
|
||||
public class GradationIntensityMixer : UIEffectFloatMixerBehaviour
|
||||
{
|
||||
protected override float currentValue
|
||||
{
|
||||
get => effect.gradationIntensity;
|
||||
set => effect.gradationIntensity = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 7b4c7c51d8c8c4d9ebfacb4ec8e7f73e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,24 @@
|
||||
#if TIMELINE_ENABLE
|
||||
using System.ComponentModel;
|
||||
using UnityEngine.Timeline;
|
||||
using Coffee.UIEffects.Timeline;
|
||||
|
||||
namespace Coffee.UIEffects
|
||||
{
|
||||
[TrackClipType(typeof(UIEffectFloatClip))]
|
||||
[DisplayName("UIEffect Tracks/Gradation Offset Track")]
|
||||
public class GradationOffsetTrack : UIEffectTrack<GradationOffsetMixer>
|
||||
{
|
||||
protected override string fieldName => "m_GradationOffset";
|
||||
}
|
||||
|
||||
public class GradationOffsetMixer : UIEffectFloatMixerBehaviour
|
||||
{
|
||||
protected override float currentValue
|
||||
{
|
||||
get => effect.gradationOffset;
|
||||
set => effect.gradationOffset = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: deb67c01293914e41a70a7570c3a539e
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,24 @@
|
||||
#if TIMELINE_ENABLE
|
||||
using System.ComponentModel;
|
||||
using UnityEngine.Timeline;
|
||||
using Coffee.UIEffects.Timeline;
|
||||
|
||||
namespace Coffee.UIEffects
|
||||
{
|
||||
[TrackClipType(typeof(UIEffectFloatClip))]
|
||||
[DisplayName("UIEffect Tracks/Gradation Rotation Track")]
|
||||
public class GradationRotationTrack : UIEffectTrack<GradationRotationMixer>
|
||||
{
|
||||
protected override string fieldName => "m_GradationRotation";
|
||||
}
|
||||
|
||||
public class GradationRotationMixer : UIEffectFloatMixerBehaviour
|
||||
{
|
||||
protected override float currentValue
|
||||
{
|
||||
get => effect.gradationRotation;
|
||||
set => effect.gradationRotation = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: eb2c49df5c5af40d189179c70f3f4e8f
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,25 @@
|
||||
#if TIMELINE_ENABLE
|
||||
using System.ComponentModel;
|
||||
using UnityEngine.Timeline;
|
||||
using Coffee.UIEffects.Timeline;
|
||||
|
||||
namespace Coffee.UIEffects
|
||||
{
|
||||
[FloatClipUsage(0.01f, 10f)]
|
||||
[TrackClipType(typeof(UIEffectFloatClip))]
|
||||
[DisplayName("UIEffect Tracks/Gradation Scale Track")]
|
||||
public class GradationScaleTrack : UIEffectTrack<GradationScaleMixer>
|
||||
{
|
||||
protected override string fieldName => "m_GradationScale";
|
||||
}
|
||||
|
||||
public class GradationScaleMixer : UIEffectFloatMixerBehaviour
|
||||
{
|
||||
protected override float currentValue
|
||||
{
|
||||
get => effect.gradationScale;
|
||||
set => effect.gradationScale = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 0e9a4fc9655b64a399feaf134500daad
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,25 @@
|
||||
#if TIMELINE_ENABLE
|
||||
using System.ComponentModel;
|
||||
using UnityEngine.Timeline;
|
||||
using Coffee.UIEffects.Timeline;
|
||||
|
||||
namespace Coffee.UIEffects
|
||||
{
|
||||
[FloatClipUsage(0f, 1f)]
|
||||
[TrackClipType(typeof(UIEffectFloatClip))]
|
||||
[DisplayName("UIEffect Tracks/Sampling Intensity Track")]
|
||||
public class SamplingIntensityTrack : UIEffectTrack<SamplingIntensityMixer>
|
||||
{
|
||||
protected override string fieldName => "m_SamplingIntensity";
|
||||
}
|
||||
|
||||
public class SamplingIntensityMixer : UIEffectFloatMixerBehaviour
|
||||
{
|
||||
protected override float currentValue
|
||||
{
|
||||
get => effect.samplingIntensity;
|
||||
set => effect.samplingIntensity = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ae43eda84464f470db063babd75d86ce
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,25 @@
|
||||
#if TIMELINE_ENABLE
|
||||
using System.ComponentModel;
|
||||
using UnityEngine.Timeline;
|
||||
using Coffee.UIEffects.Timeline;
|
||||
|
||||
namespace Coffee.UIEffects
|
||||
{
|
||||
[FloatClipUsage(0f, 1f)]
|
||||
[TrackClipType(typeof(UIEffectFloatClip))]
|
||||
[DisplayName("UIEffect Tracks/Tone Intensity Track")]
|
||||
public class ToneIntensityTrack : UIEffectTrack<ToneIntensityMixer>
|
||||
{
|
||||
protected override string fieldName => "m_ToneIntensity";
|
||||
}
|
||||
|
||||
public class ToneIntensityMixer : UIEffectFloatMixerBehaviour
|
||||
{
|
||||
protected override float currentValue
|
||||
{
|
||||
get => effect.toneIntensity;
|
||||
set => effect.toneIntensity = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c08d90226dd3d48c7b26e4148a627c30
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,26 @@
|
||||
#if TIMELINE_ENABLE
|
||||
using System.ComponentModel;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Timeline;
|
||||
using Coffee.UIEffects.Timeline;
|
||||
|
||||
namespace Coffee.UIEffects
|
||||
{
|
||||
[ColorClipUsage(true)]
|
||||
[TrackClipType(typeof(UIEffectColorClip))]
|
||||
[DisplayName("UIEffect Tracks/Transition Color Track")]
|
||||
public class TransitionColorTrack : UIEffectTrack<TransitionColorMixer>
|
||||
{
|
||||
protected override string fieldName => "m_TransitionColor";
|
||||
}
|
||||
|
||||
public class TransitionColorMixer : UIEffectColorMixerBehaviour
|
||||
{
|
||||
protected override Color currentValue
|
||||
{
|
||||
get => effect.transitionColor;
|
||||
set => effect.transitionColor = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6cbbddc14d5744997a755e56c474a436
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -0,0 +1,25 @@
|
||||
#if TIMELINE_ENABLE
|
||||
using System.ComponentModel;
|
||||
using UnityEngine.Timeline;
|
||||
using Coffee.UIEffects.Timeline;
|
||||
|
||||
namespace Coffee.UIEffects
|
||||
{
|
||||
[FloatClipUsage(0f, 1f)]
|
||||
[TrackClipType(typeof(UIEffectFloatClip))]
|
||||
[DisplayName("UIEffect Tracks/Transition Rate Track")]
|
||||
public class TransitionRateTrack : UIEffectTrack<TransitionRateMixer>
|
||||
{
|
||||
protected override string fieldName => "m_TransitionRate";
|
||||
}
|
||||
|
||||
public class TransitionRateMixer : UIEffectFloatMixerBehaviour
|
||||
{
|
||||
protected override float currentValue
|
||||
{
|
||||
get => effect.transitionRate;
|
||||
set => effect.transitionRate = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
#endif
|
||||
@@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 97f54e7d118464cd099026c08294dc29
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@@ -107,6 +107,9 @@ namespace Coffee.UIEffects
|
||||
[SerializeField]
|
||||
protected float m_TransitionAutoPlaySpeed = 0f;
|
||||
|
||||
[SerializeField]
|
||||
private Gradient m_TransitionGradient = new Gradient();
|
||||
|
||||
[SerializeField]
|
||||
protected TargetMode m_TargetMode = TargetMode.None;
|
||||
|
||||
@@ -198,6 +201,12 @@ namespace Coffee.UIEffects
|
||||
[Range(0, 360)]
|
||||
private float m_GradationRotation = 0;
|
||||
|
||||
[SerializeField]
|
||||
protected TextureWrapMode m_GradationWrapMode = TextureWrapMode.Repeat;
|
||||
|
||||
[SerializeField]
|
||||
protected bool m_GradationReverse = false;
|
||||
|
||||
[SerializeField]
|
||||
protected bool m_AllowToModifyMeshShape = true;
|
||||
|
||||
@@ -273,6 +282,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
if (m_ToneFilter == value) return;
|
||||
context.m_ToneFilter = m_ToneFilter = value;
|
||||
SetVerticesDirty();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
@@ -302,6 +312,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
if (m_ColorFilter == value) return;
|
||||
context.m_ColorFilter = m_ColorFilter = value;
|
||||
SetVerticesDirty();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
@@ -785,6 +796,7 @@ namespace Coffee.UIEffects
|
||||
(m_SrcBlendMode, m_DstBlendMode) = (m_BlendType, m_SrcBlendMode, m_DstBlendMode).Convert();
|
||||
context.m_SrcBlendMode = m_SrcBlendMode;
|
||||
context.m_DstBlendMode = m_DstBlendMode;
|
||||
SetVerticesDirty();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
@@ -801,6 +813,7 @@ namespace Coffee.UIEffects
|
||||
if (m_SrcBlendMode == value) return;
|
||||
context.m_SrcBlendMode = m_SrcBlendMode = value;
|
||||
m_BlendType = (m_SrcBlendMode, m_DstBlendMode).Convert();
|
||||
SetVerticesDirty();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
@@ -817,6 +830,7 @@ namespace Coffee.UIEffects
|
||||
if (m_DstBlendMode == value) return;
|
||||
context.m_DstBlendMode = m_DstBlendMode = value;
|
||||
m_BlendType = (m_SrcBlendMode, m_DstBlendMode).Convert();
|
||||
SetVerticesDirty();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
@@ -829,6 +843,7 @@ namespace Coffee.UIEffects
|
||||
if (m_ShadowMode == value) return;
|
||||
context.m_ShadowMode = m_ShadowMode = value;
|
||||
SetVerticesDirty();
|
||||
SetVerticesDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1004,6 +1019,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
if (m_EdgeMode == value) return;
|
||||
context.m_EdgeMode = m_EdgeMode = value;
|
||||
SetVerticesDirty();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
@@ -1173,6 +1189,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
if (m_GradationMode == value) return;
|
||||
context.m_GradationMode = m_GradationMode = value;
|
||||
SetVerticesDirty();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
@@ -1263,6 +1280,7 @@ namespace Coffee.UIEffects
|
||||
get => m_GradationScale;
|
||||
set
|
||||
{
|
||||
value = Mathf.Clamp(value, 0.01f, 10f);
|
||||
if (Mathf.Approximately(m_GradationScale, value)) return;
|
||||
context.m_GradationScale = m_GradationScale = value;
|
||||
SetMaterialDirty();
|
||||
@@ -1280,6 +1298,30 @@ namespace Coffee.UIEffects
|
||||
}
|
||||
}
|
||||
|
||||
public TextureWrapMode gradationWrapMode
|
||||
{
|
||||
get => m_GradationWrapMode;
|
||||
set
|
||||
{
|
||||
if (m_GradationWrapMode == value) return;
|
||||
context.m_GradationWrapMode = m_GradationWrapMode = value;
|
||||
context.SetGradationDirty();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
public bool gradationReverse
|
||||
{
|
||||
get => m_GradationReverse;
|
||||
set
|
||||
{
|
||||
if (m_GradationReverse == value) return;
|
||||
context.m_GradationReverse = m_GradationReverse = value;
|
||||
context.SetGradationDirty();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
|
||||
public DetailFilter detailFilter
|
||||
{
|
||||
get => m_DetailFilter;
|
||||
@@ -1287,6 +1329,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
if (m_DetailFilter == value) return;
|
||||
context.m_DetailFilter = m_DetailFilter = value;
|
||||
SetVerticesDirty();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
@@ -1316,11 +1359,11 @@ namespace Coffee.UIEffects
|
||||
|
||||
public Color detailColor
|
||||
{
|
||||
get => m_EdgeColor;
|
||||
get => m_DetailColor;
|
||||
set
|
||||
{
|
||||
if (m_EdgeColor == value) return;
|
||||
context.m_DetailColor = m_EdgeColor = value;
|
||||
if (m_DetailColor == value) return;
|
||||
context.m_DetailColor = m_DetailColor = value;
|
||||
SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
@@ -1438,6 +1481,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
(m_SrcBlendMode, m_DstBlendMode) = (m_BlendType, m_SrcBlendMode, m_DstBlendMode).Convert();
|
||||
context?.SetGradationDirty();
|
||||
context?.SetTransitionGradationDirty();
|
||||
base.OnValidate();
|
||||
}
|
||||
|
||||
@@ -1459,7 +1503,8 @@ namespace Coffee.UIEffects
|
||||
public override void SetVerticesDirty()
|
||||
{
|
||||
base.SetVerticesDirty();
|
||||
for (var i = 0; i < replicas.Count; i++)
|
||||
var count = replicas.Count;
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
if (!replicas[i]) continue;
|
||||
replicas[i].SetVerticesDirty();
|
||||
@@ -1469,7 +1514,8 @@ namespace Coffee.UIEffects
|
||||
public override void SetMaterialDirty()
|
||||
{
|
||||
base.SetMaterialDirty();
|
||||
for (var i = 0; i < replicas.Count; i++)
|
||||
var count = replicas.Count;
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
if (!replicas[i]) continue;
|
||||
replicas[i].SetMaterialDirty();
|
||||
@@ -1484,6 +1530,36 @@ namespace Coffee.UIEffects
|
||||
SetGradientKeys(gradient.colorKeys, gradient.alphaKeys, gradient.mode);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get gradation gradient's keys.
|
||||
/// </summary>
|
||||
public void GetGradientKeys(out GradientColorKey[] colorKeys, out GradientAlphaKey[] alphaKeys,
|
||||
out GradientMode mode)
|
||||
{
|
||||
colorKeys = m_GradationGradient?.colorKeys ?? Array.Empty<GradientColorKey>();
|
||||
alphaKeys = m_GradationGradient?.alphaKeys ?? Array.Empty<GradientAlphaKey>();
|
||||
mode = m_GradationGradient?.mode ?? GradientMode.Blend;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set transition gradient's keys.
|
||||
/// </summary>
|
||||
public void SetTransitionGradientKeys(Gradient gradient)
|
||||
{
|
||||
SetTransitionGradientKeys(gradient.colorKeys, gradient.alphaKeys, gradient.mode);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Get transition gradation gradient's keys.
|
||||
/// </summary>
|
||||
public void GetTransitionGradientKeys(out GradientColorKey[] colorKeys, out GradientAlphaKey[] alphaKeys,
|
||||
out GradientMode mode)
|
||||
{
|
||||
colorKeys = m_TransitionGradient?.colorKeys ?? Array.Empty<GradientColorKey>();
|
||||
alphaKeys = m_TransitionGradient?.alphaKeys ?? Array.Empty<GradientAlphaKey>();
|
||||
mode = m_TransitionGradient?.mode ?? GradientMode.Blend;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set gradation gradient's keys.
|
||||
/// </summary>
|
||||
@@ -1497,11 +1573,25 @@ namespace Coffee.UIEffects
|
||||
SetMaterialDirty();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Set transition gradient's keys.
|
||||
/// </summary>
|
||||
public void SetTransitionGradientKeys(GradientColorKey[] colorKeys, GradientAlphaKey[] alphaKeys,
|
||||
GradientMode mode = GradientMode.Blend)
|
||||
{
|
||||
m_TransitionGradient ??= new Gradient();
|
||||
m_TransitionGradient.SetKeys(colorKeys, alphaKeys);
|
||||
m_TransitionGradient.mode = mode;
|
||||
context?.SetTransitionGradationDirty();
|
||||
SetMaterialDirty();
|
||||
}
|
||||
|
||||
public override void ApplyContextToMaterial(Material material)
|
||||
{
|
||||
base.ApplyContextToMaterial(material);
|
||||
|
||||
for (var i = 0; i < replicas.Count; i++)
|
||||
var count = replicas.Count;
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
if (!replicas[i]) continue;
|
||||
replicas[i].ApplyContextToMaterial(material);
|
||||
@@ -1561,6 +1651,15 @@ namespace Coffee.UIEffects
|
||||
}
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
m_SamplingScale = 1;
|
||||
m_AllowToModifyMeshShape = true;
|
||||
m_CustomRoot = null;
|
||||
|
||||
LoadPreset(UIEffectPreset.GetDefaultPreset());
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Load preset settings.
|
||||
/// </summary>
|
||||
@@ -1649,6 +1748,7 @@ namespace Coffee.UIEffects
|
||||
dst.m_TransitionColorGlow = src.m_TransitionColorGlow;
|
||||
dst.m_TransitionPatternReverse = src.m_TransitionPatternReverse;
|
||||
dst.m_TransitionAutoPlaySpeed = src.m_TransitionAutoPlaySpeed;
|
||||
dst.SetTransitionGradientKeys(src.m_TransitionGradient);
|
||||
}
|
||||
|
||||
if (!append || src.m_TargetMode != TargetMode.None)
|
||||
@@ -1705,10 +1805,13 @@ namespace Coffee.UIEffects
|
||||
dst.m_GradationOffset = src.m_GradationOffset;
|
||||
dst.m_GradationScale = src.m_GradationScale;
|
||||
dst.m_GradationRotation = src.m_GradationRotation;
|
||||
dst.m_GradationWrapMode = src.m_GradationWrapMode;
|
||||
dst.m_GradationReverse = src.m_GradationReverse;
|
||||
}
|
||||
|
||||
if (!append || src.m_DetailFilter != DetailFilter.None)
|
||||
{
|
||||
dst.m_DetailColor = src.m_DetailColor;
|
||||
dst.m_DetailFilter = src.m_DetailFilter;
|
||||
dst.m_DetailIntensity = src.m_DetailIntensity;
|
||||
dst.m_DetailThreshold = src.m_DetailThreshold;
|
||||
@@ -1777,6 +1880,7 @@ namespace Coffee.UIEffects
|
||||
dst.m_TransitionColorGlow = src.m_TransitionColorGlow;
|
||||
dst.m_TransitionPatternReverse = src.m_TransitionPatternReverse;
|
||||
dst.m_TransitionAutoPlaySpeed = src.m_TransitionAutoPlaySpeed;
|
||||
dst.SetTransitionGradientKeys(src.m_TransitionGradient);
|
||||
}
|
||||
|
||||
if (!append || src.m_TargetMode != TargetMode.None)
|
||||
@@ -1833,6 +1937,8 @@ namespace Coffee.UIEffects
|
||||
dst.m_GradationOffset = src.m_GradationOffset;
|
||||
dst.m_GradationScale = src.m_GradationScale;
|
||||
dst.m_GradationRotation = src.m_GradationRotation;
|
||||
dst.m_GradationWrapMode = src.m_GradationWrapMode;
|
||||
dst.m_GradationReverse = src.m_GradationReverse;
|
||||
}
|
||||
|
||||
if (!append || src.m_DetailFilter != DetailFilter.None)
|
||||
@@ -1903,6 +2009,9 @@ namespace Coffee.UIEffects
|
||||
dst.m_TransitionColorGlow = src.m_TransitionColorGlow;
|
||||
dst.m_TransitionPatternReverse = src.m_TransitionPatternReverse;
|
||||
dst.m_TransitionAutoPlaySpeed = src.m_TransitionAutoPlaySpeed;
|
||||
dst.m_TransitionGradient.SetKeys(src.m_TransitionGradient.colorKeys,
|
||||
src.m_TransitionGradient.alphaKeys);
|
||||
dst.m_TransitionGradient.mode = src.m_TransitionGradient.mode;
|
||||
}
|
||||
|
||||
if (!append || src.m_TargetMode != TargetMode.None)
|
||||
@@ -1960,6 +2069,8 @@ namespace Coffee.UIEffects
|
||||
dst.m_GradationOffset = src.m_GradationOffset;
|
||||
dst.m_GradationScale = src.m_GradationScale;
|
||||
dst.m_GradationRotation = src.m_GradationRotation;
|
||||
dst.m_GradationWrapMode = src.m_GradationWrapMode;
|
||||
dst.m_GradationReverse = src.m_GradationReverse;
|
||||
}
|
||||
|
||||
if (!append || src.m_DetailFilter != DetailFilter.None)
|
||||
@@ -2014,6 +2125,7 @@ namespace Coffee.UIEffects
|
||||
dst.m_TransitionColorGlow = src.m_TransitionColorGlow;
|
||||
dst.m_TransitionPatternReverse = src.m_TransitionPatternReverse;
|
||||
dst.m_TransitionAutoPlaySpeed = src.m_TransitionAutoPlaySpeed;
|
||||
dst.m_TransitionGradient = src.m_TransitionGradient;
|
||||
|
||||
dst.m_TargetMode = src.m_TargetMode;
|
||||
dst.m_TargetColor = src.m_TargetColor;
|
||||
@@ -2054,6 +2166,8 @@ namespace Coffee.UIEffects
|
||||
dst.m_GradationOffset = src.m_GradationOffset;
|
||||
dst.m_GradationScale = src.m_GradationScale;
|
||||
dst.m_GradationRotation = src.m_GradationRotation;
|
||||
dst.m_GradationWrapMode = src.m_GradationWrapMode;
|
||||
dst.m_GradationReverse = src.m_GradationReverse;
|
||||
|
||||
dst.m_DetailFilter = src.m_DetailFilter;
|
||||
dst.m_DetailIntensity = src.m_DetailIntensity;
|
||||
|
||||
@@ -6,6 +6,9 @@ using UnityEngine.EventSystems;
|
||||
using UnityEngine.Profiling;
|
||||
using UnityEngine.UI;
|
||||
using UnityEditor;
|
||||
#if TIMELINE_ENABLE
|
||||
using UnityEngine.Timeline;
|
||||
#endif
|
||||
|
||||
[assembly: InternalsVisibleTo("UIEffect")]
|
||||
[assembly: InternalsVisibleTo("Coffee.UIEffect.Editor")]
|
||||
@@ -15,6 +18,9 @@ namespace Coffee.UIEffects
|
||||
[ExecuteAlways]
|
||||
[DisallowMultipleComponent]
|
||||
public abstract class UIEffectBase : UIBehaviour, IMeshModifier, IMaterialModifier, ICanvasRaycastFilter
|
||||
#if TIMELINE_ENABLE
|
||||
, ITimeControl
|
||||
#endif
|
||||
{
|
||||
private static readonly InternalObjectPool<UIEffectContext> s_ContextPool =
|
||||
new InternalObjectPool<UIEffectContext>(() => new UIEffectContext(), x => true, x => x.Reset());
|
||||
@@ -26,13 +32,33 @@ namespace Coffee.UIEffects
|
||||
private Action _onAfterCanvasRebuild;
|
||||
private bool _canModifyMesh;
|
||||
private Matrix4x4 _prevTransformHash;
|
||||
private Canvas _canvas;
|
||||
private bool _canvasCached = false;
|
||||
|
||||
public Material effectMaterial => _material;
|
||||
public Graphic graphic => _graphic ? _graphic : _graphic = GetComponent<Graphic>();
|
||||
public virtual uint effectId => (uint)GetInstanceID();
|
||||
public virtual uint effectId => (uint)GetHashCode();
|
||||
public virtual float actualSamplingScale => 1;
|
||||
public virtual bool canModifyShape => true;
|
||||
|
||||
protected Canvas canvas
|
||||
{
|
||||
get
|
||||
{
|
||||
if (_canvasCached) return _canvas;
|
||||
|
||||
_canvasCached = true;
|
||||
_canvas = GetComponentInParent<Canvas>();
|
||||
if (!_canvas || !_canvas.isActiveAndEnabled)
|
||||
{
|
||||
_canvas = null;
|
||||
_canvasCached = false;
|
||||
}
|
||||
|
||||
return _canvas;
|
||||
}
|
||||
}
|
||||
|
||||
public virtual UIEffectContext context
|
||||
{
|
||||
get
|
||||
@@ -64,6 +90,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
protected override void OnEnable()
|
||||
{
|
||||
_canModifyMesh = true;
|
||||
_onBeforeCanvasRebuild ??= OnBeforeCanvasRebuild;
|
||||
_onAfterCanvasRebuild ??= OnAfterCanvasRebuild;
|
||||
UIExtraCallbacks.onBeforeCanvasRebuild += _onBeforeCanvasRebuild;
|
||||
@@ -97,19 +124,28 @@ namespace Coffee.UIEffects
|
||||
s_ContextPool.Return(ref _context);
|
||||
}
|
||||
|
||||
protected virtual void OnBeforeCanvasRebuild()
|
||||
private void OnBeforeCanvasRebuild()
|
||||
{
|
||||
// If the mesh is not modified in the previous frame, try to modify it if possible.
|
||||
if (!_canModifyMesh && CanModifyMesh())
|
||||
{
|
||||
_canModifyMesh = true;
|
||||
SetVerticesDirty();
|
||||
}
|
||||
}
|
||||
|
||||
protected virtual void OnAfterCanvasRebuild()
|
||||
private void OnAfterCanvasRebuild()
|
||||
{
|
||||
if (!_material || !graphic || !graphic.canvas || context == null) return;
|
||||
if (!_material || !graphic || !canvas || context == null) return;
|
||||
if (!context.useViewMatrix) return;
|
||||
|
||||
context.UpdateViewMatrix(GetCurrentMaterial(), transitionRoot, graphic.canvas.rootCanvas);
|
||||
context.UpdateViewMatrix(GetCurrentMaterial(), transitionRoot, canvas.rootCanvas);
|
||||
}
|
||||
|
||||
protected override void OnCanvasHierarchyChanged()
|
||||
{
|
||||
_canvasCached = false;
|
||||
_canvas = null;
|
||||
}
|
||||
|
||||
public void ModifyMesh(Mesh mesh)
|
||||
@@ -123,12 +159,15 @@ namespace Coffee.UIEffects
|
||||
_canModifyMesh = CanModifyMesh();
|
||||
if (_canModifyMesh)
|
||||
{
|
||||
context.ModifyMesh(graphic, transitionRoot, vh, canModifyShape);
|
||||
context.ModifyMesh(graphic, canvas, transitionRoot, vh, canModifyShape);
|
||||
}
|
||||
}
|
||||
|
||||
private bool CanModifyMesh()
|
||||
{
|
||||
if (!graphic || !graphic.isActiveAndEnabled) return false;
|
||||
if (!isActiveAndEnabled) return false;
|
||||
|
||||
// The transitionRoot is same as the transform => true.
|
||||
var root = transitionRoot;
|
||||
if (transform == root) return true;
|
||||
@@ -149,8 +188,8 @@ namespace Coffee.UIEffects
|
||||
|
||||
Profiler.BeginSample("(UIE)[UIEffect] GetModifiedMaterial");
|
||||
var samplingScaleId = (uint)(Mathf.InverseLerp(0.01f, 100, actualSamplingScale) * uint.MaxValue);
|
||||
var rootId = (uint)(transitionRoot ? transitionRoot.GetInstanceID() : 0);
|
||||
var hash = new Hash128((uint)baseMaterial.GetInstanceID(), effectId, samplingScaleId, rootId);
|
||||
var rootId = (uint)(transitionRoot ? transitionRoot.GetHashCode() : 0);
|
||||
var hash = new Hash128((uint)baseMaterial.GetHashCode(), effectId, samplingScaleId, rootId);
|
||||
if (!MaterialRepository.Valid(hash, _material))
|
||||
{
|
||||
Profiler.BeginSample("(UIE)[UIEffect] GetModifiedMaterial > Get or create material");
|
||||
@@ -249,5 +288,25 @@ namespace Coffee.UIEffects
|
||||
|
||||
public abstract void SetRate(float rate, UIEffectTweener.CullingMask cullingMask);
|
||||
public abstract bool IsRaycastLocationValid(Vector2 sp, Camera eventCamera);
|
||||
|
||||
public void SetTime(double _)
|
||||
{
|
||||
}
|
||||
|
||||
public void OnControlTimeStart()
|
||||
{
|
||||
if (this)
|
||||
{
|
||||
enabled = true;
|
||||
}
|
||||
}
|
||||
|
||||
public void OnControlTimeStop()
|
||||
{
|
||||
if (this)
|
||||
{
|
||||
enabled = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@ using UnityEngine.UI;
|
||||
|
||||
namespace Coffee.UIEffects
|
||||
{
|
||||
public class UIEffectContext
|
||||
public sealed class UIEffectContext
|
||||
{
|
||||
private static readonly UIEffectContext s_DefaultContext = new UIEffectContext();
|
||||
private static readonly List<UIVertex> s_WorkingVertices = new List<UIVertex>(1024 * 8);
|
||||
@@ -35,6 +35,7 @@ namespace Coffee.UIEffects
|
||||
private static readonly int s_TransitionColorGlow = Shader.PropertyToID("_TransitionColorGlow");
|
||||
private static readonly int s_TransitionPatternReverse = Shader.PropertyToID("_TransitionPatternReverse");
|
||||
private static readonly int s_TransitionAutoPlaySpeed = Shader.PropertyToID("_TransitionAutoPlaySpeed");
|
||||
private static readonly int s_TransitionGradientTex = Shader.PropertyToID("_TransitionGradientTex");
|
||||
private static readonly int s_TargetColor = Shader.PropertyToID("_TargetColor");
|
||||
private static readonly int s_TargetRange = Shader.PropertyToID("_TargetRange");
|
||||
private static readonly int s_TargetSoftness = Shader.PropertyToID("_TargetSoftness");
|
||||
@@ -64,6 +65,7 @@ namespace Coffee.UIEffects
|
||||
private static readonly int s_GradationColor4 = Shader.PropertyToID("_GradationColor4");
|
||||
private static readonly int s_GradationTex = Shader.PropertyToID("_GradationTex");
|
||||
private static readonly int s_GradationTex_ST = Shader.PropertyToID("_GradationTex_ST");
|
||||
private static readonly int s_GradationRadial = Shader.PropertyToID("_GradationRadial");
|
||||
private static readonly int s_RootViewMatrix = Shader.PropertyToID("_RootViewMatrix");
|
||||
private static readonly int s_GradViewMatrix = Shader.PropertyToID("_GradViewMatrix");
|
||||
private static readonly int s_MirrorRootViewMatrix = Shader.PropertyToID("_MirrorRootViewMatrix");
|
||||
@@ -108,7 +110,8 @@ namespace Coffee.UIEffects
|
||||
"TRANSITION_MASK",
|
||||
"TRANSITION_MELT",
|
||||
"TRANSITION_BURN",
|
||||
"TRANSITION_PATTERN"
|
||||
"TRANSITION_PATTERN",
|
||||
"TRANSITION_BLAZE"
|
||||
};
|
||||
|
||||
private static readonly string[] s_TargetKeywords =
|
||||
@@ -140,7 +143,6 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
"",
|
||||
"GRADATION_GRADIENT",
|
||||
"GRADATION_RADIAL",
|
||||
"GRADATION_COLOR2",
|
||||
"GRADATION_COLOR4"
|
||||
};
|
||||
@@ -188,6 +190,7 @@ namespace Coffee.UIEffects
|
||||
public bool m_TransitionColorGlow;
|
||||
public bool m_TransitionPatternReverse;
|
||||
public float m_TransitionAutoPlaySpeed;
|
||||
public Gradient m_TransitionGradient;
|
||||
|
||||
public TargetMode m_TargetMode;
|
||||
public Color m_TargetColor;
|
||||
@@ -228,6 +231,8 @@ namespace Coffee.UIEffects
|
||||
public float m_GradationOffset;
|
||||
public float m_GradationScale;
|
||||
public float m_GradationRotation;
|
||||
public TextureWrapMode m_GradationWrapMode;
|
||||
public bool m_GradationReverse;
|
||||
|
||||
public DetailFilter m_DetailFilter;
|
||||
public float m_DetailIntensity;
|
||||
@@ -253,14 +258,21 @@ namespace Coffee.UIEffects
|
||||
|
||||
public bool willModifyVertex => willModifyMaterial;
|
||||
|
||||
public bool useViewMatrix => m_TransitionFilter != TransitionFilter.None
|
||||
|| m_GradationMode != GradationMode.None
|
||||
|| m_DetailFilter != DetailFilter.None
|
||||
|| m_EdgeMode == EdgeMode.Shiny;
|
||||
|
||||
private Texture2D _gradationRampTex;
|
||||
private Texture2D _transitionRampTex;
|
||||
private bool _isGradientDirty = true;
|
||||
private static readonly Color32[] s_Colors = new Color32[256];
|
||||
private bool _isTransitionGradientDirty = true;
|
||||
private static readonly Color[] s_Colors = new Color[256];
|
||||
|
||||
private static readonly InternalObjectPool<Texture2D> s_TexturePool = new InternalObjectPool<Texture2D>(
|
||||
() =>
|
||||
{
|
||||
var texture = new Texture2D(s_Colors.Length, 1, TextureFormat.RGBA32, false, false)
|
||||
var texture = new Texture2D(s_Colors.Length, 1, TextureFormat.RGBAFloat, false, false)
|
||||
{
|
||||
name = "GradationRamp",
|
||||
hideFlags = HideFlags.DontSave,
|
||||
@@ -285,22 +297,55 @@ namespace Coffee.UIEffects
|
||||
var w = s_Colors.Length;
|
||||
for (var i = 0; i < w; i++)
|
||||
{
|
||||
s_Colors[i] = m_GradationGradient.Evaluate((float)i / (w - 1));
|
||||
var x = m_GradationReverse ? w - 1 - i : i;
|
||||
var t = (float)i / (w - 1);
|
||||
s_Colors[x] = ApplyColorSpace(m_GradationGradient.Evaluate(t));
|
||||
}
|
||||
|
||||
_gradationRampTex.wrapMode = m_GradationWrapMode;
|
||||
_gradationRampTex.filterMode = m_GradationGradient.mode == GradientMode.Blend
|
||||
? FilterMode.Bilinear
|
||||
: FilterMode.Point;
|
||||
_gradationRampTex.SetPixels32(s_Colors);
|
||||
_gradationRampTex.SetPixels(s_Colors);
|
||||
_gradationRampTex.Apply();
|
||||
return _gradationRampTex;
|
||||
}
|
||||
}
|
||||
|
||||
private Texture2D transitionRampTex
|
||||
{
|
||||
get
|
||||
{
|
||||
if (m_TransitionGradient == null) return null;
|
||||
if (!_transitionRampTex) _transitionRampTex = s_TexturePool.Rent();
|
||||
if (!_isTransitionGradientDirty) return _transitionRampTex;
|
||||
_isTransitionGradientDirty = false;
|
||||
|
||||
var w = s_Colors.Length;
|
||||
for (var i = 0; i < w; i++)
|
||||
{
|
||||
var t = (float)i / (w - 1);
|
||||
s_Colors[i] = ApplyColorSpace(m_TransitionGradient.Evaluate(t));
|
||||
}
|
||||
|
||||
s_Colors[w - 1].a = 0;
|
||||
|
||||
_transitionRampTex.wrapMode = TextureWrapMode.Clamp;
|
||||
_transitionRampTex.filterMode = m_TransitionGradient.mode == GradientMode.Blend
|
||||
? FilterMode.Bilinear
|
||||
: FilterMode.Point;
|
||||
_transitionRampTex.SetPixels(s_Colors);
|
||||
_transitionRampTex.Apply();
|
||||
return _transitionRampTex;
|
||||
}
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
_isGradientDirty = true;
|
||||
_isTransitionGradientDirty = true;
|
||||
s_TexturePool.Return(ref _gradationRampTex);
|
||||
s_TexturePool.Return(ref _transitionRampTex);
|
||||
CopyFrom(s_DefaultContext);
|
||||
}
|
||||
|
||||
@@ -336,6 +381,7 @@ namespace Coffee.UIEffects
|
||||
dst.m_TransitionColorGlow = src.m_TransitionColorGlow;
|
||||
dst.m_TransitionPatternReverse = src.m_TransitionPatternReverse;
|
||||
dst.m_TransitionAutoPlaySpeed = src.m_TransitionAutoPlaySpeed;
|
||||
dst.m_TransitionGradient = src.m_TransitionGradient;
|
||||
|
||||
dst.m_TargetMode = src.m_TargetMode;
|
||||
dst.m_TargetColor = src.m_TargetColor;
|
||||
@@ -376,6 +422,8 @@ namespace Coffee.UIEffects
|
||||
dst.m_GradationScale = src.m_GradationScale;
|
||||
dst.m_GradationOffset = src.m_GradationOffset;
|
||||
dst.m_GradationRotation = src.m_GradationRotation;
|
||||
dst.m_GradationWrapMode = src.m_GradationWrapMode;
|
||||
dst.m_GradationReverse = src.m_GradationReverse;
|
||||
|
||||
dst.m_DetailFilter = src.m_DetailFilter;
|
||||
dst.m_DetailIntensity = src.m_DetailIntensity;
|
||||
@@ -394,11 +442,16 @@ namespace Coffee.UIEffects
|
||||
_isGradientDirty = true;
|
||||
}
|
||||
|
||||
public void SetTransitionGradationDirty()
|
||||
{
|
||||
_isTransitionGradientDirty = true;
|
||||
}
|
||||
|
||||
public void ApplyToMaterial(Material material, float actualSamplingScale = 1f)
|
||||
{
|
||||
if (!material) return;
|
||||
|
||||
Profiler.BeginSample("(UIE)[UIEffect] GetModifiedMaterial");
|
||||
Profiler.BeginSample("(UIE)[UIEffect] ApplyToMaterial");
|
||||
|
||||
material.SetInt(s_SrcBlend, (int)m_SrcBlendMode);
|
||||
material.SetInt(s_DstBlend, (int)m_DstBlendMode);
|
||||
@@ -406,7 +459,7 @@ namespace Coffee.UIEffects
|
||||
material.SetFloat(s_ToneIntensity, Mathf.Clamp01(m_ToneIntensity));
|
||||
|
||||
material.SetInt(s_ColorFilter, (int)m_ColorFilter);
|
||||
material.SetColor(s_ColorValue, m_Color);
|
||||
material.SetColor(s_ColorValue, ApplyColorSpace(m_Color));
|
||||
material.SetFloat(s_ColorIntensity, Mathf.Clamp01(m_ColorIntensity));
|
||||
material.SetInt(s_ColorGlow, m_ColorGlow ? 1 : 0);
|
||||
|
||||
@@ -425,12 +478,14 @@ namespace Coffee.UIEffects
|
||||
material.SetFloat(s_TransitionSoftness, Mathf.Clamp01(m_TransitionSoftness));
|
||||
material.SetVector(s_TransitionRange, new Vector2(m_TransitionRange.min, m_TransitionRange.max));
|
||||
material.SetInt(s_TransitionColorFilter, (int)m_TransitionColorFilter);
|
||||
material.SetColor(s_TransitionColor, m_TransitionColor);
|
||||
material.SetColor(s_TransitionColor, ApplyColorSpace(m_TransitionColor));
|
||||
material.SetInt(s_TransitionColorGlow, m_TransitionColorGlow ? 1 : 0);
|
||||
material.SetInt(s_TransitionPatternReverse, m_TransitionPatternReverse ? 1 : 0);
|
||||
material.SetFloat(s_TransitionAutoPlaySpeed, m_TransitionAutoPlaySpeed);
|
||||
material.SetTexture(s_TransitionGradientTex,
|
||||
m_TransitionFilter == TransitionFilter.Blaze ? transitionRampTex : null);
|
||||
|
||||
material.SetColor(s_TargetColor, m_TargetColor);
|
||||
material.SetColor(s_TargetColor, ApplyColorSpace(m_TargetColor));
|
||||
material.SetFloat(s_TargetRange, Mathf.Clamp01(m_TargetRange));
|
||||
material.SetFloat(s_TargetSoftness, Mathf.Clamp01(m_TargetSoftness));
|
||||
|
||||
@@ -447,12 +502,12 @@ namespace Coffee.UIEffects
|
||||
}
|
||||
|
||||
material.SetInt(s_ShadowColorFilter, (int)m_ShadowColorFilter);
|
||||
material.SetColor(s_ShadowColor, m_ShadowColor);
|
||||
material.SetColor(s_ShadowColor, ApplyColorSpace(m_ShadowColor));
|
||||
material.SetInt(s_ShadowColorGlow, m_ShadowColorGlow ? 1 : 0);
|
||||
|
||||
material.SetFloat(s_EdgeWidth, Mathf.Clamp01(m_EdgeWidth));
|
||||
material.SetInt(s_EdgeColorFilter, (int)m_EdgeColorFilter);
|
||||
material.SetColor(s_EdgeColor, m_EdgeColor);
|
||||
material.SetColor(s_EdgeColor, ApplyColorSpace(m_EdgeColor));
|
||||
material.SetInt(s_EdgeColorGlow, m_EdgeColorGlow ? 1 : 0);
|
||||
material.SetFloat(s_EdgeShinyRate, Mathf.Clamp01(m_EdgeShinyRate));
|
||||
material.SetFloat(s_EdgeShinyWidth, Mathf.Clamp01(m_EdgeShinyWidth));
|
||||
@@ -464,13 +519,18 @@ namespace Coffee.UIEffects
|
||||
|
||||
material.SetFloat(s_GradationIntensity, m_GradationIntensity);
|
||||
material.SetInt(s_GradationColorFilter, (int)m_GradationColorFilter);
|
||||
material.SetColor(s_GradationColor1, m_GradationColor1);
|
||||
material.SetColor(s_GradationColor2, m_GradationColor2);
|
||||
material.SetColor(s_GradationColor3, m_GradationColor3);
|
||||
material.SetColor(s_GradationColor4, m_GradationColor4);
|
||||
material.SetColor(s_GradationColor1, ApplyColorSpace(m_GradationColor1));
|
||||
material.SetColor(s_GradationColor2, ApplyColorSpace(m_GradationColor2));
|
||||
material.SetColor(s_GradationColor3, ApplyColorSpace(m_GradationColor3));
|
||||
material.SetColor(s_GradationColor4, ApplyColorSpace(m_GradationColor4));
|
||||
material.SetInt(s_GradationRadial, m_GradationMode == GradationMode.Radial
|
||||
#pragma warning disable CS0612 // Type or member is obsolete
|
||||
|| m_GradationMode == GradationMode.RadialDetail
|
||||
#pragma warning restore CS0612
|
||||
|| m_GradationMode == GradationMode.RadialGradient ? 1 : 0);
|
||||
|
||||
material.SetFloat(s_DetailIntensity, Mathf.Clamp01(m_DetailIntensity));
|
||||
material.SetColor(s_DetailColor, m_DetailColor);
|
||||
material.SetColor(s_DetailColor, ApplyColorSpace(m_DetailColor));
|
||||
material.SetVector(s_DetailThreshold, new Vector2(m_DetailThreshold.min, m_DetailThreshold.max));
|
||||
material.SetTexture(s_DetailTex, m_DetailFilter != 0 ? m_DetailTex : null);
|
||||
material.SetVector(s_DetailTex_ST,
|
||||
@@ -494,21 +554,22 @@ namespace Coffee.UIEffects
|
||||
case GradationMode.HorizontalGradient:
|
||||
case GradationMode.VerticalGradient:
|
||||
case GradationMode.AngleGradient:
|
||||
case GradationMode.RadialGradient:
|
||||
SetKeyword(material, s_GradationKeywords, 1);
|
||||
break;
|
||||
case GradationMode.RadialFast:
|
||||
case GradationMode.RadialDetail:
|
||||
SetKeyword(material, s_GradationKeywords, 2);
|
||||
break;
|
||||
case GradationMode.Horizontal:
|
||||
case GradationMode.Vertical:
|
||||
case GradationMode.DiagonalToRightBottom:
|
||||
case GradationMode.DiagonalToLeftBottom:
|
||||
case GradationMode.Angle:
|
||||
SetKeyword(material, s_GradationKeywords, 3);
|
||||
case GradationMode.Radial:
|
||||
#pragma warning disable CS0612 // Type or member is obsolete
|
||||
case GradationMode.RadialDetail:
|
||||
#pragma warning restore CS0612
|
||||
SetKeyword(material, s_GradationKeywords, 2);
|
||||
break;
|
||||
case GradationMode.Diagonal:
|
||||
SetKeyword(material, s_GradationKeywords, 4);
|
||||
SetKeyword(material, s_GradationKeywords, 3);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -541,16 +602,17 @@ namespace Coffee.UIEffects
|
||||
scale.y = 0 != (m_Flip & Flip.Vertical) ? -scale.y : scale.y;
|
||||
}
|
||||
|
||||
var pivot = new Vector2(0.5f, 0.5f);
|
||||
var offset = (transitionRoot.pivot - pivot) * size;
|
||||
var pivot = new Vector3(0.5f, 0.5f);
|
||||
var offset = (transitionRoot.pivot - (Vector2)pivot) * size;
|
||||
var w2LMat = Matrix4x4.Translate(offset) * transitionRoot.worldToLocalMatrix;
|
||||
|
||||
var rootRotation = Quaternion.Euler(0, 0, m_TransitionRotation);
|
||||
var rootScale = 1f / GetMultiplier(m_TransitionRotation);
|
||||
material.SetMatrix(s_RootViewMatrix, Matrix4x4.TRS(pivot, rootRotation, scale * rootScale) * w2LMat);
|
||||
|
||||
var gradRotation = Quaternion.Euler(0, 0, GetGradationRotation());
|
||||
var gradScale = 1f / GetMultiplier(GetGradationRotation());
|
||||
var rotation = GetGradationRotation();
|
||||
var gradRotation = Quaternion.Euler(0, 0, rotation);
|
||||
var gradScale = 1f / GetMultiplier(rotation);
|
||||
material.SetMatrix(s_GradViewMatrix, Matrix4x4.TRS(pivot, gradRotation, scale * gradScale) * w2LMat);
|
||||
|
||||
if (m_ShadowMode == ShadowMode.Mirror)
|
||||
@@ -559,22 +621,25 @@ namespace Coffee.UIEffects
|
||||
var mirrorOffset = new Vector3(0, size.y / 2 * (mirrorInv + 1) - m_ShadowDistance.y * mirrorInv, 0);
|
||||
var mirrorScale = new Vector3(1, mirrorInv, 1);
|
||||
var udScale = new Vector3(scale.x, -scale.y, scale.z);
|
||||
material.SetMatrix(s_MirrorRootViewMatrix,
|
||||
Matrix4x4.TRS(pivot, rootRotation, udScale * rootScale)
|
||||
* Matrix4x4.TRS(mirrorOffset, Quaternion.identity, mirrorScale) * w2LMat);
|
||||
material.SetMatrix(s_MirrorGradViewMatrix,
|
||||
Matrix4x4.TRS(pivot, gradRotation, udScale * gradScale)
|
||||
* Matrix4x4.TRS(mirrorOffset, Quaternion.identity, mirrorScale) * w2LMat);
|
||||
var mirrorTranslation = Matrix4x4.TRS(mirrorOffset, Quaternion.identity, mirrorScale) * w2LMat;
|
||||
material.SetMatrix(
|
||||
s_MirrorRootViewMatrix,
|
||||
Matrix4x4.TRS(pivot, rootRotation, udScale * rootScale) * mirrorTranslation
|
||||
);
|
||||
material.SetMatrix(
|
||||
s_MirrorGradViewMatrix,
|
||||
Matrix4x4.TRS(pivot, gradRotation, udScale * gradScale) * mirrorTranslation
|
||||
);
|
||||
}
|
||||
|
||||
if (canvas.renderMode == RenderMode.ScreenSpaceOverlay || !canvas.worldCamera)
|
||||
{
|
||||
material.SetMatrix(s_CanvasToWorldMatrix, canvas.transform.localToWorldMatrix);
|
||||
}
|
||||
else
|
||||
{
|
||||
material.SetMatrix(s_CanvasToWorldMatrix, Matrix4x4.identity);
|
||||
}
|
||||
var useIdentity =
|
||||
canvas.renderMode == RenderMode.WorldSpace ||
|
||||
(canvas.renderMode != RenderMode.ScreenSpaceOverlay && canvas.worldCamera);
|
||||
|
||||
material.SetMatrix(
|
||||
s_CanvasToWorldMatrix,
|
||||
useIdentity ? Matrix4x4.identity : canvas.transform.localToWorldMatrix
|
||||
);
|
||||
}
|
||||
|
||||
private Vector4 GetGradationScaleAndOffset()
|
||||
@@ -586,8 +651,10 @@ namespace Coffee.UIEffects
|
||||
case GradationMode.VerticalGradient:
|
||||
case GradationMode.AngleGradient:
|
||||
return new Vector4(gScale, 1, -0.5f * (gScale + 1) - m_GradationOffset, 0);
|
||||
case GradationMode.RadialFast:
|
||||
case GradationMode.Radial:
|
||||
#pragma warning disable CS0612 // Type or member is obsolete
|
||||
case GradationMode.RadialDetail:
|
||||
#pragma warning restore CS0612
|
||||
{
|
||||
return new Vector4(gScale, 1, m_GradationOffset, 0);
|
||||
}
|
||||
@@ -624,22 +691,27 @@ namespace Coffee.UIEffects
|
||||
return Mathf.Max(Mathf.Abs(cos - sin), Mathf.Abs(cos + sin));
|
||||
}
|
||||
|
||||
#if UNITY_2021_2_OR_NEWER
|
||||
private static void SetKeyword(Material material, Span<string> keywords, int index)
|
||||
#else
|
||||
private static void SetKeyword(Material material, string[] keywords, int index)
|
||||
#endif
|
||||
{
|
||||
for (var i = 0; i < keywords.Length; i++)
|
||||
var length = keywords.Length;
|
||||
if (index < length && !string.IsNullOrEmpty(keywords[index]))
|
||||
{
|
||||
if (i != index)
|
||||
{
|
||||
material.DisableKeyword(keywords[i]);
|
||||
}
|
||||
else if (!string.IsNullOrEmpty(keywords[i]))
|
||||
{
|
||||
material.EnableKeyword(keywords[i]);
|
||||
}
|
||||
material.EnableKeyword(keywords[index]);
|
||||
}
|
||||
|
||||
for (var i = 0; i < length; i++)
|
||||
{
|
||||
if (i == index) continue;
|
||||
material.DisableKeyword(keywords[i]);
|
||||
}
|
||||
}
|
||||
|
||||
public void ModifyMesh(Graphic graphic, RectTransform transitionRoot, VertexHelper vh, bool canModifyShape)
|
||||
public void ModifyMesh(Graphic graphic, Canvas canvas, RectTransform transitionRoot, VertexHelper vh,
|
||||
bool canModifyShape)
|
||||
{
|
||||
// Apply flip (without effect).
|
||||
ApplyFlipWithoutEffect(vh, m_Flip);
|
||||
@@ -649,7 +721,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
var effectProxy = GraphicProxy.Find(graphic);
|
||||
var isText = effectProxy.IsText(graphic);
|
||||
effectProxy.OnPreModifyMesh(graphic);
|
||||
effectProxy.OnPreModifyMesh(graphic, canvas);
|
||||
|
||||
var verts = s_WorkingVertices;
|
||||
var expandSize = effectProxy.ModifyExpandSize(graphic, GetExpandSize(canModifyShape));
|
||||
@@ -772,5 +844,10 @@ namespace Coffee.UIEffects
|
||||
|
||||
return expandSize;
|
||||
}
|
||||
|
||||
private static Color ApplyColorSpace(Color color)
|
||||
{
|
||||
return QualitySettings.activeColorSpace == ColorSpace.Linear ? color.linear : color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,6 +8,19 @@ namespace Coffee.UIEffects
|
||||
[ExecuteAlways]
|
||||
public class UIEffectPreset : ScriptableObject
|
||||
{
|
||||
internal static UIEffectPreset s_DefaultPreset;
|
||||
|
||||
internal static UIEffectPreset GetDefaultPreset()
|
||||
{
|
||||
if (!s_DefaultPreset)
|
||||
{
|
||||
s_DefaultPreset = CreateInstance<UIEffectPreset>();
|
||||
s_DefaultPreset.hideFlags = HideFlags.HideAndDontSave;
|
||||
}
|
||||
|
||||
return s_DefaultPreset;
|
||||
}
|
||||
|
||||
public ToneFilter m_ToneFilter = ToneFilter.None;
|
||||
[Range(0, 1)] public float m_ToneIntensity = 1;
|
||||
|
||||
@@ -37,6 +50,7 @@ namespace Coffee.UIEffects
|
||||
public bool m_TransitionColorGlow = false;
|
||||
public bool m_TransitionPatternReverse = false;
|
||||
[Range(-5, 5)] public float m_TransitionAutoPlaySpeed = 0f;
|
||||
public Gradient m_TransitionGradient = new Gradient();
|
||||
|
||||
public TargetMode m_TargetMode = TargetMode.None;
|
||||
public Color m_TargetColor = Color.white;
|
||||
@@ -68,6 +82,8 @@ namespace Coffee.UIEffects
|
||||
[Range(-1, 1)] public float m_GradationOffset = 0;
|
||||
[PowerRange(0.01f, 10, 10)] public float m_GradationScale = 1;
|
||||
[Range(0, 360)] public float m_GradationRotation = 0;
|
||||
public TextureWrapMode m_GradationWrapMode = TextureWrapMode.Repeat;
|
||||
public bool m_GradationReverse;
|
||||
|
||||
public EdgeMode m_EdgeMode = EdgeMode.None;
|
||||
[Range(0, 1)] public float m_EdgeWidth = 0.5f;
|
||||
@@ -122,6 +138,7 @@ namespace Coffee.UIEffects
|
||||
dst.m_TransitionColorGlow = src.m_TransitionColorGlow;
|
||||
dst.m_TransitionPatternReverse = src.m_TransitionPatternReverse;
|
||||
dst.m_TransitionAutoPlaySpeed = src.m_TransitionAutoPlaySpeed;
|
||||
dst.m_TransitionGradient = src.m_TransitionGradient;
|
||||
|
||||
dst.m_TargetMode = src.m_TargetMode;
|
||||
dst.m_TargetColor = src.m_TargetColor;
|
||||
@@ -162,6 +179,8 @@ namespace Coffee.UIEffects
|
||||
dst.m_GradationOffset = src.m_GradationOffset;
|
||||
dst.m_GradationScale = src.m_GradationScale;
|
||||
dst.m_GradationRotation = src.m_GradationRotation;
|
||||
dst.m_GradationWrapMode = src.m_GradationWrapMode;
|
||||
dst.m_GradationReverse = src.m_GradationReverse;
|
||||
|
||||
dst.m_DetailFilter = src.m_DetailFilter;
|
||||
dst.m_DetailIntensity = src.m_DetailIntensity;
|
||||
|
||||
@@ -91,12 +91,12 @@ namespace Coffee.UIEffects
|
||||
[InitializeOnLoadMethod]
|
||||
private static void InitializeOnLoadMethod()
|
||||
{
|
||||
#if UNITY_2023_2_OR_NEWER
|
||||
#if !LEGACY_TMP_ENABLE
|
||||
const string tmpSupport = "TextMeshPro Support (Unity 6)";
|
||||
const string version = "v5.8.0 (Unity 6)";
|
||||
const string version = "v5.9.0 (Unity 6)";
|
||||
#else
|
||||
const string tmpSupport = "TextMeshPro Support";
|
||||
const string version = "v5.8.0";
|
||||
const string version = "v5.9.0";
|
||||
#endif
|
||||
ShaderSampleImporter.RegisterShaderSamples(new[]
|
||||
{
|
||||
@@ -111,8 +111,8 @@ namespace Coffee.UIEffects
|
||||
("Hidden/TextMeshPro/Mobile/Distance Field (UIEffect)", tmpSupport, version),
|
||||
|
||||
// ShaderGraph Support
|
||||
("Shader Graphs/UISample (UIEffect)", "ShaderGraph Support (Unity 6 BuiltIn)", "v5.8.0"),
|
||||
("Shader Graphs/UISampleURP (UIEffect)", "ShaderGraph Support (Unity 6 URP)", "v5.8.0")
|
||||
("Shader Graphs/UISample (UIEffect)", "ShaderGraph Support (Unity 6 BuiltIn)", "v5.9.0"),
|
||||
("Shader Graphs/UISampleURP (UIEffect)", "ShaderGraph Support (Unity 6 URP)", "v5.9.0")
|
||||
});
|
||||
ShaderSampleImporter.RegisterShaderAliases(new[]
|
||||
{
|
||||
@@ -191,6 +191,15 @@ namespace Coffee.UIEffects
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Refresh all UI Graphics in the opened scenes. (#376)
|
||||
EditorApplication.delayCall += () =>
|
||||
{
|
||||
foreach (var g in Misc.FindObjectsOfType<UnityEngine.UI.Graphic>())
|
||||
{
|
||||
g.SetAllDirty();
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -99,7 +99,12 @@ namespace Coffee.UIEffects
|
||||
|
||||
public override bool canModifyShape => m_AllowToModifyMeshShape;
|
||||
|
||||
public override uint effectId => target ? target.effectId : 0;
|
||||
public override uint effectId => target
|
||||
? target.effectId
|
||||
: preset
|
||||
? (uint)preset.GetHashCode()
|
||||
: (uint)GetHashCode();
|
||||
|
||||
|
||||
public override UIEffectContext context
|
||||
{
|
||||
@@ -115,11 +120,26 @@ namespace Coffee.UIEffects
|
||||
}
|
||||
}
|
||||
|
||||
public override RectTransform transitionRoot => useTargetTransform && isTargetInScene
|
||||
? target.transitionRoot
|
||||
: m_CustomRoot
|
||||
? m_CustomRoot
|
||||
: transform as RectTransform;
|
||||
public override RectTransform transitionRoot
|
||||
{
|
||||
get
|
||||
{
|
||||
if (useTargetTransform)
|
||||
{
|
||||
if (preset && !m_CustomRoot && graphic && canvas)
|
||||
{
|
||||
return canvas.transform as RectTransform;
|
||||
}
|
||||
|
||||
if (isTargetInScene)
|
||||
{
|
||||
return target.transitionRoot;
|
||||
}
|
||||
}
|
||||
|
||||
return m_CustomRoot ? m_CustomRoot : transform as RectTransform;
|
||||
}
|
||||
}
|
||||
|
||||
private bool isTargetInScene => target && target.gameObject.scene.IsValid();
|
||||
|
||||
@@ -149,6 +169,13 @@ namespace Coffee.UIEffects
|
||||
protected override void OnValidate()
|
||||
{
|
||||
RefreshTarget(target);
|
||||
|
||||
if (preset || (target && !isTargetInScene))
|
||||
{
|
||||
context?.SetGradationDirty();
|
||||
context?.SetTransitionGradationDirty();
|
||||
}
|
||||
|
||||
base.OnValidate();
|
||||
}
|
||||
|
||||
@@ -160,9 +187,9 @@ namespace Coffee.UIEffects
|
||||
target.SetEnablePreviewIfSelected(selection);
|
||||
}
|
||||
// Following the preset/preset-target.
|
||||
else if (context != null)
|
||||
else
|
||||
{
|
||||
context.SetEnablePreview(selection.Contains(gameObject), effectMaterial);
|
||||
context?.SetEnablePreview(selection.Contains(gameObject), effectMaterial);
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -15,8 +15,10 @@ namespace Coffee.UIEffects
|
||||
public static void Register(GraphicProxy proxy)
|
||||
{
|
||||
// Register only once.
|
||||
foreach (var p in s_Proxies)
|
||||
var count = s_Proxies.Count;
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
var p = s_Proxies[i];
|
||||
if (p.GetType() == proxy.GetType()) return;
|
||||
}
|
||||
|
||||
@@ -27,7 +29,8 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
if (!graphic) return null;
|
||||
|
||||
for (var i = s_Proxies.Count - 1; i >= 0; i--)
|
||||
var count = s_Proxies.Count;
|
||||
for (var i = count - 1; i >= 0; i--)
|
||||
{
|
||||
var p = s_Proxies[i];
|
||||
if (p.IsValid(graphic)) return p;
|
||||
@@ -55,13 +58,12 @@ namespace Coffee.UIEffects
|
||||
/// <summary>
|
||||
/// Called before modifying the mesh.
|
||||
/// </summary>
|
||||
public virtual void OnPreModifyMesh(Graphic graphic)
|
||||
public virtual void OnPreModifyMesh(Graphic graphic, Canvas canvas)
|
||||
{
|
||||
UIVertexUtil.onLerpVertex = s_OnLerpVertex;
|
||||
ShadowUtil.onMarkAsShadow = s_OnMarkAsShadow;
|
||||
UIEffectContext.onModifyVertex = s_OnModifyVertex;
|
||||
|
||||
var canvas = graphic.canvas;
|
||||
if (canvas)
|
||||
{
|
||||
canvas.additionalShaderChannels |= AdditionalCanvasShaderChannels.TexCoord1;
|
||||
|
||||
@@ -4,7 +4,7 @@ using UnityEngine.UI;
|
||||
|
||||
namespace Coffee.UIEffects
|
||||
{
|
||||
internal class ImageProxy : GraphicProxy
|
||||
internal sealed class ImageProxy : GraphicProxy
|
||||
{
|
||||
#if UNITY_EDITOR
|
||||
[InitializeOnLoadMethod]
|
||||
|
||||
@@ -10,7 +10,7 @@ using Object = UnityEngine.Object;
|
||||
|
||||
namespace Coffee.UIEffects
|
||||
{
|
||||
internal class TmpProxy : GraphicProxy
|
||||
internal sealed class TmpProxy : GraphicProxy
|
||||
{
|
||||
/// <summary>
|
||||
/// Check if the graphic is valid for this proxy.
|
||||
@@ -40,13 +40,12 @@ namespace Coffee.UIEffects
|
||||
/// <summary>
|
||||
/// Called before modifying the mesh.
|
||||
/// </summary>
|
||||
public override void OnPreModifyMesh(Graphic graphic)
|
||||
public override void OnPreModifyMesh(Graphic graphic, Canvas canvas)
|
||||
{
|
||||
UIVertexUtil.onLerpVertex = s_OnLerpVertex;
|
||||
ShadowUtil.onMarkAsShadow = s_OnMarkAsShadow;
|
||||
UIEffectContext.onModifyVertex = s_OnModifyVertex;
|
||||
|
||||
var canvas = graphic.canvas;
|
||||
if (canvas)
|
||||
{
|
||||
canvas.additionalShaderChannels |= AdditionalCanvasShaderChannels.TexCoord2;
|
||||
@@ -59,7 +58,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
if (enabled)
|
||||
{
|
||||
OnChangeText(textMeshProUGUI);
|
||||
s_ChangedInstances.Add(textMeshProUGUI);
|
||||
}
|
||||
else if (0 < textMeshProUGUI.textInfo?.meshInfo?.Length
|
||||
&& 0 < textMeshProUGUI.textInfo.meshInfo[0].vertexCount)
|
||||
@@ -111,21 +110,30 @@ namespace Coffee.UIEffects
|
||||
private static readonly HashSet<TextMeshProUGUI> s_RegisteredInstances = new HashSet<TextMeshProUGUI>();
|
||||
private static readonly Dictionary<int, float> s_SdfScaleCache = new Dictionary<int, float>();
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[InitializeOnLoadMethod]
|
||||
#endif
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
|
||||
private static void InitializeOnLoad()
|
||||
private static void RuntimeInitializeOnLoadMethod()
|
||||
{
|
||||
s_ChangedInstances.Clear();
|
||||
s_RegisteredInstances.Clear();
|
||||
s_SdfScaleCache.Clear();
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[InitializeOnLoadMethod]
|
||||
#else
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
|
||||
#endif
|
||||
private static void InitializeOnLoad()
|
||||
{
|
||||
Register(new TmpProxy());
|
||||
|
||||
// When the text is changed, add it to the changed list
|
||||
TMPro_EventManager.TEXT_CHANGED_EVENT.Add(obj =>
|
||||
{
|
||||
if (obj is TextMeshProUGUI textMeshProUGUI && textMeshProUGUI.isActiveAndEnabled)
|
||||
if (obj is TextMeshProUGUI textMeshProUGUI
|
||||
&& textMeshProUGUI.isActiveAndEnabled
|
||||
// fix: `TmpProxy` causes loss of modifications from other `IMeshModifiers` (#371)
|
||||
&& textMeshProUGUI.TryGetComponent<UIEffectBase>(out var _))
|
||||
{
|
||||
s_ChangedInstances.Add(textMeshProUGUI);
|
||||
}
|
||||
@@ -137,7 +145,9 @@ namespace Coffee.UIEffects
|
||||
var toRemove = InternalListPool<TextMeshProUGUI>.Rent();
|
||||
foreach (var textMeshProUGUI in s_RegisteredInstances)
|
||||
{
|
||||
if (textMeshProUGUI && textMeshProUGUI.isActiveAndEnabled)
|
||||
if (textMeshProUGUI
|
||||
&& textMeshProUGUI.isActiveAndEnabled
|
||||
&& !textMeshProUGUI.isTextObjectScaleStatic)
|
||||
{
|
||||
var id = textMeshProUGUI.GetHashCode();
|
||||
var lossyScaleY = textMeshProUGUI.transform.lossyScale.y;
|
||||
@@ -145,11 +155,11 @@ namespace Coffee.UIEffects
|
||||
// If the scale has changed, add to the changed list
|
||||
if (s_SdfScaleCache.TryGetValue(id, out var prev) && !Mathf.Approximately(prev, lossyScaleY))
|
||||
{
|
||||
OnChangeText(textMeshProUGUI);
|
||||
s_ChangedInstances.Add(textMeshProUGUI);
|
||||
}
|
||||
|
||||
// Update the scale cache
|
||||
s_SdfScaleCache[id] = textMeshProUGUI.transform.lossyScale.y;
|
||||
s_SdfScaleCache[id] = lossyScaleY;
|
||||
}
|
||||
// Remove destroyed objects later
|
||||
else if (!ReferenceEquals(textMeshProUGUI, null))
|
||||
@@ -174,6 +184,9 @@ namespace Coffee.UIEffects
|
||||
foreach (var textMeshProUGUI in s_ChangedInstances)
|
||||
{
|
||||
if (!textMeshProUGUI || !textMeshProUGUI.isActiveAndEnabled) continue;
|
||||
if (!textMeshProUGUI.TryGetComponent<IMeshModifier>(out var _)) continue;
|
||||
|
||||
s_RegisteredInstances.Add(textMeshProUGUI);
|
||||
ModifyMesh(textMeshProUGUI);
|
||||
}
|
||||
|
||||
@@ -198,14 +211,6 @@ namespace Coffee.UIEffects
|
||||
#endif
|
||||
}
|
||||
|
||||
private static void OnChangeText(Object obj)
|
||||
{
|
||||
if (obj is TextMeshProUGUI textMeshProUGUI && textMeshProUGUI.isActiveAndEnabled)
|
||||
{
|
||||
s_ChangedInstances.Add(textMeshProUGUI);
|
||||
}
|
||||
}
|
||||
|
||||
private static void ModifyMesh(TextMeshProUGUI textMeshProUGUI)
|
||||
{
|
||||
if (!s_Mesh)
|
||||
@@ -214,19 +219,38 @@ namespace Coffee.UIEffects
|
||||
s_Mesh.MarkDynamic();
|
||||
}
|
||||
|
||||
s_RegisteredInstances.Add(textMeshProUGUI);
|
||||
var effect = textMeshProUGUI.GetComponent<UIEffectBase>();
|
||||
var subMeshes = InternalListPool<TMP_SubMeshUI>.Rent();
|
||||
var modifiers = InternalListPool<IMeshModifier>.Rent();
|
||||
var subModifiers = InternalListPool<IMeshModifier>.Rent();
|
||||
textMeshProUGUI.TryGetComponent<UIEffectBase>(out var effect);
|
||||
textMeshProUGUI.GetComponentsInChildren(subMeshes, 1);
|
||||
textMeshProUGUI.GetComponents(modifiers);
|
||||
|
||||
for (var i = 0; i < textMeshProUGUI.textInfo.meshInfo.Length; i++)
|
||||
{
|
||||
var meshInfo = textMeshProUGUI.textInfo.meshInfo[i];
|
||||
if (meshInfo.vertexCount == 0)
|
||||
{
|
||||
// Clear mesh if no vertices.
|
||||
s_Mesh.Clear(false);
|
||||
if (i == 0)
|
||||
{
|
||||
textMeshProUGUI.canvasRenderer.SetMesh(s_Mesh);
|
||||
}
|
||||
else
|
||||
{
|
||||
var subMeshUI = GetSubMeshUI(subMeshes, meshInfo.material, i - 1);
|
||||
if (subMeshUI)
|
||||
{
|
||||
subMeshUI.canvasRenderer.SetMesh(s_Mesh);
|
||||
}
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
|
||||
s_VertexHelper.Clear();
|
||||
meshInfo.mesh.CopyTo(s_VertexHelper, meshInfo.vertexCount, meshInfo.vertexCount * 6 / 4);
|
||||
meshInfo.mesh.CopyTo(s_VertexHelper);
|
||||
if (i == 0)
|
||||
{
|
||||
foreach (var modifier in modifiers)
|
||||
@@ -248,7 +272,16 @@ namespace Coffee.UIEffects
|
||||
var subMeshUI = GetSubMeshUI(subMeshes, meshInfo.material, i - 1);
|
||||
if (!subMeshUI) break;
|
||||
|
||||
var replica = subMeshUI.GetOrAddComponent<UIEffectReplica>();
|
||||
// fix: TMP Text sprite submesh lost when changing fontMaterial (#368)
|
||||
if (!subMeshUI.TryGetComponent<UIEffectReplica>(out var replica))
|
||||
{
|
||||
replica = subMeshUI.gameObject.AddComponent<UIEffectReplica>();
|
||||
textMeshProUGUI.RegisterDirtyMaterialCallback(() =>
|
||||
{
|
||||
if (subMeshUI) subMeshUI.SetMaterialDirty();
|
||||
});
|
||||
}
|
||||
|
||||
if (effect is UIEffect pEffect && pEffect.isActiveAndEnabled)
|
||||
{
|
||||
replica.target = pEffect;
|
||||
@@ -287,6 +320,7 @@ namespace Coffee.UIEffects
|
||||
InternalListPool<IMeshModifier>.Return(ref modifiers);
|
||||
InternalListPool<IMeshModifier>.Return(ref subModifiers);
|
||||
s_Mesh.Clear(false);
|
||||
Misc.QueuePlayerLoopUpdate();
|
||||
}
|
||||
|
||||
private static TMP_SubMeshUI GetSubMeshUI(List<TMP_SubMeshUI> subMeshes, Material material, int start)
|
||||
|
||||
@@ -20,7 +20,7 @@ TextureImporter:
|
||||
externalNormalMap: 0
|
||||
heightScale: 0.25
|
||||
normalMapFilter: 0
|
||||
isReadable: 1
|
||||
isReadable: 0
|
||||
streamingMipmaps: 0
|
||||
streamingMipmapsPriority: 0
|
||||
vTOnly: 0
|
||||
@@ -53,7 +53,7 @@ TextureImporter:
|
||||
alphaUsage: 1
|
||||
alphaIsTransparency: 1
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 8
|
||||
textureType: 0
|
||||
textureShape: 1
|
||||
singleChannelComponent: 0
|
||||
flipbookRows: 1
|
||||
@@ -69,7 +69,7 @@ TextureImporter:
|
||||
buildTarget: DefaultTexturePlatform
|
||||
maxTextureSize: 2048
|
||||
resizeAlgorithm: 0
|
||||
textureFormat: 4
|
||||
textureFormat: -1
|
||||
textureCompression: 1
|
||||
compressionQuality: 50
|
||||
crunchedCompression: 0
|
||||
@@ -100,7 +100,7 @@ TextureImporter:
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: Android
|
||||
maxTextureSize: 2048
|
||||
@@ -112,7 +112,7 @@ TextureImporter:
|
||||
allowsAlphaSplitting: 0
|
||||
overridden: 0
|
||||
androidETC2FallbackOverride: 0
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 1
|
||||
forceMaximumCompressionQuality_BC6H_BC7: 0
|
||||
- serializedVersion: 3
|
||||
buildTarget: WebGL
|
||||
maxTextureSize: 2048
|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 190 B |
@@ -0,0 +1,114 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 5b4bb77fa760f487cac2866aeb002588
|
||||
TextureImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 13
|
||||
mipmaps:
|
||||
mipMapMode: 0
|
||||
enableMipMap: 1
|
||||
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: 0
|
||||
wrapW: 0
|
||||
nPOTScale: 1
|
||||
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: 0
|
||||
alphaIsTransparency: 0
|
||||
spriteTessellationDetail: -1
|
||||
textureType: 0
|
||||
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: 32
|
||||
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
|
||||
spriteSheet:
|
||||
serializedVersion: 2
|
||||
sprites: []
|
||||
outline: []
|
||||
physicsShape: []
|
||||
bones: []
|
||||
spriteID:
|
||||
internalID: 0
|
||||
vertices: []
|
||||
indices:
|
||||
edges: []
|
||||
weights: []
|
||||
secondaryTextures: []
|
||||
nameFileIdTable: {}
|
||||
mipmapLimitGroupName:
|
||||
pSDRemoveMatte: 0
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
File diff suppressed because it is too large
Load Diff
+10
-1
@@ -10,7 +10,9 @@ namespace UnityEditor.Rendering.BuiltIn.ShaderGraph
|
||||
internal class BuiltInUIEffectSubTarget : BuiltInCanvasSubTarget
|
||||
{
|
||||
// UIEffectForShaderGraph.hlsl
|
||||
internal static string s_UIEffectHlsl => AssetDatabase.GUIDToAssetPath("5109b2ad9b8be459592190a5678464e3");
|
||||
private static GUID s_UIEffectCgincGuid => new GUID("2dd0ed35b98b345218d9aa8ac5a3ad6b");
|
||||
private static GUID s_UIEffectHlslGuid => new GUID("5109b2ad9b8be459592190a5678464e3");
|
||||
private static string s_UIEffectHlsl => AssetDatabase.GUIDToAssetPath(s_UIEffectHlslGuid.ToString());
|
||||
|
||||
public BuiltInUIEffectSubTarget() { displayName = "Canvas (UIEffect)"; }
|
||||
|
||||
@@ -25,6 +27,13 @@ namespace UnityEditor.Rendering.BuiltIn.ShaderGraph
|
||||
protected override IncludeCollection postgraphIncludes => base.postgraphIncludes
|
||||
.Add(s_UIEffectHlsl, IncludeLocation.Postgraph); // Include UIEffectForShaderGraph.hlsl on postgraph
|
||||
|
||||
public override void Setup(ref TargetSetupContext context)
|
||||
{
|
||||
base.Setup(ref context);
|
||||
context.AddAssetDependency(s_UIEffectHlslGuid, AssetCollection.Flags.SourceDependency);
|
||||
context.AddAssetDependency(s_UIEffectCgincGuid, AssetCollection.Flags.SourceDependency);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Modify pass descriptor for UIEffect.
|
||||
/// </summary>
|
||||
|
||||
+11
-10
@@ -1,5 +1,6 @@
|
||||
// ==== UIEFFECT START ====
|
||||
SurfaceDescriptionInputs _fragInput;
|
||||
|
||||
half4 uieffect_frag(float2 uv)
|
||||
{
|
||||
float2 prevUv = _fragInput.uv0.xy;
|
||||
@@ -34,25 +35,25 @@ half4 frag_override(PackedVaryings packedInput) : SV_TARGET
|
||||
_fragInput = surfaceDescriptionInputs;
|
||||
const half4 origin = uieffect_frag(_fragInput.uv0.xy);
|
||||
half4 color = uieffect(origin, _fragInput.uv0.xy, unpacked.texCoord2, float4(unpacked.positionWS, 1));
|
||||
|
||||
|
||||
//Round up the alpha color coming from the interpolator (to 1.0/256.0 steps)
|
||||
//The incoming alpha could have numerical instability, which makes it very sensible to
|
||||
//HDR color transparency blend, when it blends with the world's texture.
|
||||
const half alphaPrecision = half(0xff);
|
||||
const half invAlphaPrecision = half(1.0/alphaPrecision);
|
||||
unpacked.color.a = round(unpacked.color.a * alphaPrecision)*invAlphaPrecision;
|
||||
|
||||
const half invAlphaPrecision = half(1.0 / alphaPrecision);
|
||||
unpacked.color.a = round(unpacked.color.a * alphaPrecision) * invAlphaPrecision;
|
||||
|
||||
#if !defined(HAVE_VFX_MODIFICATION) && !defined(_DISABLE_COLOR_TINT)
|
||||
color.rgb *= unpacked.color.rgb;
|
||||
color *= unpacked.color.a;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef UNITY_UI_CLIP_RECT
|
||||
//mask = Uv2
|
||||
half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(unpacked.texCoord1.xy)) * unpacked.texCoord1.zw);
|
||||
color *= m.x * m.y;
|
||||
#endif
|
||||
|
||||
|
||||
// ==== SOFTMASKABLE START ====
|
||||
#if SOFTMASKABLE
|
||||
color *= SoftMask(unpacked.positionCS, unpacked.positionWS, color.a);
|
||||
@@ -62,10 +63,10 @@ half4 frag_override(PackedVaryings packedInput) : SV_TARGET
|
||||
#if defined(_ALPHATEST_ON) || defined(_BUILTIN_ALPHATEST_ON)
|
||||
clip(color.a - surfaceDescription.AlphaClipThreshold);
|
||||
#endif
|
||||
|
||||
|
||||
#if UNITY_UI_ALPHACLIP
|
||||
clip(color.a - 0.001);
|
||||
#endif
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
return color;
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData: v5.8.0
|
||||
userData: v5.9.0
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData: v5.8.0
|
||||
userData: v5.9.0
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
|
||||
|
||||
+18
-1
@@ -1,11 +1,21 @@
|
||||
using System;
|
||||
using UnityEditor.Rendering.BuiltIn.ShaderGraph;
|
||||
using UnityEditor.ShaderGraph;
|
||||
#if UNITY_6000_4_OR_NEWER
|
||||
using GUID = UnityEngine.GUID;
|
||||
#else
|
||||
using GUID = UnityEditor.GUID;
|
||||
#endif
|
||||
|
||||
namespace UnityEditor.Rendering.Universal.ShaderGraph
|
||||
{
|
||||
internal class UniversalUIEffectSubTarget : UniversalCanvasSubTarget
|
||||
{
|
||||
// UIEffectForShaderGraph.hlsl
|
||||
private static GUID s_UIEffectCgincGuid => new GUID("2dd0ed35b98b345218d9aa8ac5a3ad6b");
|
||||
private static GUID s_UIEffectHlslGuid => new GUID("5109b2ad9b8be459592190a5678464e3");
|
||||
private static string s_UIEffectHlsl => AssetDatabase.GUIDToAssetPath(s_UIEffectHlslGuid.ToString());
|
||||
|
||||
[MenuItem("Assets/Create/Shader Graph/URP/Canvas Shader Graph (UIEffect)", priority = 1000)]
|
||||
private static void CreateUnlitGraph()
|
||||
{
|
||||
@@ -18,7 +28,14 @@ namespace UnityEditor.Rendering.Universal.ShaderGraph
|
||||
public UniversalUIEffectSubTarget() { displayName = "Canvas (UIEffect)"; }
|
||||
|
||||
protected override IncludeCollection postgraphIncludes => base.postgraphIncludes
|
||||
.Add(BuiltInUIEffectSubTarget.s_UIEffectHlsl, IncludeLocation.Postgraph);
|
||||
.Add(s_UIEffectHlsl, IncludeLocation.Postgraph);
|
||||
|
||||
public override void Setup(ref TargetSetupContext context)
|
||||
{
|
||||
base.Setup(ref context);
|
||||
context.AddAssetDependency(s_UIEffectHlslGuid, AssetCollection.Flags.SourceDependency);
|
||||
context.AddAssetDependency(s_UIEffectCgincGuid, AssetCollection.Flags.SourceDependency);
|
||||
}
|
||||
|
||||
public override PassDescriptor GenerateUIPassDescriptor(bool isSRP)
|
||||
{
|
||||
|
||||
+2
-2
@@ -61,11 +61,11 @@ SubShader {
|
||||
#pragma shader_feature_local_fragment _ TONE_GRAYSCALE TONE_SEPIA TONE_NEGATIVE TONE_RETRO TONE_POSTERIZE
|
||||
#pragma shader_feature_local_fragment _ COLOR_FILTER
|
||||
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
|
||||
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN
|
||||
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN TRANSITION_BLAZE
|
||||
#pragma shader_feature_local_fragment _ EDGE_PLAIN EDGE_SHINY
|
||||
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_SUBTRACTIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
|
||||
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
|
||||
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_RADIAL GRADATION_COLOR2 GRADATION_COLOR4
|
||||
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_COLOR2 GRADATION_COLOR4
|
||||
#pragma shader_feature_fragment _ UIEFFECT_EDITOR
|
||||
// ==== UIEFFECT END ====
|
||||
|
||||
|
||||
+1
-1
@@ -4,6 +4,6 @@ ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData: v5.8.0 (Unity 6)
|
||||
userData: v5.9.0 (Unity 6)
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
+2
-2
@@ -60,11 +60,11 @@ SubShader{
|
||||
#pragma shader_feature_local_fragment _ TONE_GRAYSCALE TONE_SEPIA TONE_NEGATIVE TONE_RETRO TONE_POSTERIZE
|
||||
#pragma shader_feature_local_fragment _ COLOR_FILTER
|
||||
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
|
||||
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN
|
||||
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN TRANSITION_BLAZE
|
||||
#pragma shader_feature_local_fragment _ EDGE_PLAIN EDGE_SHINY
|
||||
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_SUBTRACTIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
|
||||
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
|
||||
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_RADIAL GRADATION_COLOR2 GRADATION_COLOR4
|
||||
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_COLOR2 GRADATION_COLOR4
|
||||
#pragma shader_feature_fragment _ UIEFFECT_EDITOR
|
||||
// ==== UIEFFECT END ====
|
||||
|
||||
|
||||
+1
-1
@@ -4,6 +4,6 @@ ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData: v5.8.0 (Unity 6)
|
||||
userData: v5.9.0 (Unity 6)
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
+2
-2
@@ -130,11 +130,11 @@ SubShader {
|
||||
#pragma shader_feature_local_fragment _ TONE_GRAYSCALE TONE_SEPIA TONE_NEGATIVE TONE_RETRO TONE_POSTERIZE
|
||||
#pragma shader_feature_local_fragment _ COLOR_FILTER
|
||||
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
|
||||
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN
|
||||
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN TRANSITION_BLAZE
|
||||
#pragma shader_feature_local_fragment _ EDGE_PLAIN EDGE_SHINY
|
||||
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_SUBTRACTIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
|
||||
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
|
||||
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_RADIAL GRADATION_COLOR2 GRADATION_COLOR4
|
||||
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_COLOR2 GRADATION_COLOR4
|
||||
#pragma shader_feature_fragment _ UIEFFECT_EDITOR
|
||||
// ==== UIEFFECT END ====
|
||||
|
||||
|
||||
+1
-1
@@ -4,6 +4,6 @@ ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData: v5.8.0 (Unity 6)
|
||||
userData: v5.9.0 (Unity 6)
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
+2
-2
@@ -131,11 +131,11 @@ SubShader {
|
||||
#pragma shader_feature_local_fragment _ TONE_GRAYSCALE TONE_SEPIA TONE_NEGATIVE TONE_RETRO TONE_POSTERIZE
|
||||
#pragma shader_feature_local_fragment _ COLOR_FILTER
|
||||
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
|
||||
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN
|
||||
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN TRANSITION_BLAZE
|
||||
#pragma shader_feature_local_fragment _ EDGE_PLAIN EDGE_SHINY
|
||||
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_SUBTRACTIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
|
||||
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
|
||||
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_RADIAL GRADATION_COLOR2 GRADATION_COLOR4
|
||||
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_COLOR2 GRADATION_COLOR4
|
||||
#pragma shader_feature_fragment _ UIEFFECT_EDITOR
|
||||
// ==== UIEFFECT END ====
|
||||
|
||||
|
||||
+1
-1
@@ -4,6 +4,6 @@ ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData: v5.8.0 (Unity 6)
|
||||
userData: v5.9.0 (Unity 6)
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
+2
-2
@@ -92,11 +92,11 @@ SubShader {
|
||||
#pragma shader_feature_local_fragment _ TONE_GRAYSCALE TONE_SEPIA TONE_NEGATIVE TONE_RETRO TONE_POSTERIZE
|
||||
#pragma shader_feature_local_fragment _ COLOR_FILTER
|
||||
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
|
||||
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN
|
||||
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN TRANSITION_BLAZE
|
||||
#pragma shader_feature_local_fragment _ EDGE_PLAIN EDGE_SHINY
|
||||
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_SUBTRACTIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
|
||||
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
|
||||
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_RADIAL GRADATION_COLOR2 GRADATION_COLOR4
|
||||
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_COLOR2 GRADATION_COLOR4
|
||||
#pragma shader_feature_fragment _ UIEFFECT_EDITOR
|
||||
// ==== UIEFFECT END ====
|
||||
|
||||
|
||||
+1
-1
@@ -4,6 +4,6 @@ ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData: v5.8.0 (Unity 6)
|
||||
userData: v5.9.0 (Unity 6)
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
+2
-2
@@ -95,11 +95,11 @@ SubShader {
|
||||
#pragma shader_feature_local_fragment _ TONE_GRAYSCALE TONE_SEPIA TONE_NEGATIVE TONE_RETRO TONE_POSTERIZE
|
||||
#pragma shader_feature_local_fragment _ COLOR_FILTER
|
||||
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
|
||||
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN
|
||||
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN TRANSITION_BLAZE
|
||||
#pragma shader_feature_local_fragment _ EDGE_PLAIN EDGE_SHINY
|
||||
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_SUBTRACTIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
|
||||
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
|
||||
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_RADIAL GRADATION_COLOR2 GRADATION_COLOR4
|
||||
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_COLOR2 GRADATION_COLOR4
|
||||
#pragma shader_feature_fragment _ UIEFFECT_EDITOR
|
||||
// ==== UIEFFECT END ====
|
||||
|
||||
|
||||
+1
-1
@@ -4,6 +4,6 @@ ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData: v5.8.0 (Unity 6)
|
||||
userData: v5.9.0 (Unity 6)
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
+2
-2
@@ -93,11 +93,11 @@ SubShader {
|
||||
#pragma shader_feature_local_fragment _ TONE_GRAYSCALE TONE_SEPIA TONE_NEGATIVE TONE_RETRO TONE_POSTERIZE
|
||||
#pragma shader_feature_local_fragment _ COLOR_FILTER
|
||||
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
|
||||
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN
|
||||
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN TRANSITION_BLAZE
|
||||
#pragma shader_feature_local_fragment _ EDGE_PLAIN EDGE_SHINY
|
||||
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_SUBTRACTIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
|
||||
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
|
||||
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_RADIAL GRADATION_COLOR2 GRADATION_COLOR4
|
||||
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_COLOR2 GRADATION_COLOR4
|
||||
#pragma shader_feature_fragment _ UIEFFECT_EDITOR
|
||||
// ==== UIEFFECT END ====
|
||||
|
||||
|
||||
+1
-1
@@ -4,6 +4,6 @@ ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData: v5.8.0 (Unity 6)
|
||||
userData: v5.9.0 (Unity 6)
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
+2
-2
@@ -130,11 +130,11 @@ SubShader {
|
||||
#pragma shader_feature_local_fragment _ TONE_GRAYSCALE TONE_SEPIA TONE_NEGATIVE TONE_RETRO TONE_POSTERIZE
|
||||
#pragma shader_feature_local_fragment _ COLOR_FILTER
|
||||
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
|
||||
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN
|
||||
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN TRANSITION_BLAZE
|
||||
#pragma shader_feature_local_fragment _ EDGE_PLAIN EDGE_SHINY
|
||||
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_SUBTRACTIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
|
||||
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
|
||||
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_RADIAL GRADATION_COLOR2 GRADATION_COLOR4
|
||||
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_COLOR2 GRADATION_COLOR4
|
||||
#pragma shader_feature_fragment _ UIEFFECT_EDITOR
|
||||
// ==== UIEFFECT END ====
|
||||
|
||||
|
||||
+1
-1
@@ -4,6 +4,6 @@ ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData: v5.8.0 (Unity 6)
|
||||
userData: v5.9.0 (Unity 6)
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@@ -61,11 +61,11 @@ SubShader {
|
||||
#pragma shader_feature_local_fragment _ TONE_GRAYSCALE TONE_SEPIA TONE_NEGATIVE TONE_RETRO TONE_POSTERIZE
|
||||
#pragma shader_feature_local_fragment _ COLOR_FILTER
|
||||
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
|
||||
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN
|
||||
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN TRANSITION_BLAZE
|
||||
#pragma shader_feature_local_fragment _ EDGE_PLAIN EDGE_SHINY
|
||||
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_SUBTRACTIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
|
||||
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
|
||||
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_RADIAL GRADATION_COLOR2 GRADATION_COLOR4
|
||||
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_COLOR2 GRADATION_COLOR4
|
||||
#pragma shader_feature_fragment _ UIEFFECT_EDITOR
|
||||
// ==== UIEFFECT END ====
|
||||
|
||||
|
||||
+1
-1
@@ -4,6 +4,6 @@ ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData: v5.8.0
|
||||
userData: v5.9.0
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@@ -60,11 +60,11 @@ SubShader{
|
||||
#pragma shader_feature_local_fragment _ TONE_GRAYSCALE TONE_SEPIA TONE_NEGATIVE TONE_RETRO TONE_POSTERIZE
|
||||
#pragma shader_feature_local_fragment _ COLOR_FILTER
|
||||
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
|
||||
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN
|
||||
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN TRANSITION_BLAZE
|
||||
#pragma shader_feature_local_fragment _ EDGE_PLAIN EDGE_SHINY
|
||||
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_SUBTRACTIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
|
||||
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
|
||||
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_RADIAL GRADATION_COLOR2 GRADATION_COLOR4
|
||||
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_COLOR2 GRADATION_COLOR4
|
||||
#pragma shader_feature_fragment _ UIEFFECT_EDITOR
|
||||
// ==== UIEFFECT END ====
|
||||
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user