Compare commits

..

22 Commits

Author SHA1 Message Date
mob-sakai c3bf0724fe feat: support UniText
close #397
2026-06-20 16:14:44 +09:00
mob-sakai ae7ffad789 chore: update readme 2026-06-20 16:14:22 +09:00
mob-sakai c7696c09c0 chore: update internal 2026-06-20 15:36:37 +09:00
mob-sakai b6b538f64f fix: some fix 2026-06-20 15:36:37 +09:00
mob-sakai 730aa2bb4d fix: enable/disable Gameobject break effect with 'TrueShadow'
close #400
2026-06-20 15:36:37 +09:00
mob-sakai 546d603674 chore: add hot-update test 2026-06-20 15:36:37 +09:00
quyong e955715c99 feat: add option to remove from preloadedAssets when build player
close #393
2026-06-20 15:36:37 +09:00
mob-sakai 72bb1c5131 feat: support XBOX One/Series
close #385, close #394
2026-06-20 15:36:37 +09:00
조영록 f538ef2cba fix: select TMP submesh by mesh before material 2026-06-17 18:17:08 +09:00
mob-sakai ae483ec577 update wf 2026-06-17 18:15:27 +09:00
mob-sakai facb78262c chore: fix workflow for pwn request 2026-06-12 16:00:12 +09:00
semantic-release-bot a2c550c523 chore(release): 5.10.9 [skip ci]
## [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)
2026-06-08 09:57:55 +00:00
mob-sakai 44cf12173f chore: ignore alpha for test 2026-06-08 17:41:24 +09:00
mob-sakai d7abcc47f1 update internal code 2026-06-08 17:41:24 +09:00
mob-sakai 57031c3e3c fix: Clarify that the ShaderGraph support is available only in Unity 2023.2/6.0 or later
close #391
2026-06-08 11:05:40 +09:00
mob-sakai cd68b364c4 fix: ambiguous call to 'lerp' in shader
close #390
2026-06-07 20:29:24 +09:00
mob-sakai f3da972c0c fix: UIEffect.detailColor is not working
close #399
2026-06-07 20:11:51 +09:00
mob-sakai 2d6f7ed63d fix: support Unity 6.5 or later
close #392, close #398
2026-06-07 20:06:44 +09:00
semantic-release-bot 70937d2ce3 chore(release): 5.10.8 [skip ci]
## [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))
2026-01-16 02:26:09 +00:00
mob-sakai 4a4e50e01f fix: Canvas not properly cached when objects are outside Canvas 2026-01-16 11:24:57 +09:00
semantic-release-bot 815162eab9 chore(release): 5.10.7 [skip ci]
## [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))
2025-12-18 11:20:51 +00:00
mob-sakai 7fc0c7364d fix: support Unity 6000.4 2025-12-18 18:58:52 +09:00
103 changed files with 5573 additions and 362 deletions
+2 -2
View File
@@ -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
+3 -3
View File
@@ -25,10 +25,10 @@ jobs:
tag: ${{ steps.release.outputs.new_release_git_tag }}
steps:
- name: 🚚 Checkout (${{ github.ref_name }})
uses: actions/checkout@v5
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
@@ -36,7 +36,7 @@ jobs:
@semantic-release/changelog
@semantic-release/git
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
GITHUB_TOKEN: ${{ github.token }}
- run: |
echo "🔖 New release published: '${{ steps.release.outputs.new_release_published }}'" | tee -a $GITHUB_STEP_SUMMARY
+36 -37
View File
@@ -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: "(2017|2018)"
EXCLUDE_FILTER: "(2017|2018|2023.3)"
PROJECT_PATH: UIEffectURP
on:
@@ -27,7 +27,7 @@ on:
- "!*"
paths-ignore:
- "**.md"
pull_request_target:
pull_request:
types:
- opened
- reopened
@@ -39,16 +39,30 @@ jobs:
setup:
name: ⚙️ Setup
runs-on: ubuntu-latest
permissions: {} # No permissions needed for setup job
outputs:
unityVersions: ${{ steps.setup.outputs.unityVersions }}
steps:
- name: 🔑 Secrets check
run: |
echo "Checking secrets for ${{ github.actor }} ..."
if [ -z "$UNITY_EMAIL" ] || [ -z "$UNITY_PASSWORD" ] || [ -z "$UNITY_LICENSE" ]; then
echo "Error: UNITY_EMAIL, UNITY_PASSWORD, and UNITY_LICENSE secrets must be set." | tee -a $GITHUB_STEP_SUMMARY >&2
echo "Error: See https://game.ci/docs/github/test-runner#basic-setup" | tee -a $GITHUB_STEP_SUMMARY >&2
echo "Error: Set the secrets at ${{ github.server_url }}/${{ github.repository }}/settings/secrets/actions" | tee -a $GITHUB_STEP_SUMMARY >&2
exit 1
fi
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
- name: ⚙️ Find target Unity versions
id: setup
run: |
echo "==== Target Unity Versions ===="
LATEST_VERSIONS=`npx unity-changeset@latest list --versions --latest-patch --min ${MINIMUM_VERSION} --json --all`
LATEST_VERSIONS=`npx -y unity-changeset@latest list --json --versions --all --latest-patch --ignore-alpha --min ${MINIMUM_VERSION}`
if [ "${{ inputs.usePeriodVersions }}" = "true" ]; then
ADDITIONAL_VERSIONS=`npx unity-changeset list --versions --grep '0f' --min ${MINIMUM_VERSION} --json`
ADDITIONAL_VERSIONS=`npx -y unity-changeset@latest list --json --versions --ignore-alpha --min ${MINIMUM_VERSION} --grep '0f'`
else
ADDITIONAL_VERSIONS=[]
fi
@@ -66,31 +80,15 @@ jobs:
needs: setup
strategy:
fail-fast: false
max-parallel: 6
max-parallel: 8
matrix:
unityVersion: ${{ fromJson(needs.setup.outputs.unityVersions) }}
steps:
- name: 🚚 Checkout ($${{ github.ref }})
if: github.event_name == 'push'
uses: actions/checkout@v5
- name: 🚚 Checkout pull request (pull_request_target)
if: github.event_name == 'pull_request_target'
uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: 🚚 Marge pull request (pull_request_target)
if: github.event_name == 'pull_request_target'
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git rebase ${{ github.event.pull_request.base.sha }}
git log --oneline -n 10
uses: actions/checkout@v6
- name: 📥 Cache library
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: ${{ env.PROJECT_PATH }}/Library
key: ${{ env.PROJECT_PATH }}-Library-${{ matrix.unityVersion }}-${{ github.event.pull_request.head.sha || github.sha }}
@@ -99,7 +97,7 @@ jobs:
${{ env.PROJECT_PATH }}-Library-
- name: 🛠️ Build Unity Project (Test)
uses: game-ci/unity-builder@main
uses: game-ci/unity-builder@v5
timeout-minutes: 45
with:
customImage: ghcr.io/mob-sakai/unity3d:${{ matrix.unityVersion }}
@@ -112,16 +110,17 @@ jobs:
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
# - name: 🧪 Run tests
# uses: game-ci/unity-test-runner@v4
# timeout-minutes: 45
# with:
# customImage: ghcr.io/mob-sakai/unity3d:${{ matrix.unityVersion }}
# # unityVersion: ${{ matrix.unityVersion }}
# customParameters: -nographics
# checkName: ${{ matrix.unityVersion }} Test Results
# githubToken: ${{ github.token }}
# env:
# UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
# UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
# UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
# - name: 🧪 Run tests
# uses: game-ci/unity-test-runner@v4
# timeout-minutes: 45
# with:
# customImage: ghcr.io/mob-sakai/unity3d:${{ matrix.unityVersion }}
# # unityVersion: ${{ matrix.unityVersion }}
# customParameters: -nographics
# checkName: ${{ matrix.unityVersion }} Test Results
# githubToken: ${{ github.token }}
# projectPath: ${{ env.PROJECT_PATH }}
# env:
# UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
# UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
# UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
+21 -23
View File
@@ -27,7 +27,7 @@ on:
- "!*"
paths-ignore:
- "**.md"
pull_request_target:
pull_request:
types:
- opened
- reopened
@@ -39,16 +39,30 @@ jobs:
setup:
name: ⚙️ Setup
runs-on: ubuntu-latest
permissions: {} # No permissions needed for setup job
outputs:
unityVersions: ${{ steps.setup.outputs.unityVersions }}
steps:
- name: 🔑 Secrets check
run: |
echo "Checking secrets for ${{ github.actor }} ..."
if [ -z "$UNITY_EMAIL" ] || [ -z "$UNITY_PASSWORD" ] || [ -z "$UNITY_LICENSE" ]; then
echo "Error: UNITY_EMAIL, UNITY_PASSWORD, and UNITY_LICENSE secrets must be set." | tee -a $GITHUB_STEP_SUMMARY >&2
echo "Error: See https://game.ci/docs/github/test-runner#basic-setup" | tee -a $GITHUB_STEP_SUMMARY >&2
echo "Error: Set the secrets at ${{ github.server_url }}/${{ github.repository }}/settings/secrets/actions" | tee -a $GITHUB_STEP_SUMMARY >&2
exit 1
fi
env:
UNITY_EMAIL: ${{ secrets.UNITY_EMAIL }}
UNITY_PASSWORD: ${{ secrets.UNITY_PASSWORD }}
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
- name: ⚙️ Find target Unity versions
id: setup
run: |
echo "==== Target Unity Versions ===="
LATEST_VERSIONS=`npx unity-changeset@latest list --versions --latest-patch --min ${MINIMUM_VERSION} --json --all`
LATEST_VERSIONS=`npx -y unity-changeset@latest list --json --versions --all --latest-patch --ignore-alpha --min ${MINIMUM_VERSION}`
if [ "${{ inputs.usePeriodVersions }}" = "true" ]; then
ADDITIONAL_VERSIONS=`npx unity-changeset list --versions --grep '0f' --min ${MINIMUM_VERSION} --json`
ADDITIONAL_VERSIONS=`npx -y unity-changeset@latest list --json --versions --ignore-alpha --min ${MINIMUM_VERSION} --grep '0f'`
else
ADDITIONAL_VERSIONS=[]
fi
@@ -66,31 +80,15 @@ jobs:
needs: setup
strategy:
fail-fast: false
max-parallel: 6
max-parallel: 8
matrix:
unityVersion: ${{ fromJson(needs.setup.outputs.unityVersions) }}
steps:
- name: 🚚 Checkout ($${{ github.ref }})
if: github.event_name == 'push'
uses: actions/checkout@v5
- name: 🚚 Checkout pull request (pull_request_target)
if: github.event_name == 'pull_request_target'
uses: actions/checkout@v5
with:
ref: ${{ github.event.pull_request.head.sha }}
fetch-depth: 0
- name: 🚚 Marge pull request (pull_request_target)
if: github.event_name == 'pull_request_target'
run: |
git config user.name "GitHub Actions"
git config user.email "actions@github.com"
git rebase ${{ github.event.pull_request.base.sha }}
git log --oneline -n 10
uses: actions/checkout@v6
- name: 📥 Cache library
uses: actions/cache@v4
uses: actions/cache@v5
with:
path: ${{ env.PROJECT_PATH }}/Library
key: ${{ env.PROJECT_PATH }}-Library-${{ matrix.unityVersion }}-${{ github.event.pull_request.head.sha || github.sha }}
@@ -99,7 +97,7 @@ jobs:
${{ env.PROJECT_PATH }}-Library-
- name: 🛠️ Build Unity Project (Test)
uses: game-ci/unity-builder@main
uses: game-ci/unity-builder@v5
timeout-minutes: 45
with:
customImage: ghcr.io/mob-sakai/unity3d:${{ matrix.unityVersion }}
+1
View File
@@ -27,3 +27,4 @@ UserSettings/
*.app/
Build/
Assets/TextMeshPro Support*
Assets/UniText Support*
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 809b2c417b0714d479b9ccf131d24bda
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,106 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 468a46d0ae32c3544b7d98094e6448a9, type: 3}
m_Name: AddressableAssetSettings
m_EditorClassIdentifier:
m_DefaultGroup: 78c1e50bdf28744fc9af8aedb47f2517
m_OptimizeCatalogSize: 0
m_BuildRemoteCatalog: 0
m_BundleLocalCatalog: 0
m_CatalogRequestsTimeout: 0
m_DisableCatalogUpdateOnStart: 0
m_IgnoreUnsupportedFilesInBuild: 0
m_UniqueBundleIds: 0
m_NonRecursiveBuilding: 0
m_CCDEnabled: 0
m_maxConcurrentWebRequests: 3
m_ContiguousBundles: 0
m_StripUnityVersionFromBundleBuild: 0
m_DisableVisibleSubAssetRepresentations: 0
m_ShaderBundleNaming: 0
m_ShaderBundleCustomNaming:
m_MonoScriptBundleNaming: 0
m_CheckForContentUpdateRestrictionsOption: 0
m_MonoScriptBundleCustomNaming:
m_RemoteCatalogBuildPath:
m_Id: e92f87e9fe51b4b0b8a9a47cf7cab399
m_RemoteCatalogLoadPath:
m_Id: f077767d1bbbf451db919d7819556f80
m_ContentStateBuildPathProfileVariableName: <default settings path>
m_CustomContentStateBuildPath:
m_ContentStateBuildPath:
m_BuildAddressablesWithPlayerBuild: 0
m_overridePlayerVersion: '[UnityEditor.PlayerSettings.bundleVersion]'
m_GroupAssets:
- {fileID: 11400000, guid: d990055319c2b44b0b81ce4e3045db49, type: 2}
- {fileID: 11400000, guid: cb582cfe3736847f09b83adf8d15c36a, type: 2}
m_BuildSettings:
m_CompileScriptsInVirtualMode: 0
m_CleanupStreamingAssetsAfterBuilds: 1
m_LogResourceManagerExceptions: 1
m_BundleBuildPath: Temp/com.unity.addressables/AssetBundles
m_ProfileSettings:
m_Profiles:
- m_InheritedParent:
m_Id: f0c1919924e394e59af6bca6c9c911f0
m_ProfileName: Default
m_Values:
- m_Id: 45c7a530ddf2f4d138f32bf67335f91b
m_Value: '{UnityEngine.AddressableAssets.Addressables.RuntimePath}/[BuildTarget]'
- m_Id: c903326cd5c18420c8e3c894b1648d26
m_Value: '[UnityEngine.AddressableAssets.Addressables.BuildPath]/[BuildTarget]'
- m_Id: d01b18903c32d4541ac46fd27aeee619
m_Value: '[UnityEditor.EditorUserBuildSettings.activeBuildTarget]'
- m_Id: e92f87e9fe51b4b0b8a9a47cf7cab399
m_Value: ServerData/[BuildTarget]
- m_Id: f077767d1bbbf451db919d7819556f80
m_Value: http://[PrivateIpAddress]:[HostingServicePort]
m_ProfileEntryNames:
- m_Id: 45c7a530ddf2f4d138f32bf67335f91b
m_Name: Local.LoadPath
m_InlineUsage: 0
- m_Id: c903326cd5c18420c8e3c894b1648d26
m_Name: Local.BuildPath
m_InlineUsage: 0
- m_Id: d01b18903c32d4541ac46fd27aeee619
m_Name: BuildTarget
m_InlineUsage: 0
- m_Id: e92f87e9fe51b4b0b8a9a47cf7cab399
m_Name: Remote.BuildPath
m_InlineUsage: 0
- m_Id: f077767d1bbbf451db919d7819556f80
m_Name: Remote.LoadPath
m_InlineUsage: 0
m_ProfileVersion: 1
m_LabelTable:
m_LabelNames:
- default
m_SchemaTemplates: []
m_GroupTemplateObjects:
- {fileID: 11400000, guid: e03fdb26845f04c75b6fe9288c63a63a, type: 2}
m_InitializationObjects: []
m_CertificateHandlerType:
m_AssemblyName:
m_ClassName:
m_ActivePlayerDataBuilderIndex: 3
m_DataBuilders:
- {fileID: 11400000, guid: 797c488c7f2114197a8f18811c5cd128, type: 2}
- {fileID: 11400000, guid: 1400420db15a741b5a71c357c678c805, type: 2}
- {fileID: 11400000, guid: 96f4fd6856bbb4d5998503b7b5d15151, type: 2}
- {fileID: 11400000, guid: afc7e8697497b41f2ac9064294b360eb, type: 2}
m_ActiveProfileId: f0c1919924e394e59af6bca6c9c911f0
m_HostingServicesManager:
m_HostingServiceInfos: []
m_Settings: {fileID: 11400000}
m_NextInstanceId: 0
m_RegisteredServiceTypeRefs: []
m_PingTimeoutInMilliseconds: 5000
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 43329c4cc56ca415da37a048e434183a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a0cd82815cf624171bd2e59cf74c4f7d
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,76 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-6130888278409392347
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e5d17a21594effb4e9591490b009e7aa, type: 3}
m_Name: BundledAssetGroupSchema
m_EditorClassIdentifier:
m_Group: {fileID: 0}
m_InternalBundleIdMode: 1
m_Compression: 1
m_IncludeAddressInCatalog: 1
m_IncludeGUIDInCatalog: 1
m_IncludeLabelsInCatalog: 1
m_InternalIdNamingMode: 0
m_CacheClearBehavior: 0
m_IncludeInBuild: 1
m_BundledAssetProviderType:
m_AssemblyName:
m_ClassName:
m_ForceUniqueProvider: 0
m_UseAssetBundleCache: 1
m_UseAssetBundleCrc: 1
m_UseAssetBundleCrcForCachedBundles: 1
m_UseUWRForLocalBundles: 0
m_Timeout: 0
m_ChunkedTransfer: 0
m_RedirectLimit: -1
m_RetryCount: 0
m_BuildPath:
m_Id:
m_LoadPath:
m_Id:
m_BundleMode: 0
m_AssetBundleProviderType:
m_AssemblyName:
m_ClassName:
m_BundleNaming: 0
m_AssetLoadMode: 0
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 1a3c5d64ac83548c09dd1678b9f6f1cd, type: 3}
m_Name: Packed Assets
m_EditorClassIdentifier:
m_SchemaObjects:
- {fileID: -6130888278409392347}
- {fileID: 5814898001239217010}
m_Description: Pack assets into asset bundles.
m_Settings: {fileID: 11400000, guid: 43329c4cc56ca415da37a048e434183a, type: 2}
--- !u!114 &5814898001239217010
MonoBehaviour:
m_ObjectHideFlags: 1
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5834b5087d578d24c926ce20cd31e6d6, type: 3}
m_Name: ContentUpdateGroupSchema
m_EditorClassIdentifier:
m_Group: {fileID: 0}
m_StaticContent: 0
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e03fdb26845f04c75b6fe9288c63a63a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 022ed075843094601944a986a7c4ea61
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,34 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bbb281ee3bf0b054c82ac2347e9e782c, type: 3}
m_Name: Built In Data
m_EditorClassIdentifier:
m_GroupName: Built In Data
m_Data:
m_SerializedData: []
m_GUID: 05078fdb0a88640219afbdb7f385d64e
m_SerializeEntries:
- m_GUID: EditorSceneList
m_Address: EditorSceneList
m_ReadOnly: 1
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
- m_GUID: Resources
m_Address: Resources
m_ReadOnly: 1
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
m_ReadOnly: 1
m_Settings: {fileID: 11400000, guid: 43329c4cc56ca415da37a048e434183a, type: 2}
m_SchemaSet:
m_Schemas:
- {fileID: 11400000, guid: b05efeaac5be043d1b4b6fd1077db150, type: 2}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d990055319c2b44b0b81ce4e3045db49
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,30 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bbb281ee3bf0b054c82ac2347e9e782c, type: 3}
m_Name: Default Local Group
m_EditorClassIdentifier:
m_GroupName: Default Local Group
m_Data:
m_SerializedData: []
m_GUID: 78c1e50bdf28744fc9af8aedb47f2517
m_SerializeEntries:
- m_GUID: d9f8e387c42cf4a6785eb5cf2a94beae
m_Address: Assets/ProjectSettings/UIEffectProjectSettings.asset
m_ReadOnly: 0
m_SerializedLabels: []
FlaggedDuringContentUpdateRestriction: 0
m_ReadOnly: 0
m_Settings: {fileID: 11400000, guid: 43329c4cc56ca415da37a048e434183a, type: 2}
m_SchemaSet:
m_Schemas:
- {fileID: 11400000, guid: 1357ca7896c984ca2bec3ee274fc2b16, type: 2}
- {fileID: 11400000, guid: 2796025dd70994899bc32992cf7024c9, type: 2}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: cb582cfe3736847f09b83adf8d15c36a
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 6f4bdfbde85c84294892ee4118bf99c8
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,17 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: b1487f5d688e4f94f828f879d599dbdc, type: 3}
m_Name: Built In Data_PlayerDataGroupSchema
m_EditorClassIdentifier:
m_Group: {fileID: 11400000, guid: d990055319c2b44b0b81ce4e3045db49, type: 2}
m_IncludeResourcesFolders: 1
m_IncludeBuildSettingsScenes: 1
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b05efeaac5be043d1b4b6fd1077db150
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,45 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: e5d17a21594effb4e9591490b009e7aa, type: 3}
m_Name: Default Local Group_BundledAssetGroupSchema
m_EditorClassIdentifier:
m_Group: {fileID: 11400000, guid: cb582cfe3736847f09b83adf8d15c36a, type: 2}
m_InternalBundleIdMode: 1
m_Compression: 1
m_IncludeAddressInCatalog: 1
m_IncludeGUIDInCatalog: 1
m_IncludeLabelsInCatalog: 1
m_InternalIdNamingMode: 0
m_CacheClearBehavior: 0
m_IncludeInBuild: 1
m_BundledAssetProviderType:
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.BundledAssetProvider
m_ForceUniqueProvider: 0
m_UseAssetBundleCache: 1
m_UseAssetBundleCrc: 1
m_UseAssetBundleCrcForCachedBundles: 1
m_UseUWRForLocalBundles: 0
m_Timeout: 0
m_ChunkedTransfer: 0
m_RedirectLimit: -1
m_RetryCount: 0
m_BuildPath:
m_Id: c903326cd5c18420c8e3c894b1648d26
m_LoadPath:
m_Id: 45c7a530ddf2f4d138f32bf67335f91b
m_BundleMode: 0
m_AssetBundleProviderType:
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.AssetBundleProvider
m_BundleNaming: 0
m_AssetLoadMode: 0
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1357ca7896c984ca2bec3ee274fc2b16
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,16 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 5834b5087d578d24c926ce20cd31e6d6, type: 3}
m_Name: Default Local Group_ContentUpdateGroupSchema
m_EditorClassIdentifier:
m_Group: {fileID: 11400000, guid: cb582cfe3736847f09b83adf8d15c36a, type: 2}
m_StaticContent: 0
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 2796025dd70994899bc32992cf7024c9
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 7c26ed2464c14469b95f5e97b5f2428c
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,20 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 88d21199f5d473f4db36845f2318f180, type: 3}
m_Name: BuildScriptFastMode
m_EditorClassIdentifier:
instanceProviderType:
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider
sceneProviderType:
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.SceneProvider
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 797c488c7f2114197a8f18811c5cd128
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,20 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3e2e0ffa088c91d41a086d0b8cb16bdc, type: 3}
m_Name: BuildScriptPackedMode
m_EditorClassIdentifier:
instanceProviderType:
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider
sceneProviderType:
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.SceneProvider
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: afc7e8697497b41f2ac9064294b360eb
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,20 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ad8c280d42ee0ed41a27db23b43dd2bf, type: 3}
m_Name: BuildScriptPackedPlayMode
m_EditorClassIdentifier:
instanceProviderType:
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider
sceneProviderType:
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.SceneProvider
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 96f4fd6856bbb4d5998503b7b5d15151
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,20 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: bb0e4994b34add1409fd8ccaf4a82de5, type: 3}
m_Name: BuildScriptVirtualMode
m_EditorClassIdentifier:
instanceProviderType:
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.InstanceProvider
sceneProviderType:
m_AssemblyName: Unity.ResourceManager, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null
m_ClassName: UnityEngine.ResourceManagement.ResourceProviders.SceneProvider
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1400420db15a741b5a71c357c678c805
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,15 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3a189bb168d8d90478a09ea08c2f3d72, type: 3}
m_Name: DefaultObject
m_EditorClassIdentifier:
m_AddressableAssetSettingsGuid: 43329c4cc56ca415da37a048e434183a
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c73d220faf28240f1a28d59807c79b75
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 481f0900af5824be89c275390a9fa0b4
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+22
View File
@@ -0,0 +1,22 @@
using System.Collections;
using Coffee.UIEffects;
using UnityEngine;
using UnityEngine.AddressableAssets;
using UnityEngine.SceneManagement;
public class HotUpdate : MonoBehaviour
{
private IEnumerator Start()
{
const string k_SettingsAddress = "Assets/ProjectSettings/UIEffectProjectSettings.asset";
yield return Addressables.LoadAssetAsync<UIEffectProjectSettings>(k_SettingsAddress);
#if UNITY_2022_2_OR_NEWER
while (UIEffectProjectSettings.shaderVariantCollection.WarmUpProgressively(5) == false) yield return null;
#else
UIEffectProjectSettings.shaderVariantCollection.WarmUp();
#endif
yield return SceneManager.LoadSceneAsync(gameObject.scene.buildIndex + 1, LoadSceneMode.Single);
}
}
@@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 7f0dee01a862040a58ac6b6057944cd3
guid: 0fd13d911290d4262ad39fa2c45e030c
MonoImporter:
externalObjects: {}
serializedVersion: 2
+173
View File
@@ -0,0 +1,173 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!29 &1
OcclusionCullingSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_OcclusionBakeSettings:
smallestOccluder: 5
smallestHole: 0.25
backfaceThreshold: 100
m_SceneGUID: 00000000000000000000000000000000
m_OcclusionCullingData: {fileID: 0}
--- !u!104 &2
RenderSettings:
m_ObjectHideFlags: 0
serializedVersion: 9
m_Fog: 0
m_FogColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
m_FogMode: 3
m_FogDensity: 0.01
m_LinearFogStart: 0
m_LinearFogEnd: 300
m_AmbientSkyColor: {r: 0.212, g: 0.227, b: 0.259, a: 1}
m_AmbientEquatorColor: {r: 0.114, g: 0.125, b: 0.133, a: 1}
m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1}
m_AmbientIntensity: 1
m_AmbientMode: 0
m_SubtractiveShadowColor: {r: 0.42, g: 0.478, b: 0.627, a: 1}
m_SkyboxMaterial: {fileID: 10304, guid: 0000000000000000f000000000000000, type: 0}
m_HaloStrength: 0.5
m_FlareStrength: 1
m_FlareFadeSpeed: 3
m_HaloTexture: {fileID: 0}
m_SpotCookie: {fileID: 10001, guid: 0000000000000000e000000000000000, type: 0}
m_DefaultReflectionMode: 0
m_DefaultReflectionResolution: 128
m_ReflectionBounces: 1
m_ReflectionIntensity: 1
m_CustomReflection: {fileID: 0}
m_Sun: {fileID: 0}
m_UseRadianceAmbientProbe: 0
--- !u!157 &3
LightmapSettings:
m_ObjectHideFlags: 0
serializedVersion: 12
m_GIWorkflowMode: 1
m_GISettings:
serializedVersion: 2
m_BounceScale: 1
m_IndirectOutputScale: 1
m_AlbedoBoost: 1
m_EnvironmentLightingMode: 0
m_EnableBakedLightmaps: 1
m_EnableRealtimeLightmaps: 0
m_LightmapEditorSettings:
serializedVersion: 12
m_Resolution: 2
m_BakeResolution: 40
m_AtlasSize: 1024
m_AO: 0
m_AOMaxDistance: 1
m_CompAOExponent: 1
m_CompAOExponentDirect: 0
m_ExtractAmbientOcclusion: 0
m_Padding: 2
m_LightmapParameters: {fileID: 0}
m_LightmapsBakeMode: 1
m_TextureCompression: 1
m_FinalGather: 0
m_FinalGatherFiltering: 1
m_FinalGatherRayCount: 256
m_ReflectionCompression: 2
m_MixedBakeMode: 2
m_BakeBackend: 1
m_PVRSampling: 1
m_PVRDirectSampleCount: 32
m_PVRSampleCount: 512
m_PVRBounces: 2
m_PVREnvironmentSampleCount: 256
m_PVREnvironmentReferencePointCount: 2048
m_PVRFilteringMode: 1
m_PVRDenoiserTypeDirect: 1
m_PVRDenoiserTypeIndirect: 1
m_PVRDenoiserTypeAO: 1
m_PVRFilterTypeDirect: 0
m_PVRFilterTypeIndirect: 0
m_PVRFilterTypeAO: 0
m_PVREnvironmentMIS: 1
m_PVRCulling: 1
m_PVRFilteringGaussRadiusDirect: 1
m_PVRFilteringGaussRadiusIndirect: 5
m_PVRFilteringGaussRadiusAO: 2
m_PVRFilteringAtrousPositionSigmaDirect: 0.5
m_PVRFilteringAtrousPositionSigmaIndirect: 2
m_PVRFilteringAtrousPositionSigmaAO: 1
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
m_LightingDataAsset: {fileID: 0}
m_LightingSettings: {fileID: 0}
--- !u!196 &4
NavMeshSettings:
serializedVersion: 2
m_ObjectHideFlags: 0
m_BuildSettings:
serializedVersion: 3
agentTypeID: 0
agentRadius: 0.5
agentHeight: 2
agentSlope: 45
agentClimb: 0.4
ledgeDropHeight: 0
maxJumpAcrossDistance: 0
minRegionArea: 2
manualCellSize: 0
cellSize: 0.16666667
manualTileSize: 0
tileSize: 256
buildHeightMesh: 0
maxJobWorkers: 0
preserveTilesOutsideBounds: 0
debug:
m_Flags: 0
m_NavMeshData: {fileID: 0}
--- !u!1 &1960556857
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1960556859}
- component: {fileID: 1960556858}
m_Layer: 0
m_Name: GameObject
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!114 &1960556858
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1960556857}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0fd13d911290d4262ad39fa2c45e030c, type: 3}
m_Name:
m_EditorClassIdentifier:
--- !u!4 &1960556859
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1960556857}
serializedVersion: 2
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 169.5, y: 321.5, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!1660057539 &9223372036854775807
SceneRoots:
m_ObjectHideFlags: 0
m_Roots:
- {fileID: 1960556859}
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: 7ec916ecedc5e41a1896062381cbd257
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -172,6 +172,7 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 7d43f626d9b5f4d729097092ded48bdb, type: 3}
m_Name: UIEffectProjectSettings
m_EditorClassIdentifier:
m_PreLoadSettingsInBuild: 1
m_RuntimePresets: []
m_RuntimePresetsV2:
- {fileID: 11400000, guid: 460881a8263ce454799a8c689c28d8c9, type: 2}
@@ -199,5 +200,8 @@ MonoBehaviour:
- key: Hidden/UI/Default (SoftMaskable)
value: Hidden/UI/Default (UIEffect)
m_Asset: {fileID: -8740588384831342173}
m_RegisteredShaders:
- {fileID: 4800000, guid: 935b7be1c88464d2eb87204fdfab5a38, type: 3}
- {fileID: 4800000, guid: 96246b1ead49a4c5a996fd477bc5a117, type: 3}
m_ErrorOnUnregisteredVariant: 0
m_UnregisteredVariants: []
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 39d1ffdf7437242d88b354142d4c7148
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
+8
View File
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 32977ee1433f447db9160bda9852bc14
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,17 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: c1f8983beb12bb84796c28939f4596ab, type: 3}
m_Name: UniTextSettings
m_EditorClassIdentifier:
gradients: {fileID: 11400000, guid: 25571032a92321f4997329d90f499d06, type: 2}
defaultFontStack: {fileID: 11400000, guid: 72f6e3edfbc82804791ebe8e4814fa46, type: 2}
defaultAppearance: {fileID: 11400000, guid: 36ee3940d360ced43a59dd530844bf3d, type: 2}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d2306542229b2418d8d9d4e76b80ed9e
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
+2
View File
@@ -4,9 +4,11 @@
"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.addressables": "1.22.3",
"com.unity.ide.rider": "3.0.38",
"com.unity.test-framework": "1.1.33",
"com.unity.textmeshpro": "3.0.9",
"media.lightside.unitext": "https://github.com/mob-sakai/UniText.git",
"com.unity.modules.animation": "1.0.0"
}
}
+59 -1
View File
@@ -38,6 +38,20 @@
"com.unity.ugui": "1.0.0"
}
},
"com.unity.addressables": {
"version": "1.22.3",
"depth": 0,
"source": "registry",
"dependencies": {
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0",
"com.unity.modules.imageconversion": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0",
"com.unity.scriptablebuildpipeline": "1.21.25",
"com.unity.modules.unitywebrequestassetbundle": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.ext.nunit": {
"version": "1.0.6",
"depth": 1,
@@ -54,6 +68,13 @@
},
"url": "https://packages.unity.com"
},
"com.unity.scriptablebuildpipeline": {
"version": "1.21.25",
"depth": 1,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.test-framework": {
"version": "1.1.33",
"depth": 0,
@@ -83,12 +104,34 @@
"com.unity.modules.imgui": "1.0.0"
}
},
"media.lightside.unitext": {
"version": "https://github.com/mob-sakai/UniText.git",
"depth": 0,
"source": "git",
"dependencies": {
"com.unity.ugui": "1.0.0",
"com.unity.modules.ui": "1.0.0"
},
"hash": "5fd42d0037fab4467a82299391ae54cd7faf8466"
},
"com.unity.modules.animation": {
"version": "1.0.0",
"depth": 0,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.assetbundle": {
"version": "1.0.0",
"depth": 1,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.imageconversion": {
"version": "1.0.0",
"depth": 1,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.imgui": {
"version": "1.0.0",
"depth": 1,
@@ -103,9 +146,24 @@
},
"com.unity.modules.ui": {
"version": "1.0.0",
"depth": 2,
"depth": 1,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.unitywebrequest": {
"version": "1.0.0",
"depth": 1,
"source": "builtin",
"dependencies": {}
},
"com.unity.modules.unitywebrequestassetbundle": {
"version": "1.0.0",
"depth": 1,
"source": "builtin",
"dependencies": {
"com.unity.modules.assetbundle": "1.0.0",
"com.unity.modules.unitywebrequest": "1.0.0"
}
}
}
}
+24
View File
@@ -1,3 +1,27 @@
## [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)
@@ -16,6 +16,7 @@ namespace Coffee.UIEffects.Editors
private SerializedProperty _runtimePresets;
private SerializedProperty _runtimePresetsV2;
private SerializedProperty _useHDRColorPicker;
private SerializedProperty _preLoadSettingsInBuild;
private bool _isInitialized;
private ShaderVariantRegistryEditor _shaderVariantRegistryEditor;
private UIEffect[] _legacyPresets;
@@ -29,6 +30,7 @@ namespace Coffee.UIEffects.Editors
_useHDRColorPicker = serializedObject.FindProperty("m_UseHDRColorPicker");
_runtimePresets = serializedObject.FindProperty("m_RuntimePresets");
_runtimePresetsV2 = serializedObject.FindProperty("m_RuntimePresetsV2");
_preLoadSettingsInBuild = serializedObject.FindProperty("m_PreLoadSettingsInBuild");
_reorderableList = new ReorderableList(serializedObject, _runtimePresetsV2, true, true, true, true);
_reorderableList.drawHeaderCallback = rect => EditorGUI.LabelField(rect, "Runtime Presets");
@@ -77,6 +79,7 @@ namespace Coffee.UIEffects.Editors
// Editor
// Use HDR color pickers.
EditorGUIUtility.labelWidth = 200;
EditorGUILayout.PropertyField(_useHDRColorPicker);
// Shader
@@ -95,6 +98,24 @@ namespace Coffee.UIEffects.Editors
}
_shaderVariantRegistryEditor.Draw();
EditorGUILayout.Space();
EditorGUILayout.LabelField("Advanced", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(_preLoadSettingsInBuild);
if (!_preLoadSettingsInBuild.boolValue)
{
EditorGUILayout.BeginHorizontal();
EditorGUILayout.HelpBox("UIEffectProjectSettings asset will not be built in." +
"please load manually from Resources, AssetBundle, or Addressables before using UIEffect.",
MessageType.Warning);
if (GUILayout.Button("Ping"))
{
EditorGUIUtility.PingObject(target);
}
EditorGUILayout.EndHorizontal();
}
GUILayout.FlexibleSpace();
serializedObject.ApplyModifiedProperties();
}
@@ -229,8 +229,6 @@ namespace Coffee.UIEffects.Editors
EditorGUI.indentLevel--;
}
EditorGUI.EndChangeCheck();
// Sampling filter
DrawSeparator();
if (DrawHeaderPopup(_samplingFilter))
+37
View File
@@ -60,6 +60,7 @@ Apply professional-grade filters like grayscale, blur, and dissolve directly fro
- [Usage with SoftMaskForUGUI](#usage-with-softmaskforugui)
- [Usage with ShaderGraph](#usage-with-shadergraph)
- [Usage with Timeline](#usage-with-timeline)
- [Usage with Custom Shader](#usage-with-custom-shader)
- [Runtime/Editor Preset for UIEffect](#runtimeeditor-preset-for-uieffect)
- [Usage with Code](#usage-with-code)
- [Project Settings](#project-settings)
@@ -514,6 +515,8 @@ Click the `Import` button.
### Usage with ShaderGraph
⚠️ ShaderGraph support is available only in Unity 2023.2/6.0 or later.
![](https://github.com/mob-sakai/mob-sakai/releases/download/docs/1744307236288.png)
To use UIEffect with ShaderGraph, you need to import additional resources.
@@ -543,6 +546,25 @@ Timeline is a powerful animation tool that can control UIEffect using `ControlTr
<br><br>
### Usage with Custom Shader
To make your custom shader support UIEffect, it must satisfy the following requirements.
Refer to the sections enclosed by `==== UIEFFECT START ===` and `==== UIEFFECT END ====` in the built-in `Hidden/UI/Default (UIEffect)` shader included in the package.
https://github.com/mob-sakai/UIEffect/blob/main/Packages/src/Shaders/UIEffect.shader
- Blend: `Blend [_SrcBlend] [_DstBlend]`
- Shader variants: `#pragma shader_feature_local_fragment ***`
- Vertex shader input structure: `float4 uvMask : TEXCOORD***;`
- Vertex shader: `OUT.uvMask = v.uvMask;` and `OUT.worldPosition = v.vertex;`
- Pixel shader input structure: `float4 uvMask : TEXCOORD***;` and `float4 worldPosition : TEXCOORD***;`
- UIEffect micro pixel shader: a function that returns the color of the specified pixel and has the signature `half4 uieffect_frag(v2f IN, float2 uv)`.
- Pixel shader input structure name definition: `#define UIEFFECT_FRAG_STRUCT v2f`
- Include the UIEffect library: `#include "Packages/com.coffee.ui-effect/Shaders/UIEffect.cginc"`
- Pixel shader: `half4 c = uieffect(IN.texcoord, IN.uvMask, IN.worldPosition, IN);`
<br><br>
### Runtime/Editor Preset for UIEffect
![](https://github.com/mob-sakai/mob-sakai/releases/download/docs/uieffect5.7.0-inspector-preset.png)
@@ -629,6 +651,21 @@ You can adjust the project-wide settings for UIEffect. (`Edit > Project Settings
> - The setting file is usually saved in `Assets/ProjectSettings/UIEffectProjectSettings.asset`. Include this file in your version control system.
> - The setting file is automatically added as a preloaded asset in `ProjectSettings/ProjectSettings.asset`.
#### Advanced
- **Pre Load Settings In Build**: When enabled, this settings asset will be added to `PlayerSettings.preloadedAssets` in build.
- When disable, you should load this settings via `Resources`, `AssetBundles` or `Addressables` to use `UIEffect`.
- You can overwrite the settings by re-enabling `UIEffectProjectSettings`. This allows you to hot update shader variants and presets.
```csharp
private static IEnumerator HotUpdateCoroutine()
{
const string k_SettingsAddress = "Assets/ProjectSettings/UIEffectProjectSettings.asset";
yield return Addressables.LoadAssetAsync<UIEffectProjectSettings>(k_SettingsAddress);
while (UIEffectProjectSettings.shaderVariantCollection.WarmUpProgressively(5) == false) yield return null;
}
```
<br><br>
### :warning: Limitations
+8 -2
View File
@@ -3,7 +3,8 @@
"rootNamespace": "",
"references": [
"GUID:6055be8ebefd69e48b49212b09b47b2f",
"GUID:f06555f75b070af458a003d92f9efb00"
"GUID:f06555f75b070af458a003d92f9efb00",
"GUID:6572381e8157783499bf6ce8f56b9292"
],
"includePlatforms": [],
"excludePlatforms": [],
@@ -32,7 +33,12 @@
"name": "com.unity.textmeshpro",
"expression": "[1.0.0,3.2.0-pre.1)",
"define": "LEGACY_TMP_ENABLE"
},
{
"name": "media.lightside.unitext",
"expression": "",
"define": "UNITEXT_ENABLE"
}
],
"noEngineReferences": false
}
}
@@ -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>
@@ -80,6 +80,15 @@ namespace Coffee.UIEffectInternal
InternalListPool<int>.Return(ref intList);
}
public static void CopyTo(this VertexHelper self, Mesh dst)
{
if (self == null || dst == null) return;
dst.Clear(false);
self.FillMesh(dst);
dst.RecalculateBounds();
}
public static void CopyTo(this Mesh self, VertexHelper dst)
{
if (!self || dst == null) return;
@@ -14,6 +14,14 @@ namespace Coffee.UIEffectInternal
public abstract class PreloadedProjectSettings : ScriptableObject
#if UNITY_EDITOR
{
[Tooltip("When enabled, this settings asset will be added to PlayerSettings.preloadedAssets in build.\n\n" +
"When disable, you should load this settings via Resources, AssetBundles or " +
"Addressables to use UIEffect.")]
[SerializeField]
private bool m_PreLoadSettingsInBuild = true;
protected static bool s_BuildingPlayer;
private class Postprocessor : AssetPostprocessor
{
private static void OnPostprocessAllAssets(string[] _, string[] __, string[] ___, string[] ____)
@@ -22,13 +30,35 @@ namespace Coffee.UIEffectInternal
}
}
private class PreprocessBuildWithReport : IPreprocessBuildWithReport
private class ExcludeFromBuild : IPreprocessBuildWithReport, IPostprocessBuildWithReport
{
int IOrderedCallback.callbackOrder => 0;
void IPreprocessBuildWithReport.OnPreprocessBuild(BuildReport report)
{
Initialize();
s_BuildingPlayer = true;
foreach (var t in TypeCache.GetTypesDerivedFrom(typeof(PreloadedProjectSettings<>)))
{
var settings = GetDefaultSettings(t);
if (!settings || settings.m_PreLoadSettingsInBuild) continue;
PlayerSettings.SetPreloadedAssets(
PlayerSettings.GetPreloadedAssets()
.Where(x => x && x.GetType() != t)
.ToArray());
Debug.Log($"[PreloadedProjectSettings] Build started: removed '{settings.name}' " +
$"({t.Name}) from PreloadedAssets. " +
$"It will be restored after build completes.");
}
}
void IPostprocessBuildWithReport.OnPostprocessBuild(BuildReport report)
{
s_BuildingPlayer = false;
Initialize();
}
}
@@ -37,18 +67,18 @@ 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;
SetDefaultSettings(defaultSettings);
if (!s_BuildingPlayer) SetDefaultSettings(defaultSettings);
}
else if (GetPreloadedSettings(t).Length != 1)
{
SetDefaultSettings(defaultSettings);
if (!s_BuildingPlayer) SetDefaultSettings(defaultSettings);
}
if (defaultSettings)
if (defaultSettings != null)
{
defaultSettings.OnInitialize();
}
@@ -66,7 +96,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 +106,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 +133,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,25 +163,25 @@ 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;
}
SetDefaultSettings(s_Instance);
if (!s_BuildingPlayer) SetDefaultSettings(s_Instance);
return s_Instance;
}
}
@@ -176,7 +206,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>
@@ -185,7 +215,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,9 +223,12 @@ namespace Coffee.UIEffectInternal
}
EditorApplication.playModeStateChanged += OnPlayModeStateChanged;
#else
if (s_Instance && s_Instance != this)
{
Destroy(s_Instance);
}
#endif
if (s_Instance) return;
s_Instance = this as T;
}
@@ -224,7 +257,7 @@ namespace Coffee.UIEffectInternal
public override void OnGUI(string searchContext)
{
if (!_target)
if (_target == null)
{
if (_editor)
{
@@ -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,11 @@
fileFormatVersion: 2
guid: a2fa34e76bcd14489a1af18b393c3e65
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -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);
}
@@ -6,7 +6,7 @@ namespace Coffee.UIEffectInternal
/// <summary>
/// Object pool.
/// </summary>
internal sealed class InternalObjectPool<T> where T : class
internal class InternalObjectPool<T> where T : class
{
#if UNITY_2021_1_OR_NEWER
private readonly Predicate<T> _onValid; // Delegate for checking if instances are valid
@@ -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);
}
@@ -45,6 +45,7 @@ namespace Coffee.UIEffectInternal
}
private Dictionary<int, string> _cachedOptionalShaders = new Dictionary<int, string>();
private Dictionary<string, Shader> _shaderByName;
[SerializeField]
private List<StringPair> m_OptionalShaders = new List<StringPair>();
@@ -52,6 +53,9 @@ namespace Coffee.UIEffectInternal
[SerializeField]
internal ShaderVariantCollection m_Asset;
[SerializeField]
private List<Shader> m_RegisteredShaders = new List<Shader>();
#if UNITY_EDITOR
[SerializeField]
private bool m_ErrorOnUnregisteredVariant = false;
@@ -63,6 +67,52 @@ namespace Coffee.UIEffectInternal
public ShaderVariantCollection shaderVariantCollection => m_Asset;
public Func<string, bool> onShaderRequested;
/// <summary>
/// Build the runtime name-to-shader lookup from <see cref="m_RegisteredShaders"/>.
/// When shaders are delivered via AssetBundles (i.e. not in the player build),
/// <see cref="Shader.Find"/> cannot locate them by name. This lookup provides
/// direct references serialized at edit-time as a reliable alternative.
/// </summary>
public void InitializeShaderLookup()
{
var count = m_RegisteredShaders.Count;
if (count == 0) return;
if (_shaderByName == null)
{
_shaderByName = new Dictionary<string, Shader>(count);
}
else
{
_shaderByName.Clear();
}
for (var i = 0; i < count; i++)
{
var s = m_RegisteredShaders[i];
if (s)
{
_shaderByName[s.name] = s;
}
}
}
/// <summary>
/// Find a shader by name. Prefers the registered direct reference from
/// <see cref="m_RegisteredShaders"/> when available, falls back to
/// <see cref="Shader.Find"/> otherwise. This ensures correct behavior in both
/// built-in delivery (PreloadedAssets) and external delivery (AssetBundle) modes.
/// </summary>
public Shader FindShaderByName(string name)
{
if (_shaderByName != null && _shaderByName.TryGetValue(name, out var shader) && shader)
{
return shader;
}
return Shader.Find(name);
}
public Shader FindOptionalShader(Shader shader,
string requiredName,
string format,
@@ -71,10 +121,10 @@ 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);
return FindShaderByName(optionalShaderName);
}
// The shader has required name.
@@ -92,7 +142,7 @@ namespace Coffee.UIEffectInternal
{
var pair = m_OptionalShaders[i];
if (pair.key != shaderName) continue;
optionalShader = Shader.Find(pair.value);
optionalShader = FindShaderByName(pair.value);
if (!optionalShader) continue;
_cachedOptionalShaders[id] = pair.value;
return optionalShader;
@@ -100,7 +150,7 @@ namespace Coffee.UIEffectInternal
// Find optional shader by format.
optionalShaderName = string.Format(format, shaderName);
optionalShader = Shader.Find(optionalShaderName);
optionalShader = FindShaderByName(optionalShaderName);
if (optionalShader)
{
_cachedOptionalShaders[id] = optionalShaderName;
@@ -110,13 +160,13 @@ namespace Coffee.UIEffectInternal
#if UNITY_EDITOR
if (onShaderRequested?.Invoke(optionalShaderName) ?? false)
{
return Shader.Find(defaultOptionalShaderName);
return FindShaderByName(defaultOptionalShaderName);
}
#endif
// Find default optional shader.
_cachedOptionalShaders[id] = defaultOptionalShaderName;
return Shader.Find(defaultOptionalShaderName);
return FindShaderByName(defaultOptionalShaderName);
}
#if UNITY_EDITOR
@@ -208,10 +258,37 @@ namespace Coffee.UIEffectInternal
AssetDatabase.SaveAssets();
}
SyncRegisteredShaders(owner);
ClearCache();
Profiler.EndSample();
}
/// <summary>
/// Sync <see cref="m_RegisteredShaders"/> based on the current delivery mode.
/// When <see cref="PreloadedProjectSettings.excludeFromPreloadedAssetsWhenBuildPlayer"/> is enabled,
/// extracts shader references from the SVC so they can be resolved at runtime
/// without <see cref="Shader.Find"/>. Otherwise clears the list to avoid
/// stale references and unnecessary asset dependencies.
/// </summary>
private void SyncRegisteredShaders(Object owner)
{
var so = new SerializedObject(m_Asset);
var shaders = so.FindProperty("m_Shaders");
m_RegisteredShaders.Clear();
for (var i = 0; i < shaders.arraySize; i++)
{
var shaderRef = shaders.GetArrayElementAtIndex(i)
.FindPropertyRelative("first")
.objectReferenceValue as Shader;
if (shaderRef && !m_RegisteredShaders.Contains(shaderRef))
{
m_RegisteredShaders.Add(shaderRef);
}
}
EditorUtility.SetDirty(owner);
}
internal void RegisterVariant(Material material, string path)
{
if (!material || !material.shader || !m_Asset) return;
@@ -270,7 +347,7 @@ namespace Coffee.UIEffectInternal
_sb.Length--; // Remove last space.
}
var hash = new Hash128((uint)shader.GetInstanceID(), (uint)GetContentsHash(_sb), 0, 0);
var hash = new Hash128((uint)shader.GetHashCode(), (uint)GetContentsHashCode(_sb), 0, 0);
if (_cachedVariants.TryGetValue(hash, out var result))
{
Profiler.EndSample();
@@ -289,7 +366,7 @@ namespace Coffee.UIEffectInternal
return (variant, pair);
}
private static int GetContentsHash(StringBuilder sb)
private static int GetContentsHashCode(StringBuilder sb)
{
var hash = 17;
for (var i = 0; i < sb.Length; i++)
@@ -429,10 +506,7 @@ namespace Coffee.UIEffectInternal
EditorGUILayout.Space(-20);
}
var labelWidth = EditorGUIUtility.labelWidth;
EditorGUIUtility.labelWidth = 180;
EditorGUILayout.PropertyField(_errorOnUnregisteredVariant);
EditorGUIUtility.labelWidth = labelWidth;
}
private static void AddVariant(ShaderVariantCollection collection, string shaderName, string keywords)
@@ -1,8 +1,8 @@
using System;
using System.Reflection;
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
using System.Reflection;
namespace Coffee.UIEffectInternal
{
@@ -21,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>
@@ -78,7 +78,7 @@ namespace Coffee.UIEffectInternal
#endif
Canvas.willRenderCanvases -= OnAfterCanvasRebuild;
Canvas.willRenderCanvases += OnAfterCanvasRebuild;
Logging.LogMulticast(typeof(Canvas), "willRenderCanvases",
Logger.LogMulticast(typeof(Canvas), "willRenderCanvases",
message: "InitializeAfterCanvasRebuild");
}
+64 -52
View File
@@ -298,7 +298,7 @@ namespace Coffee.UIEffects
value = Mathf.Clamp(value, 0, 1);
if (Mathf.Approximately(m_ToneIntensity, value)) return;
context.m_ToneIntensity = m_ToneIntensity = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -328,7 +328,7 @@ namespace Coffee.UIEffects
value = Mathf.Clamp(value, 0, 1);
if (Mathf.Approximately(m_ColorIntensity, value)) return;
context.m_ColorIntensity = m_ColorIntensity = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -340,7 +340,7 @@ namespace Coffee.UIEffects
m_Color.a = 1;
if (m_Color == value) return;
context.m_Color = m_Color = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -417,7 +417,7 @@ namespace Coffee.UIEffects
{
if (m_ColorGlow == value) return;
context.m_ColorGlow = m_ColorGlow = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -447,7 +447,7 @@ namespace Coffee.UIEffects
value = Mathf.Clamp(value, 0, 1);
if (Mathf.Approximately(m_SamplingIntensity, value)) return;
context.m_SamplingIntensity = m_SamplingIntensity = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -459,7 +459,7 @@ namespace Coffee.UIEffects
value = Mathf.Clamp(value, 0.5f, 10);
if (Mathf.Approximately(m_SamplingWidth, value)) return;
context.m_SamplingWidth = m_SamplingWidth = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -505,7 +505,7 @@ namespace Coffee.UIEffects
value = Mathf.Clamp(value, 0, 1);
if (Mathf.Approximately(m_TransitionRate, value)) return;
context.m_TransitionRate = m_TransitionRate = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -516,7 +516,7 @@ namespace Coffee.UIEffects
{
if (m_TransitionReverse == value) return;
context.m_TransitionReverse = m_TransitionReverse = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -527,7 +527,7 @@ namespace Coffee.UIEffects
{
if (m_TransitionTex == value) return;
context.m_TransitionTex = m_TransitionTex = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -538,7 +538,7 @@ namespace Coffee.UIEffects
{
if (m_TransitionTexScale == value) return;
context.m_TransitionTexScale = m_TransitionTexScale = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -549,7 +549,7 @@ namespace Coffee.UIEffects
{
if (m_TransitionTexOffset == value) return;
context.m_TransitionTexOffset = m_TransitionTexOffset = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -560,7 +560,7 @@ namespace Coffee.UIEffects
{
if (m_TransitionTexSpeed == value) return;
context.m_TransitionTexSpeed = m_TransitionTexSpeed = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -592,7 +592,7 @@ namespace Coffee.UIEffects
value = Mathf.Clamp(value, 0, 1);
if (Mathf.Approximately(m_TransitionWidth, value)) return;
context.m_TransitionWidth = m_TransitionWidth = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -604,7 +604,7 @@ namespace Coffee.UIEffects
value = Mathf.Clamp(value, 0, 1);
if (Mathf.Approximately(m_TransitionSoftness, value)) return;
context.m_TransitionSoftness = m_TransitionSoftness = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -615,7 +615,7 @@ namespace Coffee.UIEffects
{
if (m_TransitionRange.Approximately(value)) return;
context.m_TransitionRange = m_TransitionRange = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -637,7 +637,7 @@ namespace Coffee.UIEffects
{
if (m_TransitionColor == value) return;
context.m_TransitionColor = m_TransitionColor = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -714,7 +714,7 @@ namespace Coffee.UIEffects
{
if (m_TransitionColorGlow == value) return;
context.m_TransitionColorGlow = m_TransitionColorGlow = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -725,7 +725,7 @@ namespace Coffee.UIEffects
{
if (m_TransitionPatternReverse == value) return;
context.m_TransitionPatternReverse = m_TransitionPatternReverse = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -737,7 +737,7 @@ namespace Coffee.UIEffects
value = Mathf.Clamp(value, -5, 5);
if (Mathf.Approximately(m_TransitionAutoPlaySpeed, value)) return;
context.m_TransitionAutoPlaySpeed = m_TransitionAutoPlaySpeed = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -759,7 +759,7 @@ namespace Coffee.UIEffects
{
if (m_TargetColor == value) return;
context.m_TargetColor = m_TargetColor = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -771,7 +771,7 @@ namespace Coffee.UIEffects
value = Mathf.Clamp(value, 0, 1);
if (Mathf.Approximately(m_TargetRange, value)) return;
context.m_TargetRange = m_TargetRange = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -783,7 +783,7 @@ namespace Coffee.UIEffects
value = Mathf.Clamp(value, 0, 1);
if (Mathf.Approximately(m_TargetSoftness, value)) return;
context.m_TargetSoftness = m_TargetSoftness = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -902,7 +902,7 @@ namespace Coffee.UIEffects
value = Mathf.Clamp(value, 0, 1);
if (Mathf.Approximately(m_ShadowBlurIntensity, value)) return;
context.m_ShadowBlurIntensity = m_ShadowBlurIntensity = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -924,7 +924,7 @@ namespace Coffee.UIEffects
{
if (m_ShadowColor == value) return;
context.m_ShadowColor = m_ShadowColor = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -1008,7 +1008,7 @@ namespace Coffee.UIEffects
{
if (m_ShadowColorGlow == value) return;
context.m_ShadowColorGlow = m_ShadowColorGlow = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -1032,7 +1032,7 @@ namespace Coffee.UIEffects
value = Mathf.Clamp(value, 0, 1);
if (Mathf.Approximately(m_EdgeShinyRate, value)) return;
context.m_EdgeShinyRate = m_EdgeShinyRate = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -1044,7 +1044,7 @@ namespace Coffee.UIEffects
value = Mathf.Clamp(value, 0, 1);
if (Mathf.Approximately(m_EdgeWidth, value)) return;
context.m_EdgeWidth = m_EdgeWidth = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -1066,7 +1066,7 @@ namespace Coffee.UIEffects
{
if (m_EdgeColor == value) return;
context.m_EdgeColor = m_EdgeColor = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -1143,7 +1143,7 @@ namespace Coffee.UIEffects
{
if (m_EdgeColorGlow == value) return;
context.m_EdgeColorGlow = m_EdgeColorGlow = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -1155,7 +1155,7 @@ namespace Coffee.UIEffects
value = Mathf.Clamp(value, 0, 1);
if (Mathf.Approximately(m_EdgeShinyWidth, value)) return;
context.m_EdgeShinyWidth = m_EdgeShinyWidth = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -1167,7 +1167,7 @@ namespace Coffee.UIEffects
value = Mathf.Clamp(value, -5, 5);
if (Mathf.Approximately(m_EdgeShinyAutoPlaySpeed, value)) return;
context.m_EdgeShinyAutoPlaySpeed = m_EdgeShinyAutoPlaySpeed = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -1205,7 +1205,7 @@ namespace Coffee.UIEffects
value = Mathf.Clamp(value, 0, 1);
if (Mathf.Approximately(m_GradationIntensity, value)) return;
context.m_GradationIntensity = m_GradationIntensity = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -1227,7 +1227,7 @@ namespace Coffee.UIEffects
{
if (m_GradationColor1 == value) return;
context.m_GradationColor1 = m_GradationColor1 = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -1238,7 +1238,7 @@ namespace Coffee.UIEffects
{
if (m_GradationColor2 == value) return;
context.m_GradationColor2 = m_GradationColor2 = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -1249,7 +1249,7 @@ namespace Coffee.UIEffects
{
if (m_GradationColor3 == value) return;
context.m_GradationColor3 = m_GradationColor3 = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -1260,7 +1260,7 @@ namespace Coffee.UIEffects
{
if (m_GradationColor4 == value) return;
context.m_GradationColor4 = m_GradationColor4 = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -1271,7 +1271,7 @@ namespace Coffee.UIEffects
{
if (Mathf.Approximately(m_GradationOffset, value)) return;
context.m_GradationOffset = m_GradationOffset = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -1283,7 +1283,7 @@ namespace Coffee.UIEffects
value = Mathf.Clamp(value, 0.01f, 10f);
if (Mathf.Approximately(m_GradationScale, value)) return;
context.m_GradationScale = m_GradationScale = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -1306,7 +1306,7 @@ namespace Coffee.UIEffects
if (m_GradationWrapMode == value) return;
context.m_GradationWrapMode = m_GradationWrapMode = value;
context.SetGradationDirty();
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -1318,7 +1318,7 @@ namespace Coffee.UIEffects
if (m_GradationReverse == value) return;
context.m_GradationReverse = m_GradationReverse = value;
context.SetGradationDirty();
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -1342,7 +1342,7 @@ namespace Coffee.UIEffects
value = Mathf.Clamp(value, 0, 1);
if (Mathf.Approximately(m_DetailIntensity, value)) return;
context.m_DetailIntensity = m_DetailIntensity = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -1353,18 +1353,18 @@ namespace Coffee.UIEffects
{
if (m_DetailThreshold.Approximately(value)) return;
context.m_DetailThreshold = m_DetailThreshold = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
public Color detailColor
{
get => m_EdgeColor;
get => m_DetailColor;
set
{
if (m_EdgeColor == value) return;
context.m_DetailColor = m_EdgeColor = value;
SetMaterialDirty();
if (m_DetailColor == value) return;
context.m_DetailColor = m_DetailColor = value;
SetMaterialContextDirty();
}
}
@@ -1386,7 +1386,7 @@ namespace Coffee.UIEffects
{
if (m_DetailTex == value) return;
context.m_DetailTex = m_DetailTex = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -1397,7 +1397,7 @@ namespace Coffee.UIEffects
{
if (m_DetailTexScale == value) return;
context.m_DetailTexScale = m_DetailTexScale = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -1408,7 +1408,7 @@ namespace Coffee.UIEffects
{
if (m_DetailTexOffset == value) return;
context.m_DetailTexOffset = m_DetailTexOffset = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -1419,7 +1419,7 @@ namespace Coffee.UIEffects
{
if (m_DetailTexSpeed == value) return;
context.m_DetailTexSpeed = m_DetailTexSpeed = value;
SetMaterialDirty();
SetMaterialContextDirty();
}
}
@@ -1522,6 +1522,17 @@ namespace Coffee.UIEffects
}
}
public override void SetMaterialContextDirty()
{
base.SetMaterialContextDirty();
var count = replicas.Count;
for (var i = 0; i < count; i++)
{
if (!replicas[i]) continue;
replicas[i].SetMaterialContextDirty();
}
}
/// <summary>
/// Set gradation gradient's keys.
/// </summary>
@@ -1570,7 +1581,7 @@ namespace Coffee.UIEffects
m_GradationGradient.SetKeys(colorKeys, alphaKeys);
m_GradationGradient.mode = mode;
context?.SetGradationDirty();
SetMaterialDirty();
SetMaterialContextDirty();
}
/// <summary>
@@ -1583,7 +1594,7 @@ namespace Coffee.UIEffects
m_TransitionGradient.SetKeys(colorKeys, alphaKeys);
m_TransitionGradient.mode = mode;
context?.SetTransitionGradationDirty();
SetMaterialDirty();
SetMaterialContextDirty();
}
public override void ApplyContextToMaterial(Material material)
@@ -1811,6 +1822,7 @@ namespace Coffee.UIEffects
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;
+19 -3
View File
@@ -34,10 +34,11 @@ namespace Coffee.UIEffects
private Matrix4x4 _prevTransformHash;
private Canvas _canvas;
private bool _canvasCached = false;
private bool _isContextDirty;
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;
@@ -52,6 +53,7 @@ namespace Coffee.UIEffects
if (!_canvas || !_canvas.isActiveAndEnabled)
{
_canvas = null;
_canvasCached = false;
}
return _canvas;
@@ -136,6 +138,13 @@ namespace Coffee.UIEffects
private void OnAfterCanvasRebuild()
{
if (!_material || !graphic || !canvas || context == null) return;
if (_isContextDirty)
{
_isContextDirty = false;
ApplyContextToMaterial(GetCurrentMaterial());
}
if (!context.useViewMatrix) return;
context.UpdateViewMatrix(GetCurrentMaterial(), transitionRoot, canvas.rootCanvas);
@@ -187,8 +196,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");
@@ -255,10 +264,16 @@ namespace Coffee.UIEffects
if (graphic)
{
graphic.SetMaterialDirty();
SetMaterialContextDirty();
Misc.QueuePlayerLoopUpdate();
}
}
public virtual void SetMaterialContextDirty()
{
_isContextDirty = true;
}
internal void ReleaseMaterial()
{
MaterialRepository.Release(ref _material);
@@ -270,6 +285,7 @@ namespace Coffee.UIEffects
{
if (!isActiveAndEnabled || context == null || !material) return;
_isContextDirty = false;
context.ApplyToMaterial(material, actualSamplingScale);
#if UNITY_EDITOR
@@ -83,6 +83,14 @@ namespace Coffee.UIEffects
#pragma warning restore CS0618
}
#if !UNITY_EDITOR
protected override void OnEnable()
{
base.OnEnable();
m_ShaderVariantRegistry.InitializeShaderLookup();
}
#endif
#if UNITY_EDITOR
private const string k_PresetDir = "UIEffectPresets";
private const string k_PresetSaveDir = "Assets/ProjectSettings/" + k_PresetDir;
@@ -112,7 +120,10 @@ namespace Coffee.UIEffects
// ShaderGraph Support
("Shader Graphs/UISample (UIEffect)", "ShaderGraph Support (Unity 6 BuiltIn)", "v5.9.0"),
("Shader Graphs/UISampleURP (UIEffect)", "ShaderGraph Support (Unity 6 URP)", "v5.9.0")
("Shader Graphs/UISampleURP (UIEffect)", "ShaderGraph Support (Unity 6 URP)", "v5.9.0"),
// UniText Support
("Hidden/UniText/Mobile/SDF (UIEffect)", "UniText Support", "v5.9.0")
});
ShaderSampleImporter.RegisterShaderAliases(new[]
{
@@ -214,6 +225,7 @@ namespace Coffee.UIEffects
base.OnEnable();
m_ShaderVariantRegistry.onShaderRequested = ShaderSampleImporter.ImportShaderIfSelected;
m_ShaderVariantRegistry.ClearCache();
m_ShaderVariantRegistry.InitializeShaderLookup();
}
protected override void OnCreateAsset()
+30 -2
View File
@@ -102,8 +102,8 @@ namespace Coffee.UIEffects
public override uint effectId => target
? target.effectId
: preset
? (uint)preset.GetInstanceID()
: (uint)GetInstanceID();
? (uint)preset.GetHashCode()
: (uint)GetHashCode();
public override UIEffectContext context
@@ -273,5 +273,33 @@ namespace Coffee.UIEffects
m_Preset = null;
}
}
public void SetTarget(UIEffectBase effect)
{
if (effect is UIEffect pEffect)
{
target = pEffect;
preset = null;
useTargetTransform = true;
customRoot = null;
samplingScale = pEffect.samplingScale;
}
else if (effect is UIEffectReplica pReplica)
{
target = pReplica.target;
preset = pReplica.preset;
useTargetTransform = pReplica.useTargetTransform;
customRoot = pReplica.customRoot;
samplingScale = pReplica.samplingScale;
}
else
{
target = null;
preset = null;
useTargetTransform = true;
customRoot = null;
samplingScale = 1;
}
}
}
}
+15 -22
View File
@@ -239,7 +239,7 @@ namespace Coffee.UIEffects
}
else
{
var subMeshUI = GetSubMeshUI(subMeshes, meshInfo.material, i - 1);
var subMeshUI = GetSubMeshUI(subMeshes, meshInfo.material, meshInfo.mesh, i - 1);
if (subMeshUI)
{
subMeshUI.canvasRenderer.SetMesh(s_Mesh);
@@ -269,7 +269,7 @@ namespace Coffee.UIEffects
modifier.ModifyMesh(s_VertexHelper);
}
var subMeshUI = GetSubMeshUI(subMeshes, meshInfo.material, i - 1);
var subMeshUI = GetSubMeshUI(subMeshes, meshInfo.material, meshInfo.mesh, i - 1);
if (!subMeshUI) break;
// fix: TMP Text sprite submesh lost when changing fontMaterial (#368)
@@ -282,25 +282,7 @@ namespace Coffee.UIEffects
});
}
if (effect is UIEffect pEffect && pEffect.isActiveAndEnabled)
{
replica.target = pEffect;
replica.useTargetTransform = true;
replica.customRoot = null;
}
else if (effect is UIEffectReplica pReplica && pReplica.isActiveAndEnabled)
{
replica.target = pReplica.target;
replica.preset = pReplica.preset;
replica.useTargetTransform = pReplica.useTargetTransform;
replica.customRoot = pReplica.customRoot;
}
else
{
replica.target = null;
replica.customRoot = null;
}
replica.SetTarget(effect);
subMeshUI.GetComponents(subModifiers);
foreach (var modifier in subModifiers)
{
@@ -323,12 +305,23 @@ namespace Coffee.UIEffects
Misc.QueuePlayerLoopUpdate();
}
private static TMP_SubMeshUI GetSubMeshUI(List<TMP_SubMeshUI> subMeshes, Material material, int start)
private static TMP_SubMeshUI GetSubMeshUI(List<TMP_SubMeshUI> subMeshes, Material material, Mesh mesh, int start)
{
var count = subMeshes.Count;
if (mesh)
{
for (var j = 0; j < count; j++)
{
var s = subMeshes[(j + start + count) % count];
if (!s) continue;
if (s.mesh == mesh) return s;
}
}
for (var j = 0; j < count; j++)
{
var s = subMeshes[(j + start + count) % count];
if (!s) continue;
if (s.sharedMaterial == material) return s;
}
@@ -0,0 +1,110 @@
#if UNITEXT_ENABLE
using System;
using Coffee.UIEffectInternal;
using LightSide;
using UnityEditor;
using UnityEngine;
using UnityEngine.UI;
namespace Coffee.UIEffects
{
internal sealed class UniTextProxy : GraphicProxy
{
/// <summary>
/// Check if the graphic is valid for this proxy.
/// </summary>
protected override bool IsValid(Graphic graphic)
{
if (!graphic) return false;
if (graphic is UniTextProxyRenderer sub && sub.material != EmojiFont.Material) return true;
return false;
}
/// <summary>
/// Check if the graphic is a text.
/// </summary>
public override bool IsText(Graphic graphic)
{
return true;
}
/// <summary>
/// Called before modifying the mesh.
/// </summary>
public override void OnPreModifyMesh(Graphic graphic, Canvas canvas)
{
UIVertexUtil.onLerpVertex = s_OnLerpVertex;
ShadowUtil.onMarkAsShadow = s_OnMarkAsShadow;
UIEffectContext.onModifyVertex = s_OnModifyVertex;
if (canvas)
{
canvas.additionalShaderChannels |= AdditionalCanvasShaderChannels.TexCoord2;
}
}
public override void SetVerticesDirty(Graphic graphic, bool enabled)
{
graphic.SetVerticesDirty();
}
private static readonly Func<UIVertex, UIVertex, UIVertex, float, UIVertex> s_OnLerpVertex = null;
private static readonly Func<UIVertex, float, UIVertex> s_OnMarkAsShadow =
(vt, s) =>
{
vt.uv2.x -= s;
return vt;
};
private static readonly Func<UIVertex, Rect, UIVertex> s_OnModifyVertex =
(vt, uvMask) =>
{
vt.uv2 = new Vector4(uvMask.xMin, uvMask.yMin, uvMask.xMax, uvMask.yMax);
return vt;
};
#if UNITY_EDITOR
[InitializeOnLoadMethod]
#else
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
#endif
private static void InitializeOnLoad()
{
Register(new UniTextProxy());
UniText.OnChanged -= ModifyMesh;
UniText.OnChanged += ModifyMesh;
}
private static void ModifyMesh(UniText uniText)
{
if (!uniText.TryGetComponent<UIEffectBase>(out var effect)) return;
var renderData = uniText.RenderData;
var subMeshRenderers = uniText.SubMeshRenderers;
for (var i = 0; i < renderData.Count; i++)
{
var r = subMeshRenderers[i].renderer;
if (!r) continue;
if (!r.TryGetComponent<UIEffectReplica>(out var replica))
{
replica = r.gameObject.AddComponent<UIEffectReplica>();
}
if (!r.TryGetComponent<UniTextProxyRenderer>(out var proxyRenderer))
{
proxyRenderer = r.gameObject.AddComponent<UniTextProxyRenderer>();
}
var data = renderData[i];
replica.SetTarget(effect);
proxyRenderer.Rebuild(data.mesh, data.material, data.texture);
}
Misc.QueuePlayerLoopUpdate();
}
}
}
#endif
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 827a8f25c24894cce88887db90b28c1d
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,51 @@
#if UNITEXT_ENABLE
using Coffee.UIEffectInternal;
using UnityEngine;
using UnityEngine.UI;
namespace Coffee.UIEffects
{
[ExecuteAlways]
public class UniTextProxyRenderer : MaskableGraphic
{
public override Texture mainTexture => _texture;
private Mesh _mesh;
private Texture _texture;
private UniTextProxyRenderer()
{
useLegacyMeshGeneration = false;
}
protected override void OnPopulateMesh(VertexHelper vh)
{
_mesh.CopyTo(vh);
var count = vh.currentVertCount;
UIVertex vt = default;
for (var i = 0; i < count; i++)
{
vh.PopulateUIVertex(ref vt, i);
vt.position = new Vector3(vt.position.x, vt.position.y);
vh.SetUIVertex(vt, i);
}
}
public override Material GetModifiedMaterial(Material baseMaterial)
{
return baseMaterial;
}
public void Rebuild(Mesh mesh, Material mat, Texture texture)
{
_mesh = mesh;
_texture = texture;
m_Material = mat;
SetVerticesDirty();
SetMaterialDirty();
Rebuild(CanvasUpdate.PreRender);
}
}
}
#endif
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 443aaaf5e624a48f7b7d799c1314bba1
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,21 +1,19 @@
// ==== UIEFFECT START ====
SurfaceDescriptionInputs _fragInput;
half4 uieffect_frag(float2 uv)
half4 uieffect_frag(SurfaceDescriptionInputs fragInput, float2 uv)
{
float2 prevUv = _fragInput.uv0.xy;
_fragInput.uv0.xy = uv;
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(_fragInput);
_fragInput.uv0.xy = prevUv;
float2 prevUv = fragInput.uv0.xy;
fragInput.uv0.xy = uv;
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(fragInput);
//fragInput.uv0.xy = prevUv;
half alpha = surfaceDescription.Alpha;
return half4(surfaceDescription.BaseColor * alpha + surfaceDescription.Emission, alpha);
}
#define CANVAS_SHADERGRAPH
#define UIEFFECT_FRAG_STRUCT SurfaceDescriptionInputs
#include "Packages/com.coffee.ui-effect/Shaders/UIEffect.cginc"
// ==== UIEFFECT END ====
PackedVaryings vert_override(Attributes input)
{
Varyings output = BuildVaryings(input);
@@ -29,12 +27,11 @@ half4 frag_override(PackedVaryings packedInput) : SV_TARGET
Varyings unpacked = UnpackVaryings(packedInput);
UNITY_SETUP_INSTANCE_ID(unpacked);
UNITY_SETUP_STEREO_EYE_INDEX_POST_VERTEX(unpacked);
SurfaceDescriptionInputs surfaceDescriptionInputs = BuildSurfaceDescriptionInputs(unpacked);
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(surfaceDescriptionInputs);
SurfaceDescriptionInputs fragInput = BuildSurfaceDescriptionInputs(unpacked);
SurfaceDescription surfaceDescription = SurfaceDescriptionFunction(fragInput);
_fragInput = surfaceDescriptionInputs;
const half4 origin = uieffect_frag(_fragInput.uv0.xy);
half4 color = uieffect(origin, _fragInput.uv0.xy, unpacked.texCoord2, float4(unpacked.positionWS, 1));
const half4 origin = uieffect_frag(fragInput, fragInput.uv0.xy);
half4 color = uieffect(origin, fragInput.uv0.xy, unpacked.texCoord2, float4(unpacked.positionWS, 1), fragInput);
//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
@@ -1,6 +1,11 @@
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
{
@@ -151,23 +151,21 @@ SubShader {
}
// ==== UIEFFECT START ====
v2f _fragInput;
fixed4 uieffect_frag(float2 uv)
fixed4 uieffect_frag(v2f IN, float2 uv)
{
v2f IN = _fragInput;
float2 uvMove = uv - IN.texcoord0;
fixed4 color = fixed4(IN.color.rgb, tex2D(_MainTex, IN.texcoord0 + uvMove).a);
color.rgb *= color.a;
return color;
}
#define UIEFFECT_TEXTMESHPRO 1
#define UIEFFECT_FRAG_STRUCT v2f
#include "Packages/com.coffee.ui-effect/Shaders/UIEffect.cginc"
// ==== UIEFFECT END ====
fixed4 frag (v2f IN) : COLOR
{
_fragInput = IN;
half4 color = uieffect(IN.texcoord0, IN.uvMask, IN.worldPosition);
half4 color = uieffect(IN.texcoord0, IN.uvMask, IN.worldPosition, IN);
color *= IN.color.a;
// Alternative implementation to UnityGet2DClipping with support for softness.
@@ -156,10 +156,8 @@ SubShader{
}
// ==== UIEFFECT START ====
v2f _fragInput;
fixed4 uieffect_frag(float2 uv)
fixed4 uieffect_frag(v2f IN, float2 uv)
{
v2f IN = _fragInput;
float2 uvMove = uv - IN.texcoord0;
fixed4 color = tex2D(_MainTex, IN.texcoord0 + uvMove);
color = fixed4 (tex2D(_FaceTex, IN.texcoord1).rgb * IN.color.rgb, color.a);
@@ -167,13 +165,13 @@ SubShader{
return color;
}
#define UIEFFECT_TEXTMESHPRO 1
#define UIEFFECT_FRAG_STRUCT v2f
#include "Packages/com.coffee.ui-effect/Shaders/UIEffect.cginc"
// ==== UIEFFECT END ====
fixed4 frag (v2f IN) : SV_Target
{
_fragInput = IN;
half4 color = uieffect(IN.texcoord0, IN.uvMask, IN.worldPosition);
half4 color = uieffect(IN.texcoord0, IN.uvMask, IN.worldPosition, IN);
color *= IN.color.a;
// Alternative implementation to UnityGet2DClipping with support for softness.
@@ -278,10 +278,8 @@ SubShader {
}
// ==== UIEFFECT START ====
pixel_t _fragInput;
fixed4 uieffect_frag(float2 uv)
fixed4 uieffect_frag(pixel_t input, float2 uv)
{
pixel_t input = _fragInput;
float2 uvMove = uv - input.atlas;
float c = tex2D(_MainTex, input.atlas + uvMove).a;
@@ -345,14 +343,14 @@ SubShader {
}
#define UIEFFECT_TEXTMESHPRO 1
#define UIEFFECT_FRAG_STRUCT pixel_t
#include "Packages/com.coffee.ui-effect/Shaders/UIEffect.cginc"
// ==== UIEFFECT END ====
fixed4 PixShader(pixel_t input) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(input);
_fragInput = input;
half4 faceColor = uieffect(input.atlas, input.uvMask, input.worldPosition);
half4 faceColor = uieffect(input.atlas, input.uvMask, input.worldPosition, input);
faceColor *= input.color.a;
#if UNITY_UI_CLIP_RECT
@@ -267,10 +267,8 @@ SubShader {
}
// ==== UIEFFECT START ====
pixel_t _fragInput;
fixed4 uieffect_frag(float2 uv)
fixed4 uieffect_frag(pixel_t input, float2 uv)
{
pixel_t input = _fragInput;
float2 uvMove = uv - input.atlas;
float c = tex2D(_MainTex, input.atlas + uvMove).a;
@@ -340,14 +338,14 @@ SubShader {
#define UIEFFECT_TEXTMESHPRO 1
#define UIEFFECT_FRAG_STRUCT pixel_t
#include "Packages/com.coffee.ui-effect/Shaders/UIEffect.cginc"
// ==== UIEFFECT END ====
fixed4 PixShader(pixel_t input) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(input);
_fragInput = input;
half4 faceColor = uieffect(input.atlas, input.uvMask, input.worldPosition);
half4 faceColor = uieffect(input.atlas, input.uvMask, input.worldPosition, input);
faceColor *= input.color.a;
// Alternative implementation to UnityGet2DClipping with support for softness.
@@ -236,10 +236,8 @@ SubShader {
}
// ==== UIEFFECT START ====
pixel_t _fragInput;
fixed4 uieffect_frag(float2 uv)
fixed4 uieffect_frag(pixel_t input, float2 uv)
{
pixel_t input = _fragInput;
float2 uvMove = uv - input.texcoord0.xy;
half d = tex2D(_MainTex, input.texcoord0.xy + uvMove).a * input.param.x;
half4 c = input.faceColor * saturate(d - input.param.w);
@@ -268,14 +266,14 @@ SubShader {
}
#define UIEFFECT_TEXTMESHPRO 1
#define UIEFFECT_FRAG_STRUCT pixel_t
#include "Packages/com.coffee.ui-effect/Shaders/UIEffect.cginc"
// ==== UIEFFECT END ====
fixed4 PixShader(pixel_t input) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(input);
_fragInput = input;
half4 c = uieffect(input.texcoord0.xy, input.uvMask, input.worldPosition);
half4 c = uieffect(input.texcoord0.xy, input.uvMask, input.worldPosition, input);
c *= input.alpha;
// Alternative implementation to UnityGet2DClipping with support for softness.
@@ -228,10 +228,8 @@ SubShader {
}
// ==== UIEFFECT START ====
pixel_t _fragInput;
fixed4 uieffect_frag(float2 uv)
fixed4 uieffect_frag(pixel_t input, float2 uv)
{
pixel_t input = _fragInput;
float2 uvMove = uv - input.texcoord0;
float d = tex2D(_MainTex, input.texcoord0.xy + uvMove).a;
@@ -282,14 +280,14 @@ SubShader {
}
#define UIEFFECT_TEXTMESHPRO 1
#define UIEFFECT_FRAG_STRUCT pixel_t
#include "Packages/com.coffee.ui-effect/Shaders/UIEffect.cginc"
// ==== UIEFFECT END ====
fixed4 PixShader(pixel_t input) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(input);
_fragInput = input;
half4 faceColor = uieffect(input.texcoord0, input.uvMask, input.worldPosition);
half4 faceColor = uieffect(input.texcoord0, input.uvMask, input.worldPosition, input);
faceColor *= input.alpha;
// Alternative implementation to UnityGet2DClipping with support for softness
@@ -235,10 +235,8 @@ SubShader {
}
// ==== UIEFFECT START ====
pixel_t _fragInput;
fixed4 uieffect_frag(float2 uv)
fixed4 uieffect_frag(pixel_t input, float2 uv)
{
pixel_t input = _fragInput;
float2 uvMove = uv - input.texcoord0.xy;
half d = tex2D(_MainTex, input.texcoord0.xy + uvMove).a * input.param.x;
@@ -268,6 +266,7 @@ SubShader {
}
#define UIEFFECT_TEXTMESHPRO 1
#define UIEFFECT_FRAG_STRUCT pixel_t
#include "Packages/com.coffee.ui-effect/Shaders/UIEffect.cginc"
// ==== UIEFFECT END ====
@@ -275,8 +274,7 @@ SubShader {
fixed4 PixShader(pixel_t input) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(input);
_fragInput = input;
half4 c = uieffect(input.texcoord0.xy, input.uvMask, input.worldPosition);
half4 c = uieffect(input.texcoord0.xy, input.uvMask, input.worldPosition, input);
c *= input.alpha;
// Alternative implementation to UnityGet2DClipping with support for softness.
@@ -280,10 +280,8 @@ SubShader {
// ==== UIEFFECT START ====
pixel_t _fragInput;
fixed4 uieffect_frag(float2 uv)
fixed4 uieffect_frag(pixel_t input, float2 uv)
{
pixel_t input = _fragInput;
float2 uvMove = uv - input.atlas;
float c = tex2D(_MainTex, input.atlas + uvMove).a;
@@ -346,14 +344,14 @@ SubShader {
return faceColor;
}
#define UIEFFECT_TEXTMESHPRO 1
#define UIEFFECT_FRAG_STRUCT pixel_t
#include "Packages/com.coffee.ui-effect/Shaders/UIEffect.cginc"
// ==== UIEFFECT END ====
fixed4 PixShader(pixel_t input) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(input);
_fragInput = input;
half4 faceColor = uieffect(input.atlas, input.uvMask, input.worldPosition);
half4 faceColor = uieffect(input.atlas, input.uvMask, input.worldPosition, input);
faceColor *= input.color.a;
#if UNITY_UI_CLIP_RECT
@@ -144,10 +144,8 @@ SubShader {
}
// ==== UIEFFECT START ====
v2f _fragInput;
fixed4 uieffect_frag(float2 uv)
fixed4 uieffect_frag(v2f IN, float2 uv)
{
v2f IN = _fragInput;
float2 uvMove = uv - IN.texcoord0;
fixed4 color = fixed4(IN.color.rgb, tex2D(_MainTex, IN.texcoord0 + uvMove).a);
color.rgb *= color.a;
@@ -155,13 +153,13 @@ SubShader {
}
#define UIEFFECT_TEXTMESHPRO 1
#define UIEFFECT_FRAG_STRUCT v2f
#include "Packages/com.coffee.ui-effect/Shaders/UIEffect.cginc"
// ==== UIEFFECT END ====
fixed4 frag (v2f IN) : COLOR
{
_fragInput = IN;
fixed4 color = uieffect(IN.texcoord0, IN.uvMask, IN.worldPosition);
fixed4 color = uieffect(IN.texcoord0, IN.uvMask, IN.worldPosition, IN);
color *= IN.color.a;
// Alternative implementation to UnityGet2DClipping with support for softness.
@@ -157,10 +157,8 @@ SubShader{
}
// ==== UIEFFECT START ====
v2f _fragInput;
fixed4 uieffect_frag(float2 uv)
fixed4 uieffect_frag(v2f IN, float2 uv)
{
v2f IN = _fragInput;
float2 uvMove = uv - IN.texcoord0;
fixed4 color = tex2D(_MainTex, IN.texcoord0 + uvMove);
color = fixed4 (tex2D(_FaceTex, IN.texcoord1).rgb * IN.color.rgb, color.a);
@@ -169,13 +167,13 @@ SubShader{
}
#define UIEFFECT_TEXTMESHPRO 1
#define UIEFFECT_FRAG_STRUCT v2f
#include "Packages/com.coffee.ui-effect/Shaders/UIEffect.cginc"
// ==== UIEFFECT END ====
fixed4 frag (v2f IN) : SV_Target
{
_fragInput = IN;
fixed4 color = uieffect(IN.texcoord0, IN.uvMask, IN.worldPosition);
fixed4 color = uieffect(IN.texcoord0, IN.uvMask, IN.worldPosition, IN);
color *= IN.color.a;
// Alternative implementation to UnityGet2DClipping with support for softness.
@@ -272,10 +272,8 @@ SubShader {
}
// ==== UIEFFECT START ====
pixel_t _fragInput;
fixed4 uieffect_frag(float2 uv)
fixed4 uieffect_frag(pixel_t input, float2 uv)
{
pixel_t input = _fragInput;
float2 uvMove = uv - input.atlas;
float c = tex2D(_MainTex, input.atlas + uvMove).a;
@@ -339,14 +337,14 @@ SubShader {
}
#define UIEFFECT_TEXTMESHPRO 1
#define UIEFFECT_FRAG_STRUCT pixel_t
#include "Packages/com.coffee.ui-effect/Shaders/UIEffect.cginc"
// ==== UIEFFECT END ====
fixed4 PixShader(pixel_t input) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(input);
_fragInput = input;
half4 faceColor = uieffect(input.atlas, input.uvMask, input.worldPosition);
half4 faceColor = uieffect(input.atlas, input.uvMask, input.worldPosition, input);
faceColor *= input.color.a;
#if UNITY_UI_CLIP_RECT
@@ -258,10 +258,8 @@ SubShader {
}
// ==== UIEFFECT START ====
pixel_t _fragInput;
fixed4 uieffect_frag(float2 uv)
fixed4 uieffect_frag(pixel_t input, float2 uv)
{
pixel_t input = _fragInput;
float2 uvMove = uv - input.atlas;
float c = tex2D(_MainTex, input.atlas + uvMove).a;
@@ -330,14 +328,14 @@ SubShader {
}
#define UIEFFECT_TEXTMESHPRO 1
#define UIEFFECT_FRAG_STRUCT pixel_t
#include "Packages/com.coffee.ui-effect/Shaders/UIEffect.cginc"
// ==== UIEFFECT END ====
fixed4 PixShader(pixel_t input) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(input);
_fragInput = input;
half4 faceColor = uieffect(input.atlas, input.uvMask, input.worldPosition);
half4 faceColor = uieffect(input.atlas, input.uvMask, input.worldPosition, input);
faceColor *= input.color.a;
// Alternative implementation to UnityGet2DClipping with support for softness.
@@ -228,10 +228,8 @@ SubShader {
}
// ==== UIEFFECT START ====
pixel_t _fragInput;
fixed4 uieffect_frag(float2 uv)
fixed4 uieffect_frag(pixel_t input, float2 uv)
{
pixel_t input = _fragInput;
float2 uvMove = uv - input.texcoord0.xy;
half d = tex2D(_MainTex, input.texcoord0.xy + uvMove).a * input.param.x;
half4 c = input.faceColor * saturate(d - input.param.w);
@@ -260,14 +258,14 @@ SubShader {
}
#define UIEFFECT_TEXTMESHPRO 1
#define UIEFFECT_FRAG_STRUCT pixel_t
#include "Packages/com.coffee.ui-effect/Shaders/UIEffect.cginc"
// ==== UIEFFECT END ====
fixed4 PixShader(pixel_t input) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(input);
_fragInput = input;
half4 c = uieffect(input.texcoord0.xy, input.uvMask, input.worldPosition);
half4 c = uieffect(input.texcoord0.xy, input.uvMask, input.worldPosition, input);
c *= input.alpha;
// Alternative implementation to UnityGet2DClipping with support for softness.
@@ -228,10 +228,8 @@ SubShader {
}
// ==== UIEFFECT START ====
pixel_t _fragInput;
fixed4 uieffect_frag(float2 uv)
fixed4 uieffect_frag(pixel_t input, float2 uv)
{
pixel_t input = _fragInput;
float2 uvMove = uv - input.texcoord0;
float d = tex2D(_MainTex, input.texcoord0.xy + uvMove).a;
@@ -282,14 +280,14 @@ SubShader {
}
#define UIEFFECT_TEXTMESHPRO 1
#define UIEFFECT_FRAG_STRUCT pixel_t
#include "Packages/com.coffee.ui-effect/Shaders/UIEffect.cginc"
// ==== UIEFFECT END ====
fixed4 PixShader(pixel_t input) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(input);
_fragInput = input;
half4 faceColor = uieffect(input.texcoord0, input.uvMask, input.worldPosition);
half4 faceColor = uieffect(input.texcoord0, input.uvMask, input.worldPosition, input);
faceColor *= input.alpha;
// Alternative implementation to UnityGet2DClipping with support for softness
@@ -229,10 +229,8 @@ SubShader {
}
// ==== UIEFFECT START ====
pixel_t _fragInput;
fixed4 uieffect_frag(float2 uv)
fixed4 uieffect_frag(pixel_t input, float2 uv)
{
pixel_t input = _fragInput;
float2 uvMove = uv - input.texcoord0.xy;
half d = tex2D(_MainTex, input.texcoord0.xy + uvMove).a * input.param.x;
half4 c = input.faceColor * saturate(d - input.param.w);
@@ -261,14 +259,14 @@ SubShader {
}
#define UIEFFECT_TEXTMESHPRO 1
#define UIEFFECT_FRAG_STRUCT pixel_t
#include "Packages/com.coffee.ui-effect/Shaders/UIEffect.cginc"
// ==== UIEFFECT END ====
fixed4 PixShader(pixel_t input) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(input);
_fragInput = input;
half4 c = uieffect(input.texcoord0.xy, input.uvMask, input.worldPosition);
half4 c = uieffect(input.texcoord0.xy, input.uvMask, input.worldPosition, input);
c *= input.alpha;
// Alternative implementation to UnityGet2DClipping with support for softness.
@@ -272,10 +272,8 @@ SubShader {
}
// ==== UIEFFECT START ====
pixel_t _fragInput;
fixed4 uieffect_frag(float2 uv)
fixed4 uieffect_frag(pixel_t input, float2 uv)
{
pixel_t input = _fragInput;
float2 uvMove = uv - input.atlas;
float c = tex2D(_MainTex, input.atlas + uvMove).a;
@@ -339,14 +337,14 @@ SubShader {
}
#define UIEFFECT_TEXTMESHPRO 1
#define UIEFFECT_FRAG_STRUCT pixel_t
#include "Packages/com.coffee.ui-effect/Shaders/UIEffect.cginc"
// ==== UIEFFECT END ====
fixed4 PixShader(pixel_t input) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(input);
_fragInput = input;
half4 faceColor = uieffect(input.atlas, input.uvMask, input.worldPosition);
half4 faceColor = uieffect(input.atlas, input.uvMask, input.worldPosition, input);
faceColor *= input.color.a;
#if UNITY_UI_CLIP_RECT
@@ -0,0 +1,298 @@
// [OptionalShader] com.coffee.softmask-for-ugui: Hidden/UniText/Mobile/SDF (UIEffect)
// [OptionalShader] com.coffee.ui-effect: Hidden/UniText/Mobile/SDF (SoftMaskable)
// Simplified SDF shader (single-pass):
// - No Shading Option (bevel / bump / env map)
// - No Glow Option
// - Renders Face, Outline, and Underlay in one pass
Shader "Hidden/UniText/Mobile/SDF (UIEffect)" {
Properties {
_FaceColor ("Face Color", Color) = (1,1,1,1)
_FaceDilate ("Face Dilate", Range(-1,1)) = 0
_OutlineColor ("Outline Color", Color) = (0,0,0,1)
_OutlineDilate ("Outline Dilate", Range(-1,1)) = 0
_OutlineSoftness ("Outline Softness", Range(0,1)) = 0
_UnderlayColor ("Border Color", Color) = (0,0,0,.5)
_UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0
_UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0
_UnderlayDilate ("Border Dilate", Range(-1,1)) = 0
_UnderlaySoftness ("Border Softness", Range(0,1)) = 0
_WeightNormal ("Weight Normal", float) = 0
_WeightBold ("Weight Bold", float) = 1
_ShaderFlags ("Flags", float) = 0
_ScaleRatioA ("Scale RatioA", float) = 1
_ScaleRatioB ("Scale RatioB", float) = 1
_ScaleRatioC ("Scale RatioC", float) = 1
_MainTex ("Font Atlas", 2D) = "white" {}
_ScaleX ("Scale X", float) = 1
_ScaleY ("Scale Y", float) = 1
_PerspectiveFilter ("Perspective Correction", Range(0, 1)) = 0.875
_Sharpness ("Sharpness", Range(-1,1)) = 0
_VertexOffsetX ("Vertex OffsetX", float) = 0
_VertexOffsetY ("Vertex OffsetY", float) = 0
_ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
_MaskSoftnessX ("Mask SoftnessX", float) = 0
_MaskSoftnessY ("Mask SoftnessY", float) = 0
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_CullMode ("Cull Mode", Float) = 0
_ColorMask ("Color Mask", Float) = 15
}
SubShader {
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull [_CullMode]
ZWrite Off
Lighting Off
Fog { Mode Off }
ZTest [unity_GUIZTestMode]
// ==== UIEFFECT START ====
Blend [_SrcBlend] [_DstBlend]
// ==== UIEFFECT END ====
ColorMask [_ColorMask]
Pass {
CGPROGRAM
#pragma vertex VertShader
#pragma fragment PixShader
#pragma shader_feature __ OUTLINE_ON
#pragma shader_feature __ UNDERLAY_ON UNDERLAY_INNER
#pragma multi_compile __ UNITY_UI_CLIP_RECT
#pragma multi_compile __ UNITY_UI_ALPHACLIP
// ==== UIEFFECT START ====
#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 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_COLOR2 GRADATION_COLOR4
#pragma shader_feature_fragment _ UIEFFECT_EDITOR
// ==== UIEFFECT END ====
// ==== SOFTMASKABLE START ====
#pragma shader_feature_fragment _ SOFTMASK_EDITOR
#pragma shader_feature_local_fragment _ SOFTMASKABLE
#if SOFTMASKABLE
#include "Packages/com.coffee.softmask-for-ugui/Shaders/SoftMask.cginc"
#endif
// ==== SOFTMASKABLE END ====
#include "Packages/media.lightside.unitext/Shaders/UniText_SDF-Mobile-Common.cginc"
// Unity auto-generated: (1/width, 1/height, width, height)
float4 _MainTex_TexelSize;
struct sdf_vertex_tV2
{
UNITY_VERTEX_INPUT_INSTANCE_ID
float4 vertex : POSITION;
float3 normal : NORMAL;
fixed4 color : COLOR;
float4 texcoord0 : TEXCOORD0; // xy = UV, z = gradientScale, w = xScaleVal
float4 texcoord1 : TEXCOORD1; // x = spreadRatio (Padding / PointSize)
// // ==== UIEFFECT START ====
float4 texcoord2 : TEXCOORD2;
// // ==== UIEFFECT END ====
};
#define sdf_vertex_t sdf_vertex_tV2
struct pixel_t
{
UNITY_VERTEX_INPUT_INSTANCE_ID
UNITY_VERTEX_OUTPUT_STEREO
float4 vertex : SV_POSITION;
fixed4 faceColor : COLOR;
fixed4 outlineColor : COLOR1;
float2 uv : TEXCOORD0;
half4 param : TEXCOORD1; // scale, faceBias, outlineBias, alpha
half4 mask : TEXCOORD2;
#if (UNDERLAY_ON | UNDERLAY_INNER)
float2 underlayUV : TEXCOORD3;
half2 underlayParam: TEXCOORD4; // scale, bias
#endif
// ==== UIEFFECT START ====
float4 uvMask : TEXCOORD5;
float4 worldPosition : TEXCOORD6;
// ==== UIEFFECT END ====
};
pixel_t VertShader(sdf_vertex_t input)
{
pixel_t output;
UNITY_INITIALIZE_OUTPUT(pixel_t, output);
UNITY_SETUP_INSTANCE_ID(input);
UNITY_TRANSFER_INSTANCE_ID(input, output);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
float4 vert = ApplyVertexOffset(input.vertex);
float4 vPosition = UnityObjectToClipPos(vert);
float2 pixelSize = vPosition.w;
pixelSize /= float2(_ScaleX, _ScaleY) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy));
// Get scale (for AA) and normFactor (for effect normalization)
float2 scaleAndNorm = ComputeScaleAndNorm(vPosition, input.normal, vert, input.texcoord0, input.texcoord1);
float scale = scaleAndNorm.x;
float normFactor = scaleAndNorm.y;
float baseWeight = ComputeBaseWeight(input.texcoord0);
// Face bias (effects normalized via normFactor for independence from atlas settings)
float faceBias = ComputeBias(baseWeight, _FaceDilate, scale, normFactor);
// Outline bias (same logic, different dilate)
float outlineBias = ComputeBias(baseWeight, _FaceDilate + _OutlineDilate, scale, normFactor);
fixed4 color = GammaToLinearIfNeeded(input.color);
float opacity = color.a;
#if (UNDERLAY_ON | UNDERLAY_INNER)
opacity = 1.0;
#endif
fixed4 faceColor = fixed4(color.rgb, opacity) * _FaceColor;
faceColor.rgb *= faceColor.a;
fixed4 outlineColor = _OutlineColor;
outlineColor.a *= opacity;
outlineColor.rgb *= outlineColor.a;
#if (UNDERLAY_ON | UNDERLAY_INNER)
// Underlay parameters (effects normalized via normFactor)
float softnessFactor = _UnderlaySoftness * _ScaleRatioC * normFactor;
float layerScale = scale / (1 + softnessFactor);
float underlayDilate = _FaceDilate * _ScaleRatioA + _UnderlayDilate * _ScaleRatioC;
float layerBias = ComputeBias(baseWeight, underlayDilate, layerScale, normFactor);
// Underlay UV offset (independent of atlas settings)
// Uses PointSize-proportional factor instead of spreadRatio-dependent
float gradientScaleVal = input.texcoord0.z;
float offsetFactor = ComputeUnderlayOffsetFactor(gradientScaleVal, normFactor);
float2 layerOffset = float2(
-(_UnderlayOffsetX * _ScaleRatioC) * offsetFactor * _MainTex_TexelSize.x,
-(_UnderlayOffsetY * _ScaleRatioC) * offsetFactor * _MainTex_TexelSize.y
);
output.underlayUV = input.texcoord0.xy + layerOffset;
output.underlayParam = half2(layerScale, layerBias);
#endif
output.vertex = vPosition;
output.faceColor = faceColor;
output.outlineColor = outlineColor;
output.uv = input.texcoord0.xy;
output.param = half4(scale, faceBias, outlineBias, color.a);
output.mask = ComputeMask(vert, pixelSize);
// ==== UIEFFECT START ====
output.uvMask = input.texcoord2;
output.worldPosition = input.vertex;
// ==== UIEFFECT END ====
return output;
}
fixed4 uieffect_frag(pixel_t input, float2 uv)
{
float2 uvAdd = uv - input.uv;
half d = tex2D(_MainTex, input.uv + uvAdd).a * input.param.x;
half4 result = half4(0, 0, 0, 0);
// Underlay layer (behind everything)
#if UNDERLAY_ON
half ud = tex2D(_MainTex, input.underlayUV + uvAdd).a * input.underlayParam.x;
half4 underlayColor = float4(_UnderlayColor.rgb * _UnderlayColor.a, _UnderlayColor.a);
result = SDFLayer(ud, input.underlayParam.y, underlayColor);
#endif
#if UNDERLAY_INNER
half ud = tex2D(_MainTex, input.underlayUV + uvAdd).a * input.underlayParam.x;
half4 underlayColor = float4(_UnderlayColor.rgb * _UnderlayColor.a, _UnderlayColor.a);
half faceMask = saturate(d - input.param.y);
result = underlayColor * (1 - saturate(ud - input.underlayParam.y)) * faceMask;
#endif
// Outline layer
#ifdef OUTLINE_ON
half4 outlineResult = SDFLayer(d, input.param.z, input.outlineColor);
result = BlendOver(result, outlineResult);
#endif
// Face layer (on top)
half4 faceResult = SDFLayer(d, input.param.y, input.faceColor);
result = BlendOver(result, faceResult);
// Apply vertex alpha for underlay
#if (UNDERLAY_ON | UNDERLAY_INNER)
result *= input.param.w;
#endif
return ApplyClipping(result, input.mask);
}
#define UIEFFECT_TEXTMESHPRO 1
#define UIEFFECT_UNITEXT 1
#define UIEFFECT_FRAG_STRUCT pixel_t
#include "Packages/com.coffee.ui-effect/Shaders/UIEffect.cginc"
fixed4 PixShader(pixel_t input) : SV_Target
{
UNITY_SETUP_INSTANCE_ID(input);
half4 faceColor = uieffect(input.uv, input.uvMask, input.worldPosition, input);
// faceColor *= input.faceColor.a;
#if UNITY_UI_CLIP_RECT
half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(input.mask.xy)) * input.mask.zw);
faceColor *= m.x * m.y;
#endif
// ==== SOFTMASKABLE START ====
#if SOFTMASKABLE
faceColor *= SoftMask(input.position, input.worldPosition, faceColor.a);
#endif
// ==== SOFTMASKABLE END ====
#if UNITY_UI_ALPHACLIP
clip(faceColor.a - 0.001);
#endif
return faceColor;
}
ENDCG
}
}
CustomEditor "LightSide.UniText_SDFShaderGUI"
}
@@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 2b59af9d686c54416a887aa007efbc41
ShaderImporter:
externalObjects: {}
defaultTextures:
- _MainTex: {instanceID: 0}
nonModifiableTextures: []
userData: v5.9.0
assetBundleName:
assetBundleVariant:
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: dee20160ea4174bdda8f2db637c74b64
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,19 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: ba1d671b8df1409294a2e77970855f56, type: 3}
m_Name: UniTextAppearance
m_EditorClassIdentifier: LightSide.UniText::UniTextAppearance
defaultMaterials:
items:
- {fileID: 2100000, guid: 576afc17f1fccc544aef5b2388b8def2, type: 2}
fontMaterials:
items: []
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: a2480bd12ed0b436d89f5f3f17ae1bfb
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
+32 -25
View File
@@ -8,8 +8,10 @@
#ifndef CANVAS_SHADERGRAPH
uniform const int _SrcBlend;
uniform const int _DstBlend;
#ifndef UIEFFECT_UNITEXT
uniform const float4 _MainTex_TexelSize;
#endif
#endif
uniform const float _ToneIntensity;
uniform const int _ColorFilter;
@@ -81,6 +83,11 @@ uniform const matrix _CanvasToWorldMatrix;
#endif
#endif
#ifndef UIEFFECT_FRAG_STRUCT
struct uieffect_v2f{};
#define UIEFFECT_FRAG_STRUCT uieffect_v2f
#endif
#define TONE_NONE (!TONE_GRAYSCALE && !TONE_SEPIA && !TONE_NEGATIVE && !TONE_RETRO && !TONE_POSTERIZE)
#define SAMPLING_NONE (!SAMPLING_BLUR_FAST && !SAMPLING_BLUR_MEDIUM && !SAMPLING_BLUR_DETAIL && !SAMPLING_PIXELATION && !SAMPLING_RGB_SHIFT && !SAMPLING_EDGE_LUMINANCE && !SAMPLING_EDGE_ALPHA)
#define TRANSITION_NONE (!TRANSITION_FADE && !TRANSITION_CUTOFF && !TRANSITION_DISSOLVE && !TRANSITION_SHINY && !TRANSITION_MASK && !TRANSITION_MELT && !TRANSITION_BURN && !TRANSITION_PATTERN && !TRANSITION_BLAZE)
@@ -94,8 +101,8 @@ uniform const matrix _CanvasToWorldMatrix;
#endif
#define UIEFFECT_UV_MASK(uv, uvMask) step(uvMask.x, uv.x) * step(uv.x, uvMask.z) * step(uvMask.y, uv.y) * step(uv.y, uvMask.w)
#define UIEFFECT_SAMPLE(uv) uieffect_frag(uv)
#define UIEFFECT_SAMPLE_CLAMP(uv, uvMask) uieffect_frag(uv) * UIEFFECT_UV_MASK(uv, uvMask)
#define UIEFFECT_SAMPLE(in, uv) uieffect_frag(in, uv)
#define UIEFFECT_SAMPLE_CLAMP(in, uv, uvMask) uieffect_frag(in, uv) * UIEFFECT_UV_MASK(uv, uvMask)
#ifdef CANVAS_SHADERGRAPH
#define TEX_SAMPLE_CLAMP(uv, uvMask) SAMPLE_TEXTURE2D(_MainTex, sampler_MainTex, uv) * UIEFFECT_UV_MASK(uv, uvMask)
@@ -273,7 +280,7 @@ half4 apply_color_filter(int mode, half4 inColor, half4 factor, float intensity,
return color;
}
half4 apply_sampling_filter(float2 uv, const float4 uvMask, const float isShadow)
half4 apply_sampling_filter(UIEFFECT_FRAG_STRUCT IN, float2 uv, const float4 uvMask, const float isShadow)
{
#if SAMPLING_BLUR_FAST || SAMPLING_BLUR_MEDIUM || SAMPLING_BLUR_DETAIL
{
@@ -305,7 +312,7 @@ half4 apply_sampling_filter(float2 uv, const float4 uvMask, const float isShadow
const float weight = KERNEL_[x] * KERNEL_[y]
* step(uvMask.x, bluredUv.x) * step(bluredUv.x, uvMask.z)
* step(uvMask.y, bluredUv.y) * step(bluredUv.y, uvMask.w);
o += UIEFFECT_SAMPLE(bluredUv) * weight;
o += UIEFFECT_SAMPLE(IN, bluredUv) * weight;
sum += weight;
}
}
@@ -315,7 +322,7 @@ half4 apply_sampling_filter(float2 uv, const float4 uvMask, const float isShadow
}
#endif
return UIEFFECT_SAMPLE_CLAMP(uv, uvMask);
return UIEFFECT_SAMPLE_CLAMP(IN, uv, uvMask);
}
float2 move_transition_filter(const float4 uvMask, const float alpha)
@@ -552,12 +559,12 @@ float is_edge_shiny(const float2 uvLocal)
#endif
}
half4 uieffect_internal(float2 uv, float4 uvMask, const float2 uvLocal, const float2 uvGrad, const float isShadow)
half4 uieffect_internal(UIEFFECT_FRAG_STRUCT IN, float2 uv, float4 uvMask, const float2 uvLocal, const float2 uvGrad, const float isShadow)
{
const half alpha = transition_alpha(uvLocal);
const float edgeFactor = edge(uv, uvMask, _EdgeWidth);
uv += move_transition_filter(uvMask, alpha);
half4 color = apply_sampling_filter(uv, uvMask, isShadow);
half4 color = apply_sampling_filter(IN, uv, uvMask, isShadow);
color = apply_gradation_filter(color, uvGrad);
color = apply_tone_filter(color);
color = apply_transition_filter(color, alpha, uvLocal, edgeFactor);
@@ -584,7 +591,7 @@ half4 uieffect_internal(float2 uv, float4 uvMask, const float2 uvLocal, const fl
}
}
half4 uieffect(half4 origin, float2 uv, float4 uvMask, float4 wpos)
half4 uieffect(half4 origin, float2 uv, float4 uvMask, float4 wpos, UIEFFECT_FRAG_STRUCT IN)
{
#ifdef NO_UIEFFECT
return origin;
@@ -609,7 +616,7 @@ half4 uieffect(half4 origin, float2 uv, float4 uvMask, float4 wpos)
uvMask.x += 4;
}
const float isShadow = uvMask.x < 0 ? 1 : 0;
const float isShadow = uvMask.x < -1 ? 1 : 0;
uvMask.x += isShadow * 2;
// Sampling.Pixelation
@@ -622,9 +629,9 @@ half4 uieffect(half4 origin, float2 uv, float4 uvMask, float4 wpos)
#elif SAMPLING_RGB_SHIFT
{
const half2 offset = half2(_SamplingIntensity * texel_size().x * 20, 0);
const half2 r = uieffect_internal(uv + offset, uvMask, uvLocal, uvGrad, isShadow).ra;
const half2 g = uieffect_internal(uv, uvMask, uvLocal, uvGrad, isShadow).ga;
const half2 b = uieffect_internal(uv - offset, uvMask, uvLocal, uvGrad, isShadow).ba;
const half2 r = uieffect_internal(IN, uv + offset, uvMask, uvLocal, uvGrad, isShadow).ra;
const half2 g = uieffect_internal(IN, uv, uvMask, uvLocal, uvGrad, isShadow).ga;
const half2 b = uieffect_internal(IN, uv - offset, uvMask, uvLocal, uvGrad, isShadow).ba;
return half4(r.x * r.y, g.x * g.y, b.x * b.y, (r.y + g.y + b.y) / 3);
}
// Sampling.EdgeLuminance/EdgeAlpha
@@ -634,32 +641,32 @@ half4 uieffect(half4 origin, float2 uv, float4 uvMask, float4 wpos)
const float2 d = texel_size() * _SamplingWidth;
// Pixel values around the current pixel (3x3, 8 neighbors)
const half v00 = to_value(UIEFFECT_SAMPLE_CLAMP((uv + half2(-d.x, -d.y)), uvMask));
const half v01 = to_value(UIEFFECT_SAMPLE_CLAMP((uv + half2(-d.x, 0.0)), uvMask));
const half v02 = to_value(UIEFFECT_SAMPLE_CLAMP((uv + half2(-d.x, +d.y)), uvMask));
const half v10 = to_value(UIEFFECT_SAMPLE_CLAMP((uv + half2(0.0, -d.y)), uvMask));
const half v12 = to_value(UIEFFECT_SAMPLE_CLAMP((uv + half2(0.0, +d.y)), uvMask));
const half v20 = to_value(UIEFFECT_SAMPLE_CLAMP((uv + half2(+d.x, -d.y)), uvMask));
const half v21 = to_value(UIEFFECT_SAMPLE_CLAMP((uv + half2(+d.x, 0.0)), uvMask));
const half v22 = to_value(UIEFFECT_SAMPLE_CLAMP((uv + half2(+d.x, +d.y)), uvMask));
const half v00 = to_value(UIEFFECT_SAMPLE_CLAMP(IN, (uv + half2(-d.x, -d.y)), uvMask));
const half v01 = to_value(UIEFFECT_SAMPLE_CLAMP(IN, (uv + half2(-d.x, 0.0)), uvMask));
const half v02 = to_value(UIEFFECT_SAMPLE_CLAMP(IN, (uv + half2(-d.x, +d.y)), uvMask));
const half v10 = to_value(UIEFFECT_SAMPLE_CLAMP(IN, (uv + half2(0.0, -d.y)), uvMask));
const half v12 = to_value(UIEFFECT_SAMPLE_CLAMP(IN, (uv + half2(0.0, +d.y)), uvMask));
const half v20 = to_value(UIEFFECT_SAMPLE_CLAMP(IN, (uv + half2(+d.x, -d.y)), uvMask));
const half v21 = to_value(UIEFFECT_SAMPLE_CLAMP(IN, (uv + half2(+d.x, 0.0)), uvMask));
const half v22 = to_value(UIEFFECT_SAMPLE_CLAMP(IN, (uv + half2(+d.x, +d.y)), uvMask));
// Apply Sobel operator
half sobel_h = v00 * -1.0 + v01 * -2.0 + v02 * -1.0 + v20 * 1.0 + v21 * 2.0 + v22 * 1.0;
half sobel_v = v00 * -1.0 + v10 * -2.0 + v20 * -1.0 + v02 * 1.0 + v12 * 2.0 + v22 * 1.0;
const half sobel = sqrt(sobel_h * sobel_h + sobel_v * sobel_v) * _SamplingIntensity;
return lerp(0, uieffect_internal(uv, uvMask, uvLocal, uvGrad, isShadow), inv_lerp(0.5, 1, sobel));
return lerp(half4(0, 0, 0, 0), uieffect_internal(IN, uv, uvMask, uvLocal, uvGrad, isShadow), inv_lerp(0.5, 1, sobel));
}
#endif
return lerp(origin, uieffect_internal(uv, uvMask, uvLocal, uvGrad, isShadow), rate);
return lerp(origin, uieffect_internal(IN, uv, uvMask, uvLocal, uvGrad, isShadow), rate);
}
half4 uieffect(float2 uv, float4 uvMask, float4 wpos)
half4 uieffect(float2 uv, float4 uvMask, float4 wpos, UIEFFECT_FRAG_STRUCT IN)
{
const half4 origin = UIEFFECT_SAMPLE_CLAMP(uv, uvMask);
return uieffect(origin, uv, uvMask, wpos);
const half4 origin = UIEFFECT_SAMPLE_CLAMP(IN, uv, uvMask);
return uieffect(origin, uv, uvMask, wpos, IN);
}
#endif // UI_EFFECT_INCLUDED
+8 -7
View File
@@ -42,7 +42,9 @@ Shader "Hidden/UI/Default (UIEffect)"
Lighting Off
ZWrite Off
ZTest [unity_GUIZTestMode]
// ==== UIEFFECT START ====
Blend [_SrcBlend] [_DstBlend]
// ==== UIEFFECT END ====
ColorMask [_ColorMask]
Pass
@@ -117,7 +119,6 @@ Shader "Hidden/UI/Default (UIEffect)"
UNITY_SETUP_INSTANCE_ID(v);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT);
float4 vPosition = UnityObjectToClipPos(v.vertex);
OUT.worldPosition = v.vertex;
OUT.vertex = vPosition;
float2 pixelSize = vPosition.w;
@@ -141,22 +142,21 @@ Shader "Hidden/UI/Default (UIEffect)"
// ==== UIEFFECT START ====
OUT.uvMask = v.uvMask;
OUT.worldPosition = v.vertex;
// ==== UIEFFECT END ====
return OUT;
}
// ==== UIEFFECT START ====
v2f _fragInput;
fixed4 uieffect_frag(float2 uv)
half4 uieffect_frag(v2f IN, float2 uv)
{
v2f IN = _fragInput;
half4 color = (tex2D(_MainTex, uv) + _TextureSampleAdd);
color.rgb *= IN.color.rgb;
color.rgb *= color.a;
return color;
}
#define UIEFFECT_FRAG_STRUCT v2f
#include "Packages/com.coffee.ui-effect/Shaders/UIEffect.cginc"
// ==== UIEFFECT END ====
@@ -169,8 +169,9 @@ Shader "Hidden/UI/Default (UIEffect)"
const half invAlphaPrecision = half(1.0 / alphaPrecision);
IN.color.a = round(IN.color.a * alphaPrecision) * invAlphaPrecision;
_fragInput = IN;
half4 c = uieffect(IN.texcoord, IN.uvMask, IN.worldPosition);
// ==== UIEFFECT START ====
half4 c = uieffect(IN.texcoord, IN.uvMask, IN.worldPosition, IN);
// ==== UIEFFECT END ====
c *= IN.color.a;
#ifdef UNITY_UI_CLIP_RECT
+6 -1
View File
@@ -2,7 +2,7 @@
"name": "com.coffee.ui-effect",
"displayName": "UI Effect",
"description": "UIEffect is an open-source package that allows you to intuitively apply rich UI effects directly from the Inspector or via code.\nCombine various filters, such as grayscale, blur, and dissolve, to decorate your UI with a unique visual style!",
"version": "5.10.6",
"version": "5.10.9",
"unity": "2020.3",
"license": "MIT",
"repository": {
@@ -51,6 +51,11 @@
"displayName": "ShaderGraph Support (Unity 6 URP)",
"description": "ShaderGraph Support (Unity 6 URP)",
"path": "Samples~/ShaderGraph Support (Unity 6 URP)~"
},
{
"displayName": "UniText Support",
"description": "UniText Support",
"path": "Samples~/UniText Support~"
}
]
}
+6 -1
View File
@@ -5,6 +5,9 @@ EditorBuildSettings:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Scenes:
- enabled: 1
path: Assets/Demos/HotUpdate/HotUpdate.unity
guid: 7ec916ecedc5e41a1896062381cbd257
- enabled: 1
path: Assets/Samples/Demo/UIEffect_AvailableFilters.unity
guid: d5c078bb25f6943a8aca31e4ebf27d86
@@ -32,4 +35,6 @@ EditorBuildSettings:
- enabled: 0
path: Assets/Demos/GradationTest/4ColorGradation.unity
guid: d9fda278a556f4bd6bf27213319aaf06
m_configObjects: {}
m_configObjects:
com.unity.addressableassets: {fileID: 11400000, guid: c73d220faf28240f1a28d59807c79b75,
type: 2}
+2 -2
View File
@@ -1,2 +1,2 @@
m_EditorVersion: 2022.3.56f1
m_EditorVersionWithRevision: 2022.3.56f1 (dd0c98481d00)
m_EditorVersion: 2022.3.62f2
m_EditorVersionWithRevision: 2022.3.62f2 (7670c08855a9)
+6 -1
View File
@@ -19,7 +19,12 @@
"m_From": "Assets/TextMeshPro Support (Unity 6)",
"m_To": "../Packages/src/Samples~/TextMeshPro Support (Unity 6)~",
"m_Define": "UNITY_2023_2_OR_NEWER"
},
{
"m_From": "Assets/UniText Support",
"m_To": "../Packages/src/Samples~/UniText Support~",
"m_Define": ""
}
]
}
}
}

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