mirror of
https://github.com/mob-sakai/UIEffect.git
synced 2026-11-19 17:22:37 +08:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| c3bf0724fe |
@@ -25,7 +25,7 @@ jobs:
|
||||
tag: ${{ steps.release.outputs.new_release_git_tag }}
|
||||
steps:
|
||||
- name: 🚚 Checkout (${{ github.ref_name }})
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: 🔖 Run semantic release
|
||||
uses: cycjimmy/semantic-release-action@v6
|
||||
|
||||
@@ -8,28 +8,17 @@ run-name: 🧪 Test URP (${{ github.event.pull_request.title || github.ref_name
|
||||
env:
|
||||
# MINIMUM_VERSION: The minimum version of Unity.
|
||||
MINIMUM_VERSION: 6000.0
|
||||
MAXIMUM_VERSION:
|
||||
# EXCLUDE_FILTER: The excluded versions of Unity.
|
||||
EXCLUDE_FILTER: "(2017|2018|2023.3)"
|
||||
IGNORE_ALPHA: false
|
||||
IGNORE_BETA: false
|
||||
PROJECT_PATH: UIEffectURP
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
unityVersions:
|
||||
description: 'Specify the Unity versions to test. (eg. [ "2019.4.41f2", "2020.3.15f2" ])'
|
||||
required: false
|
||||
default: '[ "6000.0.0f1", "6000.1.0f1" ]'
|
||||
usePeriodVersions:
|
||||
description: 'Use the period versions (.0f1, .10f1, 20f1, ...).'
|
||||
description: "Use the period versions (.0f1, .10f1, 20f1, ...)."
|
||||
required: false
|
||||
default: "true"
|
||||
overrideFindOptions:
|
||||
description: 'Specify options for unity-changeset. (eg. --ignore-alpha --max 2020.3 )'
|
||||
required: false
|
||||
default: '--min 6000.0 --max 9999.9 --ignore-alpha --ignore-beta'
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
@@ -71,27 +60,9 @@ jobs:
|
||||
id: setup
|
||||
run: |
|
||||
echo "==== Target Unity Versions ===="
|
||||
|
||||
# Check if specific Unity versions are provided via inputs (for workflow_dispatch)
|
||||
if [ -n "${{ inputs.unityVersions }}" ]; then
|
||||
echo "* Using specified Unity versions" | tee $GITHUB_OUTPUT
|
||||
echo 'unityVersions=${{ inputs.unityVersions }}' | tee $GITHUB_OUTPUT
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Formulate find options based on inputs and environment variables
|
||||
FIND_OPTIONS=""
|
||||
[ "${{ env.IGNORE_ALPHA }}" = "true" ] && FIND_OPTIONS+=" --ignore-alpha"
|
||||
[ "${{ env.IGNORE_BETA }}" = "true" ] && FIND_OPTIONS+=" --ignore-beta"
|
||||
[ -n "${{ env.MINIMUM_VERSION }}" ] && FIND_OPTIONS+=" --min ${MINIMUM_VERSION}"
|
||||
[ -n "${{ env.MAXIMUM_VERSION }}" ] && FIND_OPTIONS+=" --max ${MAXIMUM_VERSION}"
|
||||
[ -n "${{ inputs.overrideFindOptions }}" ] && FIND_OPTIONS="${inputs.overrideFindOptions}"
|
||||
echo "find options: $FIND_OPTIONS"
|
||||
|
||||
# Find the latest Unity versions if no specific versions are provided
|
||||
LATEST_VERSIONS=`npx -y unity-changeset@latest list --json --versions --all --latest-patch $FIND_OPTIONS`
|
||||
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 -y unity-changeset@latest list --json --versions $FIND_OPTIONS --grep '0f'`
|
||||
ADDITIONAL_VERSIONS=`npx -y unity-changeset@latest list --json --versions --ignore-alpha --min ${MINIMUM_VERSION} --grep '0f'`
|
||||
else
|
||||
ADDITIONAL_VERSIONS=[]
|
||||
fi
|
||||
@@ -114,10 +85,10 @@ jobs:
|
||||
unityVersion: ${{ fromJson(needs.setup.outputs.unityVersions) }}
|
||||
steps:
|
||||
- name: 🚚 Checkout ($${{ github.ref }})
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: 📥 Cache library
|
||||
uses: actions/cache@v6
|
||||
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 }}
|
||||
@@ -126,7 +97,7 @@ jobs:
|
||||
${{ env.PROJECT_PATH }}-Library-
|
||||
|
||||
- name: 🛠️ Build Unity Project (Test)
|
||||
uses: mob-sakai/unity-builder@fix/support-unity6.6
|
||||
uses: game-ci/unity-builder@v5
|
||||
timeout-minutes: 45
|
||||
with:
|
||||
customImage: ghcr.io/mob-sakai/unity3d:${{ matrix.unityVersion }}
|
||||
@@ -140,7 +111,7 @@ jobs:
|
||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||
|
||||
# - name: 🧪 Run tests
|
||||
# uses: mob-sakai/unity-test-runner@fix/support-unity6.6
|
||||
# uses: game-ci/unity-test-runner@v4
|
||||
# timeout-minutes: 45
|
||||
# with:
|
||||
# customImage: ghcr.io/mob-sakai/unity3d:${{ matrix.unityVersion }}
|
||||
|
||||
@@ -8,28 +8,17 @@ run-name: 🧪 Test (${{ github.event.pull_request.title || github.ref_name }})
|
||||
env:
|
||||
# MINIMUM_VERSION: The minimum version of Unity.
|
||||
MINIMUM_VERSION: 2020.3
|
||||
MAXIMUM_VERSION:
|
||||
# EXCLUDE_FILTER: The excluded versions of Unity.
|
||||
EXCLUDE_FILTER: "(2017|2018|2023.3)"
|
||||
IGNORE_ALPHA: false
|
||||
IGNORE_BETA: false
|
||||
PROJECT_PATH: .
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
unityVersions:
|
||||
description: 'Specify the Unity versions to test. (eg. [ "2019.4.41f2", "2020.3.15f2" ])'
|
||||
required: false
|
||||
default: '[ "2019.4.41f2", "2020.3.15f2" ]'
|
||||
usePeriodVersions:
|
||||
description: 'Use the period versions (.0f1, .10f1, 20f1, ...).'
|
||||
description: "Use the period versions (.0f1, .10f1, 20f1, ...)."
|
||||
required: false
|
||||
default: "true"
|
||||
overrideFindOptions:
|
||||
description: 'Specify options for unity-changeset. (eg. --ignore-alpha --max 2020.3 )'
|
||||
required: false
|
||||
default: '--min 2019.4 --max 9999.9 --ignore-alpha --ignore-beta'
|
||||
push:
|
||||
branches:
|
||||
- develop
|
||||
@@ -71,27 +60,9 @@ jobs:
|
||||
id: setup
|
||||
run: |
|
||||
echo "==== Target Unity Versions ===="
|
||||
|
||||
# Check if specific Unity versions are provided via inputs (for workflow_dispatch)
|
||||
if [ -n "${{ inputs.unityVersions }}" ]; then
|
||||
echo "* Using specified Unity versions" | tee $GITHUB_OUTPUT
|
||||
echo 'unityVersions=${{ inputs.unityVersions }}' | tee $GITHUB_OUTPUT
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Formulate find options based on inputs and environment variables
|
||||
FIND_OPTIONS=""
|
||||
[ "${{ env.IGNORE_ALPHA }}" = "true" ] && FIND_OPTIONS+=" --ignore-alpha"
|
||||
[ "${{ env.IGNORE_BETA }}" = "true" ] && FIND_OPTIONS+=" --ignore-beta"
|
||||
[ -n "${{ env.MINIMUM_VERSION }}" ] && FIND_OPTIONS+=" --min ${MINIMUM_VERSION}"
|
||||
[ -n "${{ env.MAXIMUM_VERSION }}" ] && FIND_OPTIONS+=" --max ${MAXIMUM_VERSION}"
|
||||
[ -n "${{ inputs.overrideFindOptions }}" ] && FIND_OPTIONS="${inputs.overrideFindOptions}"
|
||||
echo "find options: $FIND_OPTIONS"
|
||||
|
||||
# Find the latest Unity versions if no specific versions are provided
|
||||
LATEST_VERSIONS=`npx -y unity-changeset@latest list --json --versions --all --latest-patch $FIND_OPTIONS`
|
||||
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 -y unity-changeset@latest list --json --versions $FIND_OPTIONS --grep '0f'`
|
||||
ADDITIONAL_VERSIONS=`npx -y unity-changeset@latest list --json --versions --ignore-alpha --min ${MINIMUM_VERSION} --grep '0f'`
|
||||
else
|
||||
ADDITIONAL_VERSIONS=[]
|
||||
fi
|
||||
@@ -114,10 +85,10 @@ jobs:
|
||||
unityVersion: ${{ fromJson(needs.setup.outputs.unityVersions) }}
|
||||
steps:
|
||||
- name: 🚚 Checkout ($${{ github.ref }})
|
||||
uses: actions/checkout@v7
|
||||
uses: actions/checkout@v6
|
||||
|
||||
- name: 📥 Cache library
|
||||
uses: actions/cache@v6
|
||||
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 }}
|
||||
@@ -126,7 +97,7 @@ jobs:
|
||||
${{ env.PROJECT_PATH }}-Library-
|
||||
|
||||
- name: 🛠️ Build Unity Project (Test)
|
||||
uses: mob-sakai/unity-builder@fix/support-unity6.6
|
||||
uses: game-ci/unity-builder@v5
|
||||
timeout-minutes: 45
|
||||
with:
|
||||
customImage: ghcr.io/mob-sakai/unity3d:${{ matrix.unityVersion }}
|
||||
@@ -140,7 +111,7 @@ jobs:
|
||||
UNITY_LICENSE: ${{ secrets.UNITY_LICENSE }}
|
||||
|
||||
- name: 🧪 Run tests
|
||||
uses: mob-sakai/unity-test-runner@fix/support-unity6.6
|
||||
uses: game-ci/unity-test-runner@v4
|
||||
timeout-minutes: 45
|
||||
with:
|
||||
customImage: ghcr.io/mob-sakai/unity3d:${{ matrix.unityVersion }}
|
||||
|
||||
@@ -27,3 +27,4 @@ UserSettings/
|
||||
*.app/
|
||||
Build/
|
||||
Assets/TextMeshPro Support*
|
||||
Assets/UniText Support*
|
||||
|
||||
Binary file not shown.
@@ -1,34 +0,0 @@
|
||||
%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: 7e3976da977cb49238499ea3b4c237ae, type: 3}
|
||||
m_Name: ProfileDataSourceSettings
|
||||
m_EditorClassIdentifier:
|
||||
profileGroupTypes:
|
||||
- m_GroupTypePrefix: Built-In
|
||||
m_Variables:
|
||||
- m_Suffix: BuildPath
|
||||
m_Value: '[UnityEngine.AddressableAssets.Addressables.BuildPath]/[BuildTarget]'
|
||||
- m_Suffix: LoadPath
|
||||
m_Value: '{UnityEngine.AddressableAssets.Addressables.RuntimePath}/[BuildTarget]'
|
||||
- m_GroupTypePrefix: Editor Hosted
|
||||
m_Variables:
|
||||
- m_Suffix: BuildPath
|
||||
m_Value: ServerData/[BuildTarget]
|
||||
- m_Suffix: LoadPath
|
||||
m_Value: http://[PrivateIpAddress]:[HostingServicePort]
|
||||
environments: []
|
||||
currentEnvironment:
|
||||
id:
|
||||
projectId:
|
||||
projectGenesisId:
|
||||
name:
|
||||
isDefault: 0
|
||||
@@ -1,104 +1,22 @@
|
||||
using System.Collections;
|
||||
using System.Text;
|
||||
using Coffee.UIEffects;
|
||||
using UnityEngine;
|
||||
using UnityEngine.AddressableAssets;
|
||||
using UnityEngine.ResourceManagement.AsyncOperations;
|
||||
using UnityEngine.SceneManagement;
|
||||
using UnityEngine.UI;
|
||||
|
||||
public class HotUpdate : MonoBehaviour
|
||||
{
|
||||
[SerializeField]
|
||||
private string m_Address;
|
||||
|
||||
[SerializeField]
|
||||
private Text m_Log;
|
||||
|
||||
[SerializeField]
|
||||
private bool m_ExecuteOnStart;
|
||||
|
||||
private readonly StringBuilder _sb = new StringBuilder(1024);
|
||||
|
||||
private Coroutine _co;
|
||||
|
||||
private void Start()
|
||||
private IEnumerator Start()
|
||||
{
|
||||
if (m_ExecuteOnStart)
|
||||
{
|
||||
Execute();
|
||||
}
|
||||
}
|
||||
const string k_SettingsAddress = "Assets/ProjectSettings/UIEffectProjectSettings.asset";
|
||||
yield return Addressables.LoadAssetAsync<UIEffectProjectSettings>(k_SettingsAddress);
|
||||
|
||||
private void AddLog(string message)
|
||||
{
|
||||
Debug.Log(message);
|
||||
_sb.AppendLine(message);
|
||||
if (m_Log)
|
||||
{
|
||||
m_Log.text = _sb.ToString();
|
||||
}
|
||||
}
|
||||
#if UNITY_2022_2_OR_NEWER
|
||||
while (UIEffectProjectSettings.shaderVariantCollection.WarmUpProgressively(5) == false) yield return null;
|
||||
#else
|
||||
UIEffectProjectSettings.shaderVariantCollection.WarmUp();
|
||||
#endif
|
||||
|
||||
public void Execute()
|
||||
{
|
||||
if (string.IsNullOrEmpty(m_Address))
|
||||
{
|
||||
AddLog($"*** Address is empty. Please set the address of the asset to load.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (_co != null)
|
||||
{
|
||||
AddLog($"*** Execution is already in progress. Please wait until it completes.");
|
||||
return;
|
||||
}
|
||||
|
||||
_co = StartCoroutine(Co_Execute());
|
||||
}
|
||||
|
||||
public void LoadNextScene()
|
||||
{
|
||||
SceneManager.LoadScene(gameObject.scene.buildIndex + 1, LoadSceneMode.Single);
|
||||
}
|
||||
|
||||
private IEnumerator Co_Execute()
|
||||
{
|
||||
AddLog($"########################################");
|
||||
AddLog($"Hot update starting...");
|
||||
AddLog($"########################################");
|
||||
AddLog("");
|
||||
|
||||
AddLog($"Loading '{m_Address}'...");
|
||||
var handle = Addressables.LoadAssetAsync<Object>(m_Address);
|
||||
|
||||
while (handle.IsDone == false)
|
||||
{
|
||||
yield return new WaitForSeconds(0.1f);
|
||||
AddLog($" Progress: {handle.PercentComplete:P}");
|
||||
}
|
||||
|
||||
if (handle.Status == AsyncOperationStatus.Succeeded)
|
||||
{
|
||||
AddLog($" Loaded '{m_Address}' successfully.");
|
||||
}
|
||||
else
|
||||
{
|
||||
AddLog($" *** Failed to load '{m_Address}'.");
|
||||
AddLog($" *** {handle.OperationException.Message}");
|
||||
yield break;
|
||||
}
|
||||
|
||||
AddLog("");
|
||||
AddLog($"Hot-Update complete !");
|
||||
AddLog("");
|
||||
|
||||
AddLog($" -> Load next scene in: 3");
|
||||
yield return new WaitForSeconds(1f);
|
||||
AddLog($" -> Load next scene in: 2");
|
||||
yield return new WaitForSeconds(1f);
|
||||
AddLog($" -> Load next scene in: 1");
|
||||
yield return new WaitForSeconds(1f);
|
||||
|
||||
LoadNextScene();
|
||||
yield return SceneManager.LoadSceneAsync(gameObject.scene.buildIndex + 1, LoadSceneMode.Single);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -43,46 +43,6 @@ ShaderVariantCollection:
|
||||
passType: 0
|
||||
- keywords: GLOW_ON TRANSITION_SHINY UNDERLAY_ON
|
||||
passType: 0
|
||||
- keywords: GLOW_ON TONE_RETRO UNDERLAY_ON
|
||||
passType: 0
|
||||
- keywords: COLOR_FILTER GLOW_ON UNDERLAY_ON
|
||||
passType: 0
|
||||
- keywords: GLOW_ON SAMPLING_BLUR_DETAIL UNDERLAY_ON
|
||||
passType: 0
|
||||
- keywords: GLOW_ON SAMPLING_PIXELATION UNDERLAY_ON
|
||||
passType: 0
|
||||
- keywords: SAMPLING_PIXELATION TONE_RETRO
|
||||
passType: 0
|
||||
- keywords: GLOW_ON SAMPLING_RGB_SHIFT UNDERLAY_ON
|
||||
passType: 0
|
||||
- keywords: GLOW_ON SAMPLING_EDGE_LUMINANCE UNDERLAY_ON
|
||||
passType: 0
|
||||
- keywords: TRANSITION_DISSOLVE
|
||||
passType: 0
|
||||
- keywords: GLOW_ON TRANSITION_DISSOLVE UNDERLAY_ON
|
||||
passType: 0
|
||||
- keywords: TRANSITION_SHINY
|
||||
passType: 0
|
||||
- keywords: GLOW_ON TRANSITION_SHINY UNDERLAY_ON
|
||||
passType: 0
|
||||
- keywords: TRANSITION_MELT
|
||||
passType: 0
|
||||
- keywords: GLOW_ON TRANSITION_MELT UNDERLAY_ON
|
||||
passType: 0
|
||||
- keywords: TRANSITION_BURN
|
||||
passType: 0
|
||||
- keywords: GLOW_ON TRANSITION_BURN UNDERLAY_ON
|
||||
passType: 0
|
||||
- keywords: COLOR_FILTER GLOW_ON TRANSITION_BURN UNDERLAY_ON
|
||||
passType: 0
|
||||
- keywords: TRANSITION_PATTERN
|
||||
passType: 0
|
||||
- keywords: GLOW_ON TRANSITION_PATTERN UNDERLAY_ON
|
||||
passType: 0
|
||||
- keywords: EDGE_PLAIN GLOW_ON UNDERLAY_ON
|
||||
passType: 0
|
||||
- keywords: COLOR_FILTER GLOW_ON GRADATION_GRADIENT UNDERLAY_ON
|
||||
passType: 0
|
||||
- first: {fileID: 4800000, guid: 96246b1ead49a4c5a996fd477bc5a117, type: 3}
|
||||
second:
|
||||
variants:
|
||||
@@ -200,114 +160,6 @@ ShaderVariantCollection:
|
||||
passType: 0
|
||||
- keywords: TRANSITION_SHINY UNITY_UI_CLIP_RECT
|
||||
passType: 0
|
||||
- keywords: TONE_GRAYSCALE
|
||||
passType: 0
|
||||
- keywords: TONE_SEPIA
|
||||
passType: 0
|
||||
- keywords: TONE_NEGATIVE
|
||||
passType: 0
|
||||
- keywords: TONE_RETRO
|
||||
passType: 0
|
||||
- keywords: TONE_POSTERIZE
|
||||
passType: 0
|
||||
- keywords: COLOR_FILTER
|
||||
passType: 0
|
||||
- keywords: SAMPLING_BLUR_FAST
|
||||
passType: 0
|
||||
- keywords: COLOR_FILTER SAMPLING_BLUR_FAST
|
||||
passType: 0
|
||||
- keywords: COLOR_FILTER SAMPLING_BLUR_FAST UNITY_UI_CLIP_RECT
|
||||
passType: 0
|
||||
- keywords: COLOR_FILTER SAMPLING_BLUR_FAST TONE_GRAYSCALE
|
||||
passType: 0
|
||||
- keywords: SAMPLING_BLUR_MEDIUM
|
||||
passType: 0
|
||||
- keywords: SAMPLING_BLUR_DETAIL
|
||||
passType: 0
|
||||
- keywords: SAMPLING_PIXELATION
|
||||
passType: 0
|
||||
- keywords: SAMPLING_PIXELATION TONE_RETRO
|
||||
passType: 0
|
||||
- keywords: SAMPLING_PIXELATION TONE_RETRO UNITY_UI_CLIP_RECT
|
||||
passType: 0
|
||||
- keywords: SAMPLING_RGB_SHIFT
|
||||
passType: 0
|
||||
- keywords: SAMPLING_EDGE_LUMINANCE
|
||||
passType: 0
|
||||
- keywords: SAMPLING_EDGE_ALPHA
|
||||
passType: 0
|
||||
- keywords: TRANSITION_FADE
|
||||
passType: 0
|
||||
- keywords: TRANSITION_CUTOFF
|
||||
passType: 0
|
||||
- keywords: TRANSITION_DISSOLVE
|
||||
passType: 0
|
||||
- keywords: TRANSITION_DISSOLVE UNITY_UI_CLIP_RECT
|
||||
passType: 0
|
||||
- keywords: COLOR_FILTER SAMPLING_BLUR_FAST TONE_GRAYSCALE TRANSITION_DISSOLVE
|
||||
passType: 0
|
||||
- keywords: TRANSITION_SHINY
|
||||
passType: 0
|
||||
- keywords: TRANSITION_SHINY UNITY_UI_CLIP_RECT
|
||||
passType: 0
|
||||
- keywords: TRANSITION_MASK
|
||||
passType: 0
|
||||
- keywords: SAMPLING_EDGE_LUMINANCE TRANSITION_MASK
|
||||
passType: 0
|
||||
- keywords: TRANSITION_MELT
|
||||
passType: 0
|
||||
- keywords: TRANSITION_MELT UNITY_UI_CLIP_RECT
|
||||
passType: 0
|
||||
- keywords: COLOR_FILTER TRANSITION_MELT
|
||||
passType: 0
|
||||
- keywords: TRANSITION_BURN
|
||||
passType: 0
|
||||
- keywords: TRANSITION_BURN UNITY_UI_CLIP_RECT
|
||||
passType: 0
|
||||
- keywords: TRANSITION_PATTERN
|
||||
passType: 0
|
||||
- keywords: TRANSITION_PATTERN UNITY_UI_CLIP_RECT
|
||||
passType: 0
|
||||
- keywords: TRANSITION_BLAZE
|
||||
passType: 0
|
||||
- keywords: EDGE_PLAIN
|
||||
passType: 0
|
||||
- keywords: COLOR_FILTER EDGE_PLAIN
|
||||
passType: 0
|
||||
- keywords: EDGE_PLAIN TRANSITION_PATTERN
|
||||
passType: 0
|
||||
- keywords: COLOR_FILTER EDGE_PLAIN TRANSITION_PATTERN
|
||||
passType: 0
|
||||
- keywords: EDGE_SHINY
|
||||
passType: 0
|
||||
- keywords: COLOR_FILTER EDGE_SHINY
|
||||
passType: 0
|
||||
- keywords: EDGE_SHINY SAMPLING_EDGE_ALPHA
|
||||
passType: 0
|
||||
- keywords: EDGE_SHINY TRANSITION_PATTERN
|
||||
passType: 0
|
||||
- keywords: DETAIL_MASKING
|
||||
passType: 0
|
||||
- keywords: DETAIL_MULTIPLY
|
||||
passType: 0
|
||||
- keywords: DETAIL_ADDITIVE
|
||||
passType: 0
|
||||
- keywords: DETAIL_SUBTRACTIVE
|
||||
passType: 0
|
||||
- keywords: DETAIL_REPLACE
|
||||
passType: 0
|
||||
- keywords: DETAIL_MULTIPLY_ADDITIVE
|
||||
passType: 0
|
||||
- keywords: COLOR_FILTER TARGET_HUE
|
||||
passType: 0
|
||||
- keywords: COLOR_FILTER TARGET_LUMINANCE
|
||||
passType: 0
|
||||
- keywords: GRADATION_GRADIENT
|
||||
passType: 0
|
||||
- keywords: GRADATION_COLOR2
|
||||
passType: 0
|
||||
- keywords: GRADATION_COLOR4
|
||||
passType: 0
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -320,7 +172,7 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 7d43f626d9b5f4d729097092ded48bdb, type: 3}
|
||||
m_Name: UIEffectProjectSettings
|
||||
m_EditorClassIdentifier:
|
||||
m_PreLoadSettingsInBuild: 0
|
||||
m_PreLoadSettingsInBuild: 1
|
||||
m_RuntimePresets: []
|
||||
m_RuntimePresetsV2:
|
||||
- {fileID: 11400000, guid: 460881a8263ce454799a8c689c28d8c9, type: 2}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 6d68f022c46564bf6ac355588397507a
|
||||
guid: 39d1ffdf7437242d88b354142d4c7148
|
||||
folderAsset: yes
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
@@ -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}
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 4ecf31fe7c4aa4565ad61fab272f22b8
|
||||
guid: d2306542229b2418d8d9d4e76b80ed9e
|
||||
NativeFormatImporter:
|
||||
externalObjects: {}
|
||||
mainObjectFileID: 11400000
|
||||
@@ -8,6 +8,7 @@
|
||||
"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"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -104,6 +104,16 @@
|
||||
"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,
|
||||
@@ -136,7 +146,7 @@
|
||||
},
|
||||
"com.unity.modules.ui": {
|
||||
"version": "1.0.0",
|
||||
"depth": 2,
|
||||
"depth": 1,
|
||||
"source": "builtin",
|
||||
"dependencies": {}
|
||||
},
|
||||
|
||||
@@ -1,85 +1,3 @@
|
||||
## [5.11.9](https://github.com/mob-sakai/UIEffect/compare/5.11.8...5.11.9) (2026-11-14)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* color filter does not reflect the correct color space. ([6cbb793](https://github.com/mob-sakai/UIEffect/commit/6cbb793d8d421a14c6c694ea08914506607171fc)), closes [#409](https://github.com/mob-sakai/UIEffect/issues/409)
|
||||
* improve tweener editor ([4a49e9a](https://github.com/mob-sakai/UIEffect/commit/4a49e9a8b22e7c77851eef6810c3106e716cbb93))
|
||||
* support Unity 6.6+ with ShaderGraph package ([e856b0b](https://github.com/mob-sakai/UIEffect/commit/e856b0b9396025c3352054e65b090421ab2e3b40))
|
||||
* tweener does not affect multi-font glyphs (TMP_SubMeshUI) ([485e2df](https://github.com/mob-sakai/UIEffect/commit/485e2df9fc305db20aa473972f4a11e219cac7be)), closes [#413](https://github.com/mob-sakai/UIEffect/issues/413)
|
||||
|
||||
## [5.11.8](https://github.com/mob-sakai/UIEffect/compare/5.11.7...5.11.8) (2026-11-06)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* remove conflicting FormerlySerializedAs on UIEffectTweener.m_PlayOnEnable ([55a7f27](https://github.com/mob-sakai/UIEffect/commit/55a7f272042e869e6659f7a2603f9a16dbb3ab65))
|
||||
|
||||
## [5.11.7](https://github.com/mob-sakai/UIEffect/compare/5.11.6...5.11.7) (2026-08-27)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* ignore shader registry order changes ([014bba3](https://github.com/mob-sakai/UIEffect/commit/014bba3f5687ecfe41caa00d454f196baf7e3483)), closes [#407](https://github.com/mob-sakai/UIEffect/issues/407)
|
||||
|
||||
## [5.11.6](https://github.com/mob-sakai/UIEffect/compare/5.11.5...5.11.6) (2026-08-17)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* refresh material when changing shadow mode ([8bb782c](https://github.com/mob-sakai/UIEffect/commit/8bb782c90afb42d6569d8dfcfe022b007171f97e))
|
||||
|
||||
## [5.11.5](https://github.com/mob-sakai/UIEffect/compare/5.11.4...5.11.5) (2026-07-23)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* fix memory leak ([2dcb7f7](https://github.com/mob-sakai/UIEffect/commit/2dcb7f7e8678a2ffcf3832d0c5011aa1da6c3677)), closes [#405](https://github.com/mob-sakai/UIEffect/issues/405)
|
||||
|
||||
## [5.11.4](https://github.com/mob-sakai/UIEffect/compare/5.11.3...5.11.4) (2026-07-22)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* infinite asset import loop caused by unchanged ProjectSettings being marked dirty ([dbf8ae0](https://github.com/mob-sakai/UIEffect/commit/dbf8ae00f50470912d458fda853a34ef94d7d533)), closes [#404](https://github.com/mob-sakai/UIEffect/issues/404)
|
||||
|
||||
## [5.11.3](https://github.com/mob-sakai/UIEffect/compare/5.11.2...5.11.3) (2026-07-04)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* TextMeshPro support is not working ([9d98096](https://github.com/mob-sakai/UIEffect/commit/9d980961d6cf45e519ad96bf2e7260ed515f0f70)), closes [#402](https://github.com/mob-sakai/UIEffect/issues/402)
|
||||
|
||||
## [5.11.2](https://github.com/mob-sakai/UIEffect/compare/5.11.1...5.11.2) (2026-07-02)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* add null check ([161fc54](https://github.com/mob-sakai/UIEffect/commit/161fc546cad251ad798c2fd9e9472d687aa7f2c3))
|
||||
|
||||
## [5.11.1](https://github.com/mob-sakai/UIEffect/compare/5.11.0...5.11.1) (2026-06-29)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* support "disable domain reload" on Unity 6.6 or later ([a556c28](https://github.com/mob-sakai/UIEffect/commit/a556c282210303d9e7a7c284bb4b41ef3a35e3e1))
|
||||
|
||||
# [5.11.0](https://github.com/mob-sakai/UIEffect/compare/5.10.9...5.11.0) (2026-06-25)
|
||||
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
* enable/disable Gameobject break effect with 'TrueShadow' ([730aa2b](https://github.com/mob-sakai/UIEffect/commit/730aa2bb4d872ddab63f2dad611a063cefa07064)), closes [#400](https://github.com/mob-sakai/UIEffect/issues/400)
|
||||
* select TMP submesh by mesh before material ([f538ef2](https://github.com/mob-sakai/UIEffect/commit/f538ef2cba3d4d76f6683bccee65d5a9694dad37))
|
||||
* some fix ([b6b538f](https://github.com/mob-sakai/UIEffect/commit/b6b538f64f0b06ddfb4ad2edd6b7db6dc1d067d8))
|
||||
* Support for skipping "reload domain" ([ec3fb13](https://github.com/mob-sakai/UIEffect/commit/ec3fb13c111638781bf852e2a4a4747fbfeb7d3a))
|
||||
|
||||
|
||||
### Features
|
||||
|
||||
* add option to remove from preloadedAssets when build player ([e955715](https://github.com/mob-sakai/UIEffect/commit/e955715c99c474881e0b27ecc325061ce0d866a0)), closes [#393](https://github.com/mob-sakai/UIEffect/issues/393)
|
||||
* support XBOX One/Series ([72bb1c5](https://github.com/mob-sakai/UIEffect/commit/72bb1c51318829e7ced3b1436892a5969aedd9a3)), closes [#385](https://github.com/mob-sakai/UIEffect/issues/385) [#394](https://github.com/mob-sakai/UIEffect/issues/394)
|
||||
|
||||
## [5.10.9](https://github.com/mob-sakai/UIEffect/compare/5.10.8...5.10.9) (2026-06-08)
|
||||
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ namespace Coffee.UIEffects.Timeline
|
||||
public override void DrawBackground(TimelineClip clip, ClipBackgroundRegion region)
|
||||
{
|
||||
var director = TimelineEditor.inspectedDirector;
|
||||
if (director == null) return;
|
||||
if (!director) return;
|
||||
|
||||
var viewDuration = region.endTime - region.startTime;
|
||||
var inDuration = (float)Math.Max(clip.easeInDuration, clip.blendInDuration);
|
||||
@@ -38,7 +38,7 @@ namespace Coffee.UIEffects.Timeline
|
||||
}
|
||||
|
||||
var floatClip = clip.asset as UIEffectFloatClip;
|
||||
if (floatClip != null)
|
||||
if (floatClip)
|
||||
{
|
||||
if (track is GradationRotationTrack || track is GradationOffsetTrack)
|
||||
{
|
||||
@@ -60,7 +60,7 @@ namespace Coffee.UIEffects.Timeline
|
||||
protected override void DrawBackground(Rect rect, TimelineClip clip)
|
||||
{
|
||||
var asset = clip.asset as UIEffectFloatClip;
|
||||
if (asset == null) return;
|
||||
if (!asset) return;
|
||||
|
||||
if (s_FromStyle == null)
|
||||
{
|
||||
@@ -97,7 +97,7 @@ namespace Coffee.UIEffects.Timeline
|
||||
protected override void DrawBackground(Rect p, TimelineClip clip)
|
||||
{
|
||||
var asset = clip.asset as UIEffectColorClip;
|
||||
if (asset == null) return;
|
||||
if (!asset) return;
|
||||
|
||||
var d = asset.m_Data;
|
||||
if (d.m_Tween)
|
||||
|
||||
@@ -24,8 +24,8 @@ namespace Coffee.UIEffects.Editors
|
||||
|
||||
private static bool expandOthers
|
||||
{
|
||||
get => UIEffectEditorSettings.instance.m_ExpandOthers;
|
||||
set => UIEffectEditorSettings.instance.m_ExpandOthers = value;
|
||||
get => UIEffectEditorSettings.instance.m_ExpandOthers;
|
||||
}
|
||||
|
||||
protected override void OnEnable()
|
||||
|
||||
@@ -10,24 +10,27 @@ using UnityEditorInternal;
|
||||
namespace Coffee.UIEffects.Editors
|
||||
{
|
||||
[CustomEditor(typeof(UIEffectProjectSettings))]
|
||||
internal class UIEffectProjectSettingsEditor : PreloadedProjectSettingsEditor
|
||||
public class UIEffectProjectSettingsEditor : Editor
|
||||
{
|
||||
private ReorderableList _reorderableList;
|
||||
private SerializedProperty _runtimePresets;
|
||||
private SerializedProperty _runtimePresetsV2;
|
||||
private SerializedProperty _useHDRColorPicker;
|
||||
private SerializedProperty _preLoadSettingsInBuild;
|
||||
private bool _isInitialized;
|
||||
private ShaderVariantRegistryEditor _shaderVariantRegistryEditor;
|
||||
private UIEffect[] _legacyPresets;
|
||||
private bool _expandRuntimePresets;
|
||||
private bool _expandLegacyPrefabs;
|
||||
|
||||
protected override void OnEnable()
|
||||
private void InitializeIfNeeded()
|
||||
{
|
||||
base.OnEnable();
|
||||
_legacyPresets = UIEffectProjectSettings.LoadEditorPresets();
|
||||
if (_isInitialized) return;
|
||||
|
||||
_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");
|
||||
@@ -38,7 +41,7 @@ namespace Coffee.UIEffects.Editors
|
||||
rect.y += 2;
|
||||
rect.height = EditorGUIUtility.singleLineHeight;
|
||||
|
||||
EditorGUI.BeginDisabledGroup(effect != null && effect.hideFlags == HideFlags.NotEditable);
|
||||
EditorGUI.BeginDisabledGroup(effect && effect.hideFlags == HideFlags.NotEditable);
|
||||
EditorGUI.PropertyField(rect, element, GUIContent.none);
|
||||
EditorGUI.EndDisabledGroup();
|
||||
};
|
||||
@@ -49,18 +52,23 @@ namespace Coffee.UIEffects.Editors
|
||||
UIEffectProjectSettings.RegisterRuntimePreset);
|
||||
};
|
||||
|
||||
_shaderVariantRegistryEditor = ShaderVariantRegistryEditor.Create(serializedObject, "(UIEffect)",
|
||||
() =>
|
||||
{
|
||||
UIEffectProjectSettings.shaderRegistry
|
||||
.RegisterOptionalShaders(UIEffectProjectSettings.instance);
|
||||
});
|
||||
_isInitialized = true;
|
||||
}
|
||||
|
||||
private void OnEnable()
|
||||
{
|
||||
_legacyPresets = UIEffectProjectSettings.LoadEditorPresets();
|
||||
}
|
||||
|
||||
private void OnDisable()
|
||||
{
|
||||
_isInitialized = false;
|
||||
}
|
||||
|
||||
public override void OnInspectorGUI()
|
||||
{
|
||||
EditorGUIUtility.labelWidth = 180;
|
||||
base.OnInspectorGUI();
|
||||
serializedObject.Update();
|
||||
InitializeIfNeeded();
|
||||
|
||||
// Settings
|
||||
// Runtime Presets
|
||||
@@ -71,24 +79,52 @@ namespace Coffee.UIEffects.Editors
|
||||
|
||||
// Editor
|
||||
// Use HDR color pickers.
|
||||
EditorGUIUtility.labelWidth = 200;
|
||||
EditorGUILayout.PropertyField(_useHDRColorPicker);
|
||||
|
||||
// Shader
|
||||
// Shader registry
|
||||
EditorGUILayout.Space();
|
||||
EditorGUILayout.LabelField("Shader", EditorStyles.boldLabel);
|
||||
if (_shaderVariantRegistryEditor == null)
|
||||
{
|
||||
var property = serializedObject.FindProperty("m_ShaderVariantRegistry");
|
||||
_shaderVariantRegistryEditor = new ShaderVariantRegistryEditor(property, "(UIEffect)",
|
||||
() =>
|
||||
{
|
||||
UIEffectProjectSettings.shaderRegistry
|
||||
.RegisterOptionalShaders(UIEffectProjectSettings.instance);
|
||||
});
|
||||
}
|
||||
|
||||
_shaderVariantRegistryEditor.Draw();
|
||||
|
||||
DrawPreLoadSettingsInBuild("UIEffect");
|
||||
serializedObject.ApplyModifiedProperties();
|
||||
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();
|
||||
}
|
||||
|
||||
private void DrawLegacyPresets()
|
||||
{
|
||||
for (var i = _runtimePresets.arraySize - 1; 0 <= i; i--)
|
||||
{
|
||||
if (_runtimePresets.GetArrayElementAtIndex(i).objectReferenceValue == null)
|
||||
if (!_runtimePresets.GetArrayElementAtIndex(i).objectReferenceValue)
|
||||
{
|
||||
_runtimePresets.DeleteArrayElementAtIndex(i);
|
||||
}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1a9c54e67e8c9495fa77bfe119825877
|
||||
timeCreated: 1487152293
|
||||
licenseType: Pro
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace Coffee.UIEffects.Editors
|
||||
|
||||
var r = EditorGUILayout.GetControlRect();
|
||||
r.width -= 120;
|
||||
if (_preset.objectReferenceValue != null)
|
||||
if (_preset.objectReferenceValue)
|
||||
{
|
||||
EditorGUI.PropertyField(r, _preset);
|
||||
}
|
||||
@@ -81,7 +81,7 @@ namespace Coffee.UIEffects.Editors
|
||||
EditorGUILayout.PropertyField(_allowToModifyMeshShape);
|
||||
|
||||
var parent = _target.objectReferenceValue ?? _preset.objectReferenceValue;
|
||||
if (parent != null)
|
||||
if (parent)
|
||||
{
|
||||
EditorGUI.BeginDisabledGroup(true);
|
||||
CreateCachedEditor(parent, null, ref _uiEffectEditor);
|
||||
|
||||
@@ -90,9 +90,8 @@ namespace Coffee.UIEffects.Editors
|
||||
|
||||
private void DrawPlayer(UIEffectTweener tweener)
|
||||
{
|
||||
if (tweener == null) return;
|
||||
if (!tweener) return;
|
||||
|
||||
EditorGUI.BeginDisabledGroup(!tweener.enabled);
|
||||
EditorGUILayout.Space(4);
|
||||
GUILayout.Label(GUIContent.none, "sv_iconselector_sep", GUILayout.ExpandWidth(true));
|
||||
|
||||
@@ -102,7 +101,6 @@ namespace Coffee.UIEffects.Editors
|
||||
if (GUI.Button(rResetTimeButton, EditorGUIUtility.IconContent("animation.firstkey"), "IconButton"))
|
||||
{
|
||||
ResetTime();
|
||||
EditorApplication.QueuePlayerLoopUpdate();
|
||||
}
|
||||
|
||||
var rPlayButton = new Rect(r.x + 20, r.y, 20, r.height);
|
||||
@@ -150,15 +148,12 @@ namespace Coffee.UIEffects.Editors
|
||||
if (EditorGUI.EndChangeCheck())
|
||||
{
|
||||
SetTime(time);
|
||||
EditorApplication.QueuePlayerLoopUpdate();
|
||||
}
|
||||
|
||||
if (Application.isPlaying && tweener.isActiveAndEnabled)
|
||||
{
|
||||
Repaint();
|
||||
}
|
||||
|
||||
EditorGUI.EndDisabledGroup();
|
||||
}
|
||||
|
||||
private static float DrawBackground(Rect r, float width, Color color)
|
||||
@@ -173,7 +168,6 @@ namespace Coffee.UIEffects.Editors
|
||||
{
|
||||
foreach (var tweener in targets.OfType<UIEffectTweener>())
|
||||
{
|
||||
if (!tweener.enabled) continue;
|
||||
tweener.SetTime(time);
|
||||
}
|
||||
}
|
||||
@@ -182,7 +176,6 @@ namespace Coffee.UIEffects.Editors
|
||||
{
|
||||
foreach (var tweener in targets.OfType<UIEffectTweener>())
|
||||
{
|
||||
if (!tweener.enabled) continue;
|
||||
tweener.ResetTime(tweener.direction);
|
||||
}
|
||||
}
|
||||
@@ -217,7 +210,6 @@ namespace Coffee.UIEffects.Editors
|
||||
_lastTime = EditorApplication.timeSinceStartup;
|
||||
foreach (var tweener in targets.OfType<UIEffectTweener>())
|
||||
{
|
||||
if (!tweener.enabled) continue;
|
||||
tweener.UpdateTime(tweener.direction == UIEffectTweener.Direction.Forward ? delta : -delta);
|
||||
}
|
||||
|
||||
|
||||
@@ -211,10 +211,9 @@ If upgrading from UIEffect v4 to v5, note the following breaking changes:
|
||||

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

|
||||
|
||||
@@ -460,8 +459,8 @@ You can preview the animation using the seek bar and play button.
|
||||
The `UIEffectReplica` component applies visual effects to UI elements by replicating the settings of another `UIEffect` component. This allows the same effect to be applied across multiple UI elements simultaneously.
|
||||
|
||||
- **Target**: The target `UIEffect` component to replicate.
|
||||
> [!TIP]
|
||||
> You can specify a preset as well as an instance as the target for `UIEffectReplica`.
|
||||
> [!TIP]
|
||||
> You can specify a preset as well as an instance as the target for `UIEffectReplica`.
|
||||
- **Use Target Transform**: Use the target's transform for some effects.
|
||||

|
||||
- **Custom Root**: Use the custom transform for some effects.
|
||||
|
||||
@@ -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
|
||||
}
|
||||
}
|
||||
@@ -12,33 +12,6 @@ namespace Coffee.UIEffectInternal
|
||||
/// </summary>
|
||||
internal static class ComponentExtensions
|
||||
{
|
||||
#if !UNITY_2019_2_OR_NEWER
|
||||
public static bool TryGetComponent<T>(this GameObject self, out T component)
|
||||
where T : Component
|
||||
{
|
||||
if (self == null)
|
||||
{
|
||||
component = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
component = self.GetComponent<T>();
|
||||
return component != null;
|
||||
}
|
||||
|
||||
public static bool TryGetComponent<T>(this Component self, out T component)
|
||||
where T : Component
|
||||
{
|
||||
if (self == null)
|
||||
{
|
||||
component = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
return self.gameObject.TryGetComponent(out component);
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Get components in children of a specific type in the hierarchy of a GameObject.
|
||||
/// </summary>
|
||||
@@ -99,7 +72,7 @@ namespace Coffee.UIEffectInternal
|
||||
{
|
||||
T component = null;
|
||||
var transform = self.transform;
|
||||
while (transform != null)
|
||||
while (transform)
|
||||
{
|
||||
if (transform.TryGetComponent<T>(out var c))
|
||||
{
|
||||
@@ -120,7 +93,7 @@ namespace Coffee.UIEffectInternal
|
||||
where T : Component
|
||||
{
|
||||
var tr = includeSelf ? self.transform : self.transform.parent;
|
||||
while (tr != null)
|
||||
while (tr)
|
||||
{
|
||||
if (tr.TryGetComponent<T>(out var c) && valid(c)) return c;
|
||||
if (tr == stopAfter) return null;
|
||||
@@ -197,7 +170,7 @@ namespace Coffee.UIEffectInternal
|
||||
if (!includeInactive) return self.GetComponentInParent<T>();
|
||||
|
||||
var current = self.transform;
|
||||
while (current != null)
|
||||
while (current)
|
||||
{
|
||||
if (current.TryGetComponent<T>(out var c)) return c;
|
||||
current = current.parent;
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace Coffee.UIEffectInternal
|
||||
mesh => mesh,
|
||||
mesh =>
|
||||
{
|
||||
if (mesh != null)
|
||||
if (mesh)
|
||||
{
|
||||
mesh.Clear();
|
||||
}
|
||||
@@ -37,7 +37,7 @@ namespace Coffee.UIEffectInternal
|
||||
|
||||
public static void CopyTo(this Mesh self, Mesh dst)
|
||||
{
|
||||
if (self == null || dst == null) return;
|
||||
if (!self || !dst) return;
|
||||
|
||||
var vector3List = InternalListPool<Vector3>.Rent();
|
||||
var vector4List = InternalListPool<Vector4>.Rent();
|
||||
@@ -84,12 +84,14 @@ namespace Coffee.UIEffectInternal
|
||||
{
|
||||
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 == null || dst == null) return;
|
||||
if (!self || dst == null) return;
|
||||
|
||||
var vertexCount = self.vertexCount;
|
||||
var indexCount = self.triangles.Length;
|
||||
@@ -98,14 +100,12 @@ namespace Coffee.UIEffectInternal
|
||||
|
||||
public static void CopyTo(this Mesh self, VertexHelper dst, int vertexCount, int indexCount)
|
||||
{
|
||||
if (self == null || dst == null) return;
|
||||
if (!self || dst == null) return;
|
||||
|
||||
var positions = InternalListPool<Vector3>.Rent();
|
||||
var normals = InternalListPool<Vector3>.Rent();
|
||||
var uv0 = InternalListPool<Vector4>.Rent();
|
||||
var uv1 = InternalListPool<Vector4>.Rent();
|
||||
var uv2 = InternalListPool<Vector4>.Rent();
|
||||
var uv3 = InternalListPool<Vector4>.Rent();
|
||||
var tangents = InternalListPool<Vector4>.Rent();
|
||||
var colors = InternalListPool<Color32>.Rent();
|
||||
var indices = InternalListPool<int>.Rent();
|
||||
@@ -113,8 +113,6 @@ namespace Coffee.UIEffectInternal
|
||||
self.GetColors(colors);
|
||||
self.GetUVs(0, uv0);
|
||||
self.GetUVs(1, uv1);
|
||||
self.GetUVs(2, uv2);
|
||||
self.GetUVs(3, uv3);
|
||||
self.GetNormals(normals);
|
||||
self.GetTangents(tangents);
|
||||
self.GetIndices(indices, 0);
|
||||
@@ -123,7 +121,7 @@ namespace Coffee.UIEffectInternal
|
||||
for (var i = 0; i < vertexCount; i++)
|
||||
{
|
||||
dst.AddVert(positions.GetOrDefault(i), colors.GetOrDefault(i), uv0.GetOrDefault(i), uv1.GetOrDefault(i),
|
||||
uv2.GetOrDefault(i), uv3.GetOrDefault(i), normals.GetOrDefault(i), tangents.GetOrDefault(i));
|
||||
normals.GetOrDefault(i), tangents.GetOrDefault(i));
|
||||
}
|
||||
|
||||
var count = Mathf.Clamp(indexCount, 0, indices.Count);
|
||||
@@ -136,8 +134,6 @@ namespace Coffee.UIEffectInternal
|
||||
InternalListPool<Vector3>.Return(ref normals);
|
||||
InternalListPool<Vector4>.Return(ref uv0);
|
||||
InternalListPool<Vector4>.Return(ref uv1);
|
||||
InternalListPool<Vector4>.Return(ref uv2);
|
||||
InternalListPool<Vector4>.Return(ref uv3);
|
||||
InternalListPool<Vector4>.Return(ref tangents);
|
||||
InternalListPool<Color32>.Return(ref colors);
|
||||
InternalListPool<int>.Return(ref indices);
|
||||
|
||||
@@ -15,37 +15,38 @@ namespace Coffee.UIEffectInternal
|
||||
#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.")]
|
||||
"When disable, you should load this settings via Resources, AssetBundles or " +
|
||||
"Addressables to use UIEffect.")]
|
||||
[SerializeField]
|
||||
[Header("Advanced")]
|
||||
[HideInInspector]
|
||||
private bool m_PreLoadSettingsInBuild = true;
|
||||
|
||||
protected static bool s_BuildingPlayer;
|
||||
|
||||
private class EditorEvents : AssetPostprocessor, IPreprocessBuildWithReport, IPostprocessBuildWithReport
|
||||
private class Postprocessor : AssetPostprocessor
|
||||
{
|
||||
int IOrderedCallback.callbackOrder => 0;
|
||||
|
||||
private static void OnPostprocessAllAssets(string[] _, string[] __, string[] ___, string[] ____)
|
||||
{
|
||||
Initialize();
|
||||
}
|
||||
}
|
||||
|
||||
private class ExcludeFromBuild : IPreprocessBuildWithReport, IPostprocessBuildWithReport
|
||||
{
|
||||
int IOrderedCallback.callbackOrder => 0;
|
||||
|
||||
void IPreprocessBuildWithReport.OnPreprocessBuild(BuildReport report)
|
||||
{
|
||||
AssetDatabase.Refresh();
|
||||
Initialize();
|
||||
s_BuildingPlayer = true;
|
||||
|
||||
foreach (var t in TypeCache.GetTypesDerivedFrom(typeof(PreloadedProjectSettings<>)))
|
||||
{
|
||||
var settings = GetDefaultSettings(t);
|
||||
if (settings == null || settings.m_PreLoadSettingsInBuild) continue;
|
||||
if (!settings || settings.m_PreLoadSettingsInBuild) continue;
|
||||
|
||||
PlayerSettings.SetPreloadedAssets(
|
||||
PlayerSettings.GetPreloadedAssets()
|
||||
.Where(x => x != null && x.GetType() != t)
|
||||
.Where(x => x && x.GetType() != t)
|
||||
.ToArray());
|
||||
|
||||
Debug.Log($"[PreloadedProjectSettings] Build started: removed '{settings.name}' " +
|
||||
@@ -68,12 +69,9 @@ namespace Coffee.UIEffectInternal
|
||||
var defaultSettings = GetDefaultSettings(t);
|
||||
if (defaultSettings == null)
|
||||
{
|
||||
if (!s_BuildingPlayer)
|
||||
{
|
||||
// When create a new instance, automatically set it as default settings.
|
||||
defaultSettings = CreateInstance(t) as PreloadedProjectSettings;
|
||||
SetDefaultSettings(defaultSettings);
|
||||
}
|
||||
// When create a new instance, automatically set it as default settings.
|
||||
defaultSettings = CreateInstance(t) as PreloadedProjectSettings;
|
||||
if (!s_BuildingPlayer) SetDefaultSettings(defaultSettings);
|
||||
}
|
||||
else if (GetPreloadedSettings(t).Length != 1)
|
||||
{
|
||||
@@ -105,7 +103,7 @@ namespace Coffee.UIEffectInternal
|
||||
protected static PreloadedProjectSettings GetDefaultSettings(Type type)
|
||||
{
|
||||
return GetPreloadedSettings(type).FirstOrDefault() as PreloadedProjectSettings
|
||||
?? AssetDatabase.FindAssets($"t:{type.Name}")
|
||||
?? AssetDatabase.FindAssets($"t:{nameof(PreloadedProjectSettings)}")
|
||||
.Select(AssetDatabase.GUIDToAssetPath)
|
||||
.Select(AssetDatabase.LoadAssetAtPath<PreloadedProjectSettings>)
|
||||
.FirstOrDefault(x => x != null && x.GetType() == type);
|
||||
@@ -152,35 +150,6 @@ namespace Coffee.UIEffectInternal
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
internal abstract class PreloadedProjectSettingsEditor : Editor
|
||||
{
|
||||
private SerializedProperty _preLoadSettingsInBuild;
|
||||
|
||||
protected virtual void OnEnable()
|
||||
{
|
||||
_preLoadSettingsInBuild = serializedObject.FindProperty("m_PreLoadSettingsInBuild");
|
||||
}
|
||||
|
||||
protected void DrawPreLoadSettingsInBuild(string packageName)
|
||||
{
|
||||
EditorGUILayout.PropertyField(_preLoadSettingsInBuild);
|
||||
if (!_preLoadSettingsInBuild.boolValue)
|
||||
{
|
||||
EditorGUILayout.BeginHorizontal();
|
||||
EditorGUILayout.HelpBox(
|
||||
$"{target.GetType().Name} asset will not be built in.\n" +
|
||||
$"please load manually from Resources, AssetBundle, or Addressables before using {packageName}.",
|
||||
MessageType.Warning);
|
||||
if (GUILayout.Button("Ping"))
|
||||
{
|
||||
EditorGUIUtility.PingObject(target);
|
||||
}
|
||||
|
||||
EditorGUILayout.EndHorizontal();
|
||||
}
|
||||
}
|
||||
}
|
||||
#else
|
||||
{
|
||||
}
|
||||
@@ -219,7 +188,7 @@ namespace Coffee.UIEffectInternal
|
||||
|
||||
private void OnPlayModeStateChanged(PlayModeStateChange state)
|
||||
{
|
||||
if (this == null) return;
|
||||
if (!this) return;
|
||||
|
||||
switch (state)
|
||||
{
|
||||
@@ -237,7 +206,7 @@ namespace Coffee.UIEffectInternal
|
||||
}
|
||||
}
|
||||
#else
|
||||
public static T instance => s_Instance != null ? s_Instance : s_Instance = CreateInstance<T>();
|
||||
public static T instance => s_Instance != null ? s_Instance : s_Instance = CreateInstance<T>();
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
@@ -253,10 +222,9 @@ namespace Coffee.UIEffectInternal
|
||||
return;
|
||||
}
|
||||
|
||||
EditorApplication.playModeStateChanged -= OnPlayModeStateChanged;
|
||||
EditorApplication.playModeStateChanged += OnPlayModeStateChanged;
|
||||
#else
|
||||
if (s_Instance != null && s_Instance != this)
|
||||
if (s_Instance && s_Instance != this)
|
||||
{
|
||||
Destroy(s_Instance);
|
||||
}
|
||||
@@ -291,7 +259,7 @@ namespace Coffee.UIEffectInternal
|
||||
{
|
||||
if (_target == null)
|
||||
{
|
||||
if (_editor != null)
|
||||
if (_editor)
|
||||
{
|
||||
DestroyImmediate(_editor);
|
||||
_editor = null;
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace Coffee.UIEffectInternal
|
||||
foreach (var shaderName in s_ShaderNames)
|
||||
{
|
||||
var shader = Shader.Find(shaderName);
|
||||
if (shader == null) continue;
|
||||
if (!shader) continue;
|
||||
|
||||
var hasCgincError = ShaderUtil.GetShaderMessages(shader)
|
||||
.Any(x => Regex.IsMatch(x.message, $"Couldn't open include file.*{s_CgincPattern}"));
|
||||
|
||||
@@ -66,6 +66,11 @@ namespace Coffee.UIEffectInternal
|
||||
node = node.Next;
|
||||
}
|
||||
}
|
||||
|
||||
public void Clear()
|
||||
{
|
||||
_delegates.Clear();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -1,6 +1,5 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using UnityEditor;
|
||||
using UnityEngine;
|
||||
|
||||
namespace Coffee.UIEffectInternal
|
||||
@@ -9,20 +8,19 @@ namespace Coffee.UIEffectInternal
|
||||
{
|
||||
private static readonly Dictionary<Type, IFrameCache> s_Caches = new Dictionary<Type, IFrameCache>();
|
||||
|
||||
#if UNITY_EDITOR && UNITY_2019_3_OR_NEWER
|
||||
[InitializeOnLoadMethod]
|
||||
static FrameCache()
|
||||
{
|
||||
s_Caches.Clear();
|
||||
UIExtraCallbacks.onLateAfterCanvasRebuild += ClearAllCache;
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
|
||||
#elif UNITY_EDITOR
|
||||
[InitializeOnLoadMethod]
|
||||
#else
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
|
||||
#endif
|
||||
private static void Clear()
|
||||
{
|
||||
s_Caches.Clear();
|
||||
UIExtraCallbacks.onLateAfterCanvasRebuild -= ClearAllCache;
|
||||
UIExtraCallbacks.onLateAfterCanvasRebuild += ClearAllCache;
|
||||
}
|
||||
#endif
|
||||
|
||||
/// <summary>
|
||||
/// Tries to retrieve a value from the frame cache with a specified key.
|
||||
|
||||
@@ -13,9 +13,7 @@ namespace Coffee.UIEffectInternal
|
||||
|
||||
public static int count => s_Repository.count;
|
||||
|
||||
public static Func<string, Shader> onShaderFind = Shader.Find;
|
||||
|
||||
#if UNITY_EDITOR && UNITY_2019_3_OR_NEWER
|
||||
#if UNITY_EDITOR
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
|
||||
public static void Clear()
|
||||
{
|
||||
@@ -50,7 +48,7 @@ namespace Coffee.UIEffectInternal
|
||||
public static void Get(Hash128 hash, ref Material material, string shaderName)
|
||||
{
|
||||
Profiler.BeginSample("(COF)[MaterialRepository] Get");
|
||||
s_Repository.Get(hash, ref material, x => new Material(onShaderFind(x))
|
||||
s_Repository.Get(hash, ref material, x => new Material(Shader.Find(x))
|
||||
{
|
||||
hideFlags = HideFlags.DontSave | HideFlags.NotEditable
|
||||
}, shaderName);
|
||||
@@ -63,7 +61,7 @@ namespace Coffee.UIEffectInternal
|
||||
public static void Get(Hash128 hash, ref Material material, string shaderName, string[] keywords)
|
||||
{
|
||||
Profiler.BeginSample("(COF)[MaterialRepository] Get");
|
||||
s_Repository.Get(hash, ref material, x => new Material(onShaderFind(x.shaderName))
|
||||
s_Repository.Get(hash, ref material, x => new Material(Shader.Find(x.shaderName))
|
||||
{
|
||||
hideFlags = HideFlags.DontSave | HideFlags.NotEditable,
|
||||
shaderKeywords = x.keywords
|
||||
|
||||
@@ -48,10 +48,15 @@ namespace Coffee.UIEffectInternal
|
||||
{
|
||||
if (obj == null) return;
|
||||
#if UNITY_EDITOR
|
||||
Object.DestroyImmediate(obj, true);
|
||||
#else
|
||||
Object.Destroy(obj);
|
||||
if (Application.isEditor)
|
||||
{
|
||||
Object.DestroyImmediate(obj);
|
||||
}
|
||||
else
|
||||
#endif
|
||||
{
|
||||
Object.Destroy(obj);
|
||||
}
|
||||
}
|
||||
|
||||
[Conditional("UNITY_EDITOR")]
|
||||
@@ -109,7 +114,7 @@ namespace Coffee.UIEffectInternal
|
||||
{
|
||||
if (Misc.isBatchOrBuilding) return;
|
||||
|
||||
var types = TypeCache.GetTypesWithAttribute(typeof(IconAttribute));
|
||||
var types = TypeCache.GetTypesWithAttribute<IconAttribute>();
|
||||
var scripts = MonoImporter.GetAllRuntimeMonoScripts();
|
||||
foreach (var type in types)
|
||||
{
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
#if UNITY_EDITOR
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using UnityEngine;
|
||||
@@ -22,7 +23,6 @@ namespace Coffee.UIEffectInternal
|
||||
|
||||
// Collect sample names.
|
||||
s_Samples = samples;
|
||||
s_SampleNames.Clear();
|
||||
foreach (var (shaderName, sampleName, _) in samples)
|
||||
{
|
||||
s_SampleNames[shaderName] = sampleName;
|
||||
@@ -107,7 +107,7 @@ namespace Coffee.UIEffectInternal
|
||||
if (string.IsNullOrEmpty(shaderName)) return null;
|
||||
|
||||
var shader = Shader.Find(shaderName);
|
||||
if (shader == null) return null;
|
||||
if (!shader) return null;
|
||||
|
||||
var path = AssetDatabase.GetAssetPath(shader);
|
||||
if (string.IsNullOrEmpty(path)) return null;
|
||||
@@ -118,7 +118,7 @@ namespace Coffee.UIEffectInternal
|
||||
private static void DeleteShader(string shaderName)
|
||||
{
|
||||
var shader = Shader.Find(shaderName);
|
||||
if (shader != null)
|
||||
if (shader)
|
||||
{
|
||||
AssetDatabase.DeleteAsset(AssetDatabase.GetAssetPath(shader));
|
||||
}
|
||||
@@ -156,15 +156,12 @@ namespace Coffee.UIEffectInternal
|
||||
}
|
||||
|
||||
// Remove deprecated shaders.
|
||||
if (s_DeprecatedShaders != null)
|
||||
foreach (var (guid, fileName) in s_DeprecatedShaders)
|
||||
{
|
||||
foreach (var (guid, fileName) in s_DeprecatedShaders)
|
||||
var path = AssetDatabase.GUIDToAssetPath(guid);
|
||||
if (!string.IsNullOrEmpty(path) && Path.GetFileName(path) == fileName)
|
||||
{
|
||||
var path = AssetDatabase.GUIDToAssetPath(guid);
|
||||
if (!string.IsNullOrEmpty(path) && Path.GetFileName(path) == fileName)
|
||||
{
|
||||
AssetDatabase.DeleteAsset(path);
|
||||
}
|
||||
AssetDatabase.DeleteAsset(path);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -90,7 +90,7 @@ namespace Coffee.UIEffectInternal
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
var s = m_RegisteredShaders[i];
|
||||
if (s != null)
|
||||
if (s)
|
||||
{
|
||||
_shaderByName[s.name] = s;
|
||||
}
|
||||
@@ -105,7 +105,7 @@ namespace Coffee.UIEffectInternal
|
||||
/// </summary>
|
||||
public Shader FindShaderByName(string name)
|
||||
{
|
||||
if (_shaderByName != null && _shaderByName.TryGetValue(name, out var shader) && shader != null)
|
||||
if (_shaderByName != null && _shaderByName.TryGetValue(name, out var shader) && shader)
|
||||
{
|
||||
return shader;
|
||||
}
|
||||
@@ -118,7 +118,7 @@ namespace Coffee.UIEffectInternal
|
||||
string format,
|
||||
string defaultOptionalShaderName)
|
||||
{
|
||||
if (shader == null) return null;
|
||||
if (!shader) return null;
|
||||
|
||||
// Already cached.
|
||||
var id = shader.GetHashCode();
|
||||
@@ -143,7 +143,7 @@ namespace Coffee.UIEffectInternal
|
||||
var pair = m_OptionalShaders[i];
|
||||
if (pair.key != shaderName) continue;
|
||||
optionalShader = FindShaderByName(pair.value);
|
||||
if (optionalShader == null) continue;
|
||||
if (!optionalShader) continue;
|
||||
_cachedOptionalShaders[id] = pair.value;
|
||||
return optionalShader;
|
||||
}
|
||||
@@ -151,7 +151,7 @@ namespace Coffee.UIEffectInternal
|
||||
// Find optional shader by format.
|
||||
optionalShaderName = string.Format(format, shaderName);
|
||||
optionalShader = FindShaderByName(optionalShaderName);
|
||||
if (optionalShader != null)
|
||||
if (optionalShader)
|
||||
{
|
||||
_cachedOptionalShaders[id] = optionalShaderName;
|
||||
return optionalShader;
|
||||
@@ -188,7 +188,6 @@ namespace Coffee.UIEffectInternal
|
||||
/// </summary>
|
||||
public void RegisterOptionalShaders(Object owner)
|
||||
{
|
||||
if (owner == null) return;
|
||||
var shaderPaths = ShaderUtil.GetAllShaderInfo()
|
||||
.Select(s => AssetDatabase.GetAssetPath(Shader.Find(s.name)))
|
||||
.Where(path => !string.IsNullOrEmpty(path) && path.EndsWith(".shader"))
|
||||
@@ -205,7 +204,6 @@ namespace Coffee.UIEffectInternal
|
||||
/// </summary>
|
||||
private void RegisterOptionalShaders(Object owner, string path)
|
||||
{
|
||||
if (owner == null) return;
|
||||
if (!File.Exists(path) || !path.EndsWith(".shader")) return;
|
||||
|
||||
var packageName = PackageInfo.FindForAssembly(typeof(ShaderVariantRegistry).Assembly)?.name;
|
||||
@@ -224,7 +222,7 @@ namespace Coffee.UIEffectInternal
|
||||
{
|
||||
// Find shader.
|
||||
var shader = AssetDatabase.LoadAssetAtPath<Shader>(path);
|
||||
if (shader == null) return;
|
||||
if (!shader) return;
|
||||
|
||||
var shaderName = shader.name;
|
||||
foreach (var key in keys)
|
||||
@@ -238,15 +236,14 @@ namespace Coffee.UIEffectInternal
|
||||
|
||||
public void InitializeIfNeeded(Object owner)
|
||||
{
|
||||
if (owner == null) return;
|
||||
Profiler.BeginSample("(EDITOR/COF)[ShaderVariantRegistry] InitializeIfNeeded");
|
||||
|
||||
if (m_Asset == null && AssetDatabase.IsMainAsset(owner))
|
||||
if (!m_Asset && AssetDatabase.IsMainAsset(owner))
|
||||
{
|
||||
// Find ShaderVariantCollection in owner.
|
||||
var path = AssetDatabase.GetAssetPath(owner);
|
||||
var collection = AssetDatabase.LoadAssetAtPath<ShaderVariantCollection>(path);
|
||||
if (collection != null)
|
||||
if (collection)
|
||||
{
|
||||
m_Asset = collection;
|
||||
}
|
||||
@@ -275,35 +272,26 @@ namespace Coffee.UIEffectInternal
|
||||
/// </summary>
|
||||
private void SyncRegisteredShaders(Object owner)
|
||||
{
|
||||
if (owner == null) return;
|
||||
if (m_Asset == null) return;
|
||||
var so = new SerializedObject(m_Asset);
|
||||
var shaders = so.FindProperty("m_Shaders");
|
||||
|
||||
// Get all shaders in the SVC, ignoring nulls and duplicates.
|
||||
var shadersInSVC = Enumerable.Range(0, shaders.arraySize)
|
||||
.Select(i =>
|
||||
shaders.GetArrayElementAtIndex(i).FindPropertyRelative("first").objectReferenceValue as Shader)
|
||||
.Where(s => s != null)
|
||||
.Distinct()
|
||||
.ToList();
|
||||
|
||||
// ShaderVariantCollection entry order is not stable between editor sessions.
|
||||
// The registry is a lookup set, so an order-only difference is already in sync.
|
||||
if (m_RegisteredShaders.Count == shadersInSVC.Count &&
|
||||
new HashSet<Shader>(m_RegisteredShaders).SetEquals(shadersInSVC))
|
||||
m_RegisteredShaders.Clear();
|
||||
for (var i = 0; i < shaders.arraySize; i++)
|
||||
{
|
||||
return;
|
||||
var shaderRef = shaders.GetArrayElementAtIndex(i)
|
||||
.FindPropertyRelative("first")
|
||||
.objectReferenceValue as Shader;
|
||||
if (shaderRef && !m_RegisteredShaders.Contains(shaderRef))
|
||||
{
|
||||
m_RegisteredShaders.Add(shaderRef);
|
||||
}
|
||||
}
|
||||
|
||||
m_RegisteredShaders.Clear();
|
||||
m_RegisteredShaders.AddRange(shadersInSVC);
|
||||
EditorUtility.SetDirty(owner);
|
||||
}
|
||||
|
||||
internal void RegisterVariant(Material material, string path)
|
||||
{
|
||||
if (material == null || material.shader == null || m_Asset == null) return;
|
||||
if (!material || !material.shader || !m_Asset) return;
|
||||
|
||||
Profiler.BeginSample("(EDITOR/COF)[ShaderVariantRegistry] RegisterVariant");
|
||||
var (variant, pair) = GetVariant(material);
|
||||
@@ -406,30 +394,7 @@ namespace Coffee.UIEffectInternal
|
||||
private bool _expandOptionalShaders;
|
||||
private bool _expandUnregisteredVariants;
|
||||
|
||||
public static ShaderVariantRegistryEditor CreateWithoutOption(SerializedObject so)
|
||||
{
|
||||
var property = so.FindProperty("m_ShaderVariantRegistry");
|
||||
return new ShaderVariantRegistryEditor(property, null, null);
|
||||
}
|
||||
|
||||
public static ShaderVariantRegistryEditor CreateWithoutOption(SerializedProperty property)
|
||||
{
|
||||
return new ShaderVariantRegistryEditor(property, null, null);
|
||||
}
|
||||
|
||||
public static ShaderVariantRegistryEditor Create(SerializedObject so, string optionName, Action onFindOptions)
|
||||
{
|
||||
var property = so.FindProperty("m_ShaderVariantRegistry");
|
||||
return new ShaderVariantRegistryEditor(property, optionName, onFindOptions);
|
||||
}
|
||||
|
||||
public static ShaderVariantRegistryEditor Create(SerializedProperty property, string optionName,
|
||||
Action onFindOptions)
|
||||
{
|
||||
return new ShaderVariantRegistryEditor(property, optionName, onFindOptions);
|
||||
}
|
||||
|
||||
private ShaderVariantRegistryEditor(SerializedProperty property, string optionName, Action onFindOptions)
|
||||
public ShaderVariantRegistryEditor(SerializedProperty property, string optionName, Action onFindOptions)
|
||||
{
|
||||
var so = property.serializedObject;
|
||||
var optionalShaders = property.FindPropertyRelative("m_OptionalShaders");
|
||||
@@ -437,54 +402,6 @@ namespace Coffee.UIEffectInternal
|
||||
_errorOnUnregisteredVariant = property.FindPropertyRelative("m_ErrorOnUnregisteredVariant");
|
||||
_asset = property.FindPropertyRelative("m_Asset");
|
||||
|
||||
_rlUnregisteredVariants = new ReorderableList(so, unregisteredVariants, false, true, false, true);
|
||||
_rlUnregisteredVariants.drawHeaderCallback = rect =>
|
||||
{
|
||||
var rWarning = new Rect(rect.x, rect.y, 20, rect.height);
|
||||
var icon = EditorGUIUtility.TrIconContent("warning",
|
||||
"These variants are not registered.\nRegister them to use in player.");
|
||||
EditorGUI.LabelField(rWarning, icon);
|
||||
|
||||
var rLabel = new Rect(rect.x + 20, rect.y, 200, rect.height);
|
||||
EditorGUI.LabelField(rLabel, "Unregistered Shader Variants");
|
||||
|
||||
var rButton = new Rect(rect.x + rect.width - 60, rect.y, 60, rect.height - 4);
|
||||
if (GUI.Button(rButton, "Clear All", EditorStyles.miniButton))
|
||||
{
|
||||
unregisteredVariants.ClearArray();
|
||||
}
|
||||
};
|
||||
_rlUnregisteredVariants.elementHeight = EditorGUIUtility.singleLineHeight * 2 + 4;
|
||||
_rlUnregisteredVariants.drawElementCallback = (r, index, isActive, isFocused) =>
|
||||
{
|
||||
if (unregisteredVariants.arraySize <= index) return;
|
||||
|
||||
var element = unregisteredVariants.GetArrayElementAtIndex(index);
|
||||
if (element == null) return;
|
||||
|
||||
var key = element.FindPropertyRelative("key");
|
||||
var value = element.FindPropertyRelative("value");
|
||||
|
||||
var h = EditorGUIUtility.singleLineHeight;
|
||||
var rKey = new Rect(r.x, r.y + 2, r.width, h);
|
||||
EditorGUI.LabelField(rKey, key.stringValue, EditorStyles.popup);
|
||||
|
||||
var rValue = new Rect(r.x + 20, r.y + h + 5, r.width - 40, 14);
|
||||
var keywords = string.IsNullOrEmpty(value.stringValue) ? "<no keywords>" : value.stringValue;
|
||||
EditorGUI.TextField(rValue, GUIContent.none, keywords, "LODRenderersText");
|
||||
|
||||
var rButton = new Rect(r.x + r.width - 20, r.y + h + 4, 20, h);
|
||||
if (GUI.Button(rButton, EditorGUIUtility.IconContent("icons/toolbar plus.png"), "iconbutton"))
|
||||
{
|
||||
var collection = _asset.objectReferenceValue as ShaderVariantCollection;
|
||||
AddVariant(collection, key.stringValue, value.stringValue);
|
||||
unregisteredVariants.DeleteArrayElementAtIndex(index);
|
||||
}
|
||||
};
|
||||
|
||||
// Optional shaders.
|
||||
if (string.IsNullOrEmpty(optionName)) return;
|
||||
|
||||
_rlOptionalShaders = new ReorderableList(so, optionalShaders, true, true, true, true);
|
||||
_rlOptionalShaders.drawHeaderCallback = rect =>
|
||||
{
|
||||
@@ -531,15 +448,56 @@ namespace Coffee.UIEffectInternal
|
||||
ShowShaderDropdown(value);
|
||||
}
|
||||
};
|
||||
|
||||
_rlUnregisteredVariants = new ReorderableList(so, unregisteredVariants, false, true, false, true);
|
||||
_rlUnregisteredVariants.drawHeaderCallback = rect =>
|
||||
{
|
||||
var rWarning = new Rect(rect.x, rect.y, 20, rect.height);
|
||||
var icon = EditorGUIUtility.TrIconContent("warning",
|
||||
"These variants are not registered.\nRegister them to use in player.");
|
||||
EditorGUI.LabelField(rWarning, icon);
|
||||
|
||||
var rLabel = new Rect(rect.x + 20, rect.y, 200, rect.height);
|
||||
EditorGUI.LabelField(rLabel, "Unregistered Shader Variants");
|
||||
|
||||
var rButton = new Rect(rect.x + rect.width - 60, rect.y, 60, rect.height - 4);
|
||||
if (GUI.Button(rButton, "Clear All", EditorStyles.miniButton))
|
||||
{
|
||||
unregisteredVariants.ClearArray();
|
||||
}
|
||||
};
|
||||
_rlUnregisteredVariants.elementHeight = EditorGUIUtility.singleLineHeight * 2 + 4;
|
||||
_rlUnregisteredVariants.drawElementCallback = (r, index, isActive, isFocused) =>
|
||||
{
|
||||
if (unregisteredVariants.arraySize <= index) return;
|
||||
|
||||
var element = unregisteredVariants.GetArrayElementAtIndex(index);
|
||||
if (element == null) return;
|
||||
|
||||
var key = element.FindPropertyRelative("key");
|
||||
var value = element.FindPropertyRelative("value");
|
||||
|
||||
var h = EditorGUIUtility.singleLineHeight;
|
||||
var rKey = new Rect(r.x, r.y + 2, r.width, h);
|
||||
EditorGUI.LabelField(rKey, key.stringValue, EditorStyles.popup);
|
||||
|
||||
var rValue = new Rect(r.x + 20, r.y + h + 5, r.width - 40, 14);
|
||||
var keywords = string.IsNullOrEmpty(value.stringValue) ? "<no keywords>" : value.stringValue;
|
||||
EditorGUI.TextField(rValue, GUIContent.none, keywords, "LODRenderersText");
|
||||
|
||||
var rButton = new Rect(r.x + r.width - 20, r.y + h + 4, 20, h);
|
||||
if (GUI.Button(rButton, EditorGUIUtility.IconContent("icons/toolbar plus.png"), "iconbutton"))
|
||||
{
|
||||
var collection = _asset.objectReferenceValue as ShaderVariantCollection;
|
||||
AddVariant(collection, key.stringValue, value.stringValue);
|
||||
unregisteredVariants.DeleteArrayElementAtIndex(index);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
public void Draw()
|
||||
{
|
||||
if (_rlOptionalShaders != null)
|
||||
{
|
||||
DrawOptionalShaders(ref _expandOptionalShaders, _rlOptionalShaders);
|
||||
}
|
||||
|
||||
DrawOptionalShaders(ref _expandOptionalShaders, _rlOptionalShaders);
|
||||
DrawRegisteredShaderVariants(ref _expandUnregisteredVariants, _asset, ref _editor);
|
||||
if (0 < _rlUnregisteredVariants.serializedProperty.arraySize)
|
||||
{
|
||||
@@ -556,7 +514,7 @@ namespace Coffee.UIEffectInternal
|
||||
if (collection == null) return;
|
||||
|
||||
var shader = Shader.Find(shaderName);
|
||||
if (shader == null) return;
|
||||
if (!shader) return;
|
||||
|
||||
collection.Add(new ShaderVariantCollection.ShaderVariant
|
||||
{
|
||||
|
||||
@@ -47,12 +47,12 @@ namespace Coffee.UIEffectInternal
|
||||
private static bool HasChanged_Internal(this Transform self, Transform baseTransform, ref Matrix4x4 prev,
|
||||
float epsilon)
|
||||
{
|
||||
if (self == null) return false;
|
||||
if (!self) return false;
|
||||
|
||||
var hash = baseTransform != null ? baseTransform.GetHashCode() : 0;
|
||||
var hash = baseTransform ? baseTransform.GetHashCode() : 0;
|
||||
if (FrameCache.TryGet(self, nameof(HasChanged), hash, out bool result)) return result;
|
||||
|
||||
var matrix = baseTransform != null
|
||||
var matrix = baseTransform
|
||||
? baseTransform.worldToLocalMatrix * self.localToWorldMatrix
|
||||
: self.localToWorldMatrix;
|
||||
var current = matrix * Matrix4x4.Scale(Vector3.one * 10000);
|
||||
|
||||
@@ -18,6 +18,12 @@ namespace Coffee.UIEffectInternal
|
||||
private static readonly FastAction s_OnScreenSizeChangedAction = new FastAction();
|
||||
private static Vector2Int s_LastScreenSize;
|
||||
|
||||
static UIExtraCallbacks()
|
||||
{
|
||||
Canvas.willRenderCanvases += OnBeforeCanvasRebuild;
|
||||
Logger.LogMulticast(typeof(Canvas), "willRenderCanvases", message: "ctor");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Event that occurs after canvas rebuilds.
|
||||
/// </summary>
|
||||
@@ -66,7 +72,7 @@ namespace Coffee.UIEffectInternal
|
||||
CanvasUpdateRegistry.IsRebuildingLayout();
|
||||
#if TMP_ENABLE
|
||||
// Explicitly set `Canvas.willRenderCanvases += TMP_UpdateManager.DoRebuilds`.
|
||||
var _ = typeof(TMPro.TMP_UpdateManager)
|
||||
typeof(TMPro.TMP_UpdateManager)
|
||||
.GetProperty("instance", BindingFlags.NonPublic | BindingFlags.Static)
|
||||
.GetValue(null);
|
||||
#endif
|
||||
@@ -76,27 +82,14 @@ namespace Coffee.UIEffectInternal
|
||||
message: "InitializeAfterCanvasRebuild");
|
||||
}
|
||||
|
||||
#if UNITY_EDITOR && UNITY_2019_3_OR_NEWER
|
||||
#if UNITY_EDITOR
|
||||
[InitializeOnLoadMethod]
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
|
||||
#elif UNITY_EDITOR
|
||||
[InitializeOnLoadMethod]
|
||||
#else
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
|
||||
#endif
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.BeforeSceneLoad)]
|
||||
private static void InitializeOnLoad()
|
||||
{
|
||||
#if UNITY_2019_4 || UNITY_2020_2_OR_NEWER
|
||||
Canvas.preWillRenderCanvases -= OnBeforeCanvasRebuild;
|
||||
Canvas.preWillRenderCanvases += OnBeforeCanvasRebuild;
|
||||
#else
|
||||
Canvas.willRenderCanvases -= OnBeforeCanvasRebuild;
|
||||
Canvas.willRenderCanvases += OnBeforeCanvasRebuild;
|
||||
#endif
|
||||
Canvas.willRenderCanvases -= OnAfterCanvasRebuild;
|
||||
s_IsInitializedAfterCanvasRebuild = false;
|
||||
s_LastScreenSize = default;
|
||||
Logger.LogMulticast(typeof(Canvas), "willRenderCanvases", message: "ctor");
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
||||
@@ -62,7 +62,7 @@ namespace Coffee.UIEffects.Timeline
|
||||
public override void GatherProperties(PlayableDirector director, IPropertyCollector driver)
|
||||
{
|
||||
var trackBinding = director.GetGenericBinding(this) as UIEffect;
|
||||
if (trackBinding == null) return;
|
||||
if (!trackBinding) return;
|
||||
|
||||
driver.AddFromName<UIEffect>(trackBinding.gameObject, fieldName);
|
||||
base.GatherProperties(director, driver);
|
||||
@@ -113,7 +113,7 @@ namespace Coffee.UIEffects.Timeline
|
||||
public override void ProcessFrame(Playable playable, FrameData info, object playerData)
|
||||
{
|
||||
InitializeIfNeeded(playerData as UIEffect);
|
||||
if (effect == null) return;
|
||||
if (!effect) return;
|
||||
|
||||
var inputCount = playable.GetInputCount();
|
||||
var value = default(T);
|
||||
@@ -137,7 +137,7 @@ namespace Coffee.UIEffects.Timeline
|
||||
|
||||
public override void OnPlayableDestroy(Playable playable)
|
||||
{
|
||||
if (effect != null)
|
||||
if (effect)
|
||||
{
|
||||
currentValue = _defaultValue;
|
||||
}
|
||||
@@ -159,13 +159,13 @@ namespace Coffee.UIEffects.Timeline
|
||||
{
|
||||
if (effect == newEffect) return;
|
||||
|
||||
if (effect != null)
|
||||
if (effect)
|
||||
{
|
||||
currentValue = _defaultValue;
|
||||
}
|
||||
|
||||
effect = newEffect;
|
||||
_defaultValue = newEffect != null ? currentValue : default;
|
||||
_defaultValue = newEffect ? currentValue : default;
|
||||
}
|
||||
|
||||
protected abstract T Add(T current, T value, float weight);
|
||||
|
||||
@@ -843,7 +843,7 @@ namespace Coffee.UIEffects
|
||||
if (m_ShadowMode == value) return;
|
||||
context.m_ShadowMode = m_ShadowMode = value;
|
||||
SetVerticesDirty();
|
||||
SetMaterialDirty();
|
||||
SetVerticesDirty();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1451,7 +1451,7 @@ namespace Coffee.UIEffects
|
||||
}
|
||||
}
|
||||
|
||||
public override RectTransform transitionRoot => m_CustomRoot != null
|
||||
public override RectTransform transitionRoot => m_CustomRoot
|
||||
? m_CustomRoot
|
||||
: transform as RectTransform;
|
||||
|
||||
@@ -1473,7 +1473,6 @@ namespace Coffee.UIEffects
|
||||
|
||||
protected override void OnDestroy()
|
||||
{
|
||||
base.OnDestroy();
|
||||
InternalListPool<UIEffectReplica>.Return(ref _replicas);
|
||||
}
|
||||
|
||||
@@ -1490,12 +1489,12 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
var selected = 0 < selection.Length
|
||||
&& (selection.Contains(gameObject)
|
||||
|| replicas.Any(x => x != null && selection.Contains(x.gameObject)));
|
||||
|| replicas.Any(x => x && selection.Contains(x.gameObject)));
|
||||
|
||||
context.SetEnablePreview(selected, effectMaterial);
|
||||
foreach (var r in replicas)
|
||||
{
|
||||
if (r == null || !r.isActiveAndEnabled || r.context == null) continue;
|
||||
if (!r || !r.isActiveAndEnabled || r.context == null) continue;
|
||||
r.context.SetEnablePreview(selected, r.effectMaterial);
|
||||
}
|
||||
}
|
||||
@@ -1507,7 +1506,7 @@ namespace Coffee.UIEffects
|
||||
var count = replicas.Count;
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
if (replicas[i] == null) continue;
|
||||
if (!replicas[i]) continue;
|
||||
replicas[i].SetVerticesDirty();
|
||||
}
|
||||
}
|
||||
@@ -1518,7 +1517,7 @@ namespace Coffee.UIEffects
|
||||
var count = replicas.Count;
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
if (replicas[i] == null) continue;
|
||||
if (!replicas[i]) continue;
|
||||
replicas[i].SetMaterialDirty();
|
||||
}
|
||||
}
|
||||
@@ -1529,7 +1528,7 @@ namespace Coffee.UIEffects
|
||||
var count = replicas.Count;
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
if (replicas[i] == null) continue;
|
||||
if (!replicas[i]) continue;
|
||||
replicas[i].SetMaterialContextDirty();
|
||||
}
|
||||
}
|
||||
@@ -1606,7 +1605,7 @@ namespace Coffee.UIEffects
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
if (!replicas[i]) continue;
|
||||
replicas[i].ApplyContextToMaterial(replicas[i].effectMaterial);
|
||||
replicas[i].ApplyContextToMaterial(material);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1717,7 +1716,7 @@ namespace Coffee.UIEffects
|
||||
/// </summary>
|
||||
public void LoadPreset(UIEffect src, bool append)
|
||||
{
|
||||
if (src == null) return;
|
||||
if (!src) return;
|
||||
|
||||
var dst = this;
|
||||
if (!append || src.m_ToneFilter != ToneFilter.None)
|
||||
@@ -1849,7 +1848,7 @@ namespace Coffee.UIEffects
|
||||
/// </summary>
|
||||
public void LoadPreset(UIEffectPreset src, bool append)
|
||||
{
|
||||
if (src == null) return;
|
||||
if (!src) return;
|
||||
|
||||
var dst = this;
|
||||
if (!append || src.m_ToneFilter != ToneFilter.None)
|
||||
@@ -1978,7 +1977,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
public void SavePreset(UIEffectPreset dst, bool append)
|
||||
{
|
||||
if (dst == null) return;
|
||||
if (!dst) return;
|
||||
|
||||
var src = this;
|
||||
if (!append || src.m_ToneFilter != ToneFilter.None)
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace Coffee.UIEffects
|
||||
private bool _isContextDirty;
|
||||
|
||||
public Material effectMaterial => _material;
|
||||
public Graphic graphic => _graphic != null ? _graphic : _graphic = GetComponent<Graphic>();
|
||||
public Graphic graphic => _graphic ? _graphic : _graphic = GetComponent<Graphic>();
|
||||
public virtual uint effectId => (uint)GetHashCode();
|
||||
public virtual float actualSamplingScale => 1;
|
||||
public virtual bool canModifyShape => true;
|
||||
@@ -50,7 +50,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
_canvasCached = true;
|
||||
_canvas = GetComponentInParent<Canvas>();
|
||||
if (_canvas == null || !_canvas.isActiveAndEnabled)
|
||||
if (!_canvas || !_canvas.isActiveAndEnabled)
|
||||
{
|
||||
_canvas = null;
|
||||
_canvasCached = false;
|
||||
@@ -79,10 +79,10 @@ namespace Coffee.UIEffects
|
||||
if (!isActiveAndEnabled) return null;
|
||||
|
||||
var g = graphic;
|
||||
if (g == null) return null;
|
||||
if (!g) return null;
|
||||
|
||||
var canvasRenderer = g.canvasRenderer;
|
||||
if (canvasRenderer == null || canvasRenderer.materialCount == 0) return null;
|
||||
if (!canvasRenderer || canvasRenderer.materialCount == 0) return null;
|
||||
|
||||
return canvasRenderer.GetMaterial();
|
||||
}
|
||||
@@ -137,7 +137,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
private void OnAfterCanvasRebuild()
|
||||
{
|
||||
if (_material == null || graphic == null || canvas == null || context == null) return;
|
||||
if (!_material || !graphic || !canvas || context == null) return;
|
||||
|
||||
if (_isContextDirty)
|
||||
{
|
||||
@@ -173,7 +173,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
private bool CanModifyMesh()
|
||||
{
|
||||
if (graphic == null || !graphic.isActiveAndEnabled) return false;
|
||||
if (!graphic || !graphic.isActiveAndEnabled) return false;
|
||||
if (!isActiveAndEnabled) return false;
|
||||
|
||||
// The transitionRoot is same as the transform => true.
|
||||
@@ -196,7 +196,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
Profiler.BeginSample("(UIE)[UIEffect] GetModifiedMaterial");
|
||||
var samplingScaleId = (uint)(Mathf.InverseLerp(0.01f, 100, actualSamplingScale) * uint.MaxValue);
|
||||
var rootId = (uint)(transitionRoot != null ? transitionRoot.GetHashCode() : 0);
|
||||
var rootId = (uint)(transitionRoot ? transitionRoot.GetHashCode() : 0);
|
||||
var hash = new Hash128((uint)baseMaterial.GetHashCode(), effectId, samplingScaleId, rootId);
|
||||
if (!MaterialRepository.Valid(hash, _material))
|
||||
{
|
||||
@@ -251,7 +251,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
public virtual void SetVerticesDirty()
|
||||
{
|
||||
if (graphic != null)
|
||||
if (graphic)
|
||||
{
|
||||
graphic.SetVerticesDirty();
|
||||
GraphicProxy.Find(graphic).SetVerticesDirty(graphic, enabled);
|
||||
@@ -261,7 +261,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
public virtual void SetMaterialDirty()
|
||||
{
|
||||
if (graphic != null)
|
||||
if (graphic)
|
||||
{
|
||||
graphic.SetMaterialDirty();
|
||||
SetMaterialContextDirty();
|
||||
@@ -283,7 +283,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
public virtual void ApplyContextToMaterial(Material material)
|
||||
{
|
||||
if (!isActiveAndEnabled || context == null || material == null) return;
|
||||
if (!isActiveAndEnabled || context == null || !material) return;
|
||||
|
||||
_isContextDirty = false;
|
||||
context.ApplyToMaterial(material, actualSamplingScale);
|
||||
@@ -310,7 +310,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
public void OnControlTimeStart()
|
||||
{
|
||||
if (this != null)
|
||||
if (this)
|
||||
{
|
||||
enabled = true;
|
||||
}
|
||||
@@ -318,7 +318,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
public void OnControlTimeStop()
|
||||
{
|
||||
if (this != null)
|
||||
if (this)
|
||||
{
|
||||
enabled = false;
|
||||
}
|
||||
|
||||
@@ -290,7 +290,7 @@ namespace Coffee.UIEffects
|
||||
get
|
||||
{
|
||||
if (m_GradationGradient == null) return null;
|
||||
if (_gradationRampTex == null) _gradationRampTex = s_TexturePool.Rent();
|
||||
if (!_gradationRampTex) _gradationRampTex = s_TexturePool.Rent();
|
||||
if (!_isGradientDirty) return _gradationRampTex;
|
||||
_isGradientDirty = false;
|
||||
|
||||
@@ -317,7 +317,7 @@ namespace Coffee.UIEffects
|
||||
get
|
||||
{
|
||||
if (m_TransitionGradient == null) return null;
|
||||
if (_transitionRampTex == null) _transitionRampTex = s_TexturePool.Rent();
|
||||
if (!_transitionRampTex) _transitionRampTex = s_TexturePool.Rent();
|
||||
if (!_isTransitionGradientDirty) return _transitionRampTex;
|
||||
_isTransitionGradientDirty = false;
|
||||
|
||||
@@ -449,7 +449,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
public void ApplyToMaterial(Material material, float actualSamplingScale = 1f)
|
||||
{
|
||||
if (material == null) return;
|
||||
if (!material) return;
|
||||
|
||||
Profiler.BeginSample("(UIE)[UIEffect] ApplyToMaterial");
|
||||
|
||||
@@ -527,9 +527,7 @@ namespace Coffee.UIEffects
|
||||
#pragma warning disable CS0612 // Type or member is obsolete
|
||||
|| m_GradationMode == GradationMode.RadialDetail
|
||||
#pragma warning restore CS0612
|
||||
|| m_GradationMode == GradationMode.RadialGradient
|
||||
? 1
|
||||
: 0);
|
||||
|| m_GradationMode == GradationMode.RadialGradient ? 1 : 0);
|
||||
|
||||
material.SetFloat(s_DetailIntensity, Mathf.Clamp01(m_DetailIntensity));
|
||||
material.SetColor(s_DetailColor, ApplyColorSpace(m_DetailColor));
|
||||
@@ -580,7 +578,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
public void SetEnablePreview(bool enable, Material material)
|
||||
{
|
||||
if (material == null) return;
|
||||
if (!material) return;
|
||||
material.SetVector(s_TransitionTex_Speed, enable ? (Vector4)m_TransitionTexSpeed : Vector4.zero);
|
||||
material.SetVector(s_DetailTex_Speed, enable ? (Vector4)m_DetailTexSpeed : Vector4.zero);
|
||||
material.SetFloat(s_TransitionAutoPlaySpeed, enable ? m_TransitionAutoPlaySpeed : 0);
|
||||
@@ -589,7 +587,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
public void UpdateViewMatrix(Material material, RectTransform transitionRoot, Canvas canvas)
|
||||
{
|
||||
if (material == null) return;
|
||||
if (!material) return;
|
||||
|
||||
var size = transitionRoot.rect.size;
|
||||
var scale = new Vector3(1f / size.x, 1f / size.y, 1f);
|
||||
@@ -849,7 +847,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
private static Color ApplyColorSpace(Color color)
|
||||
{
|
||||
return QualitySettings.activeColorSpace == ColorSpace.Linear ? color : color.gamma;
|
||||
return QualitySettings.activeColorSpace == ColorSpace.Linear ? color.linear : color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,24 +8,11 @@ namespace Coffee.UIEffects
|
||||
[ExecuteAlways]
|
||||
public class UIEffectPreset : ScriptableObject
|
||||
{
|
||||
private static UIEffectPreset s_DefaultPreset;
|
||||
|
||||
#if UNITY_EDITOR && UNITY_2019_3_OR_NEWER
|
||||
[RuntimeInitializeOnLoadMethod(RuntimeInitializeLoadType.SubsystemRegistration)]
|
||||
private static void OnDomainReload()
|
||||
{
|
||||
if (s_DefaultPreset != null)
|
||||
{
|
||||
Misc.DestroyImmediate(s_DefaultPreset);
|
||||
}
|
||||
|
||||
s_DefaultPreset = null;
|
||||
}
|
||||
#endif
|
||||
internal static UIEffectPreset s_DefaultPreset;
|
||||
|
||||
internal static UIEffectPreset GetDefaultPreset()
|
||||
{
|
||||
if (s_DefaultPreset == null)
|
||||
if (!s_DefaultPreset)
|
||||
{
|
||||
s_DefaultPreset = CreateInstance<UIEffectPreset>();
|
||||
s_DefaultPreset.hideFlags = HideFlags.HideAndDontSave;
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace Coffee.UIEffects
|
||||
public static void RegisterRuntimePreset(UIEffectPreset preset)
|
||||
{
|
||||
// Already registered.
|
||||
if (preset == null || instance.m_RuntimePresetsV2.Contains(preset)) return;
|
||||
if (!preset || instance.m_RuntimePresetsV2.Contains(preset)) return;
|
||||
|
||||
instance.m_RuntimePresetsV2.Add(preset);
|
||||
#if UNITY_EDITOR
|
||||
@@ -59,7 +59,7 @@ namespace Coffee.UIEffects
|
||||
for (var i = 0; i < instance.m_RuntimePresets.Count; i++)
|
||||
{
|
||||
var preset = instance.m_RuntimePresets[i];
|
||||
if (preset != null && preset.name == presetName)
|
||||
if (preset && preset.name == presetName)
|
||||
{
|
||||
return preset;
|
||||
}
|
||||
@@ -73,7 +73,7 @@ namespace Coffee.UIEffects
|
||||
for (var i = 0; i < instance.m_RuntimePresetsV2.Count; i++)
|
||||
{
|
||||
var preset = instance.m_RuntimePresetsV2[i];
|
||||
if (preset != null && preset.name == presetName)
|
||||
if (preset && preset.name == presetName)
|
||||
{
|
||||
return preset;
|
||||
}
|
||||
@@ -101,10 +101,10 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
#if !LEGACY_TMP_ENABLE
|
||||
const string tmpSupport = "TextMeshPro Support (Unity 6)";
|
||||
const string version = "v5.11.0 (Unity 6)";
|
||||
const string version = "v5.9.0 (Unity 6)";
|
||||
#else
|
||||
const string tmpSupport = "TextMeshPro Support";
|
||||
const string version = "v5.11.0";
|
||||
const string version = "v5.9.0";
|
||||
#endif
|
||||
ShaderSampleImporter.RegisterShaderSamples(new[]
|
||||
{
|
||||
@@ -119,8 +119,11 @@ namespace Coffee.UIEffects
|
||||
("Hidden/TextMeshPro/Mobile/Distance Field (UIEffect)", tmpSupport, version),
|
||||
|
||||
// ShaderGraph Support
|
||||
("Shader Graphs/UISample (UIEffect)", "ShaderGraph Support (Unity 6 BuiltIn)", "v5.11.0"),
|
||||
("Shader Graphs/UISampleURP (UIEffect)", "ShaderGraph Support (Unity 6 URP)", "v5.11.0")
|
||||
("Shader Graphs/UISample (UIEffect)", "ShaderGraph Support (Unity 6 BuiltIn)", "v5.9.0"),
|
||||
("Shader Graphs/UISampleURP (UIEffect)", "ShaderGraph Support (Unity 6 URP)", "v5.9.0"),
|
||||
|
||||
// UniText Support
|
||||
("Hidden/UniText/Mobile/SDF (UIEffect)", "UniText Support", "v5.9.0")
|
||||
});
|
||||
ShaderSampleImporter.RegisterShaderAliases(new[]
|
||||
{
|
||||
|
||||
@@ -99,9 +99,9 @@ namespace Coffee.UIEffects
|
||||
|
||||
public override bool canModifyShape => m_AllowToModifyMeshShape;
|
||||
|
||||
public override uint effectId => target != null
|
||||
public override uint effectId => target
|
||||
? target.effectId
|
||||
: preset != null
|
||||
: preset
|
||||
? (uint)preset.GetHashCode()
|
||||
: (uint)GetHashCode();
|
||||
|
||||
@@ -111,10 +111,10 @@ namespace Coffee.UIEffects
|
||||
get
|
||||
{
|
||||
// Following the preset/preset-target.
|
||||
if (preset != null || (target != null && !isTargetInScene)) return base.context;
|
||||
if (preset || (target && !isTargetInScene)) return base.context;
|
||||
|
||||
// Following the instantiated target.
|
||||
return target != null && target.isActiveAndEnabled && isTargetInScene
|
||||
return target && target.isActiveAndEnabled && isTargetInScene
|
||||
? target.context
|
||||
: null;
|
||||
}
|
||||
@@ -126,7 +126,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
if (useTargetTransform)
|
||||
{
|
||||
if (preset != null && m_CustomRoot == null && graphic != null && canvas != null)
|
||||
if (preset && !m_CustomRoot && graphic && canvas)
|
||||
{
|
||||
return canvas.transform as RectTransform;
|
||||
}
|
||||
@@ -137,15 +137,15 @@ namespace Coffee.UIEffects
|
||||
}
|
||||
}
|
||||
|
||||
return m_CustomRoot != null ? m_CustomRoot : transform as RectTransform;
|
||||
return m_CustomRoot ? m_CustomRoot : transform as RectTransform;
|
||||
}
|
||||
}
|
||||
|
||||
private bool isTargetInScene => target != null && target.gameObject.scene.IsValid();
|
||||
private bool isTargetInScene => target && target.gameObject.scene.IsValid();
|
||||
|
||||
protected override void OnEnable()
|
||||
{
|
||||
if (preset == null)
|
||||
if (!preset)
|
||||
{
|
||||
RefreshTarget(target);
|
||||
}
|
||||
@@ -170,7 +170,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
RefreshTarget(target);
|
||||
|
||||
if (preset != null || (target != null && !isTargetInScene))
|
||||
if (preset || (target && !isTargetInScene))
|
||||
{
|
||||
context?.SetGradationDirty();
|
||||
context?.SetTransitionGradationDirty();
|
||||
@@ -197,12 +197,12 @@ namespace Coffee.UIEffects
|
||||
private void RefreshTarget(UIEffect newTarget)
|
||||
{
|
||||
if (_currentTarget == newTarget) return;
|
||||
if (_currentTarget != null)
|
||||
if (_currentTarget)
|
||||
{
|
||||
_currentTarget.replicas.Remove(this);
|
||||
}
|
||||
|
||||
if (newTarget != null)
|
||||
if (newTarget)
|
||||
{
|
||||
_currentTarget = newTarget;
|
||||
if (isTargetInScene)
|
||||
@@ -219,12 +219,12 @@ namespace Coffee.UIEffects
|
||||
internal override void UpdateContext(UIEffectContext dst)
|
||||
{
|
||||
// Following the preset.
|
||||
if (preset != null)
|
||||
if (preset)
|
||||
{
|
||||
preset.UpdateContext(dst);
|
||||
}
|
||||
// Following the preset-target.
|
||||
else if (target != null && !isTargetInScene)
|
||||
else if (target && !isTargetInScene)
|
||||
{
|
||||
target.UpdateContext(dst);
|
||||
}
|
||||
@@ -232,10 +232,10 @@ namespace Coffee.UIEffects
|
||||
|
||||
public override void ApplyContextToMaterial(Material material)
|
||||
{
|
||||
if (!isActiveAndEnabled && preset == null && target == null) return;
|
||||
if (!isActiveAndEnabled && !preset && !target) return;
|
||||
|
||||
// Following the preset/preset-target.
|
||||
if (preset != null || (target != null && !isTargetInScene))
|
||||
if (preset || (target && !isTargetInScene))
|
||||
{
|
||||
base.ApplyContextToMaterial(material);
|
||||
}
|
||||
@@ -264,11 +264,11 @@ namespace Coffee.UIEffects
|
||||
|
||||
public void OnAfterDeserialize()
|
||||
{
|
||||
if (m_Preset != null)
|
||||
if (m_Preset)
|
||||
{
|
||||
m_Target = null;
|
||||
}
|
||||
else if (m_Target != null)
|
||||
else if (m_Target)
|
||||
{
|
||||
m_Preset = null;
|
||||
}
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
using Coffee.UIEffectInternal;
|
||||
using UnityEngine;
|
||||
using UnityEngine.Events;
|
||||
using UnityEngine.Serialization;
|
||||
|
||||
namespace Coffee.UIEffects
|
||||
{
|
||||
@@ -93,6 +94,7 @@ namespace Coffee.UIEffects
|
||||
[Range(0f, 10)]
|
||||
private float m_Interval;
|
||||
|
||||
[FormerlySerializedAs("m_ResetTimeOnEnable")]
|
||||
[Tooltip("Play the tween when the component is enabled.")]
|
||||
[SerializeField]
|
||||
private PlayOnEnable m_PlayOnEnable = PlayOnEnable.Forward;
|
||||
@@ -132,7 +134,7 @@ namespace Coffee.UIEffects
|
||||
/// <summary>
|
||||
/// The target UIMaterialPropertyInjector to tween.
|
||||
/// </summary>
|
||||
private UIEffectBase target => _target != null ? _target : _target = GetComponent<UIEffectBase>();
|
||||
private UIEffectBase target => _target ? _target : _target = GetComponent<UIEffectBase>();
|
||||
|
||||
/// <summary>
|
||||
/// The culling mask of the tween.
|
||||
@@ -165,7 +167,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
_rate = value;
|
||||
|
||||
if (target == null || cullingMask == 0) return;
|
||||
if (!target || cullingMask == 0) return;
|
||||
|
||||
var currentCurve = curve;
|
||||
if (separateReverseCurve)
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
public static GraphicProxy Find(Graphic graphic)
|
||||
{
|
||||
if (graphic == null) return null;
|
||||
if (!graphic) return null;
|
||||
|
||||
var count = s_Proxies.Count;
|
||||
for (var i = count - 1; i >= 0; i--)
|
||||
@@ -44,7 +44,7 @@ namespace Coffee.UIEffects
|
||||
/// </summary>
|
||||
protected virtual bool IsValid(Graphic graphic)
|
||||
{
|
||||
return graphic != null;
|
||||
return graphic;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -64,7 +64,7 @@ namespace Coffee.UIEffects
|
||||
ShadowUtil.onMarkAsShadow = s_OnMarkAsShadow;
|
||||
UIEffectContext.onModifyVertex = s_OnModifyVertex;
|
||||
|
||||
if (canvas != null)
|
||||
if (canvas)
|
||||
{
|
||||
canvas.additionalShaderChannels |= AdditionalCanvasShaderChannels.TexCoord1;
|
||||
}
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Coffee.UIEffects
|
||||
/// </summary>
|
||||
protected override bool IsValid(Graphic graphic)
|
||||
{
|
||||
if (graphic == null) return false;
|
||||
if (!graphic) return false;
|
||||
if (graphic is Image) return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -17,12 +17,12 @@ namespace Coffee.UIEffects
|
||||
/// </summary>
|
||||
protected override bool IsValid(Graphic graphic)
|
||||
{
|
||||
if (graphic == null) return false;
|
||||
if (!graphic) return false;
|
||||
if (graphic is TextMeshProUGUI) return true;
|
||||
if (graphic is TMP_SubMeshUI sub)
|
||||
{
|
||||
// If TMP_SubMeshUI is used for text
|
||||
return sub.spriteAsset == null
|
||||
return !sub.spriteAsset
|
||||
|| sub.sharedMaterial != sub.spriteAsset.material;
|
||||
}
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace Coffee.UIEffects
|
||||
ShadowUtil.onMarkAsShadow = s_OnMarkAsShadow;
|
||||
UIEffectContext.onModifyVertex = s_OnModifyVertex;
|
||||
|
||||
if (canvas != null)
|
||||
if (canvas)
|
||||
{
|
||||
canvas.additionalShaderChannels |= AdditionalCanvasShaderChannels.TexCoord2;
|
||||
}
|
||||
@@ -145,7 +145,7 @@ namespace Coffee.UIEffects
|
||||
var toRemove = InternalListPool<TextMeshProUGUI>.Rent();
|
||||
foreach (var textMeshProUGUI in s_RegisteredInstances)
|
||||
{
|
||||
if (textMeshProUGUI != null
|
||||
if (textMeshProUGUI
|
||||
&& textMeshProUGUI.isActiveAndEnabled
|
||||
&& !textMeshProUGUI.isTextObjectScaleStatic)
|
||||
{
|
||||
@@ -183,7 +183,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
foreach (var textMeshProUGUI in s_ChangedInstances)
|
||||
{
|
||||
if (textMeshProUGUI == null || !textMeshProUGUI.isActiveAndEnabled) continue;
|
||||
if (!textMeshProUGUI || !textMeshProUGUI.isActiveAndEnabled) continue;
|
||||
if (!textMeshProUGUI.TryGetComponent<IMeshModifier>(out var _)) continue;
|
||||
|
||||
s_RegisteredInstances.Add(textMeshProUGUI);
|
||||
@@ -198,7 +198,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
foreach (var textMeshProUGUI in s_RegisteredInstances)
|
||||
{
|
||||
if (textMeshProUGUI == null || !textMeshProUGUI.isActiveAndEnabled) continue;
|
||||
if (!textMeshProUGUI || !textMeshProUGUI.isActiveAndEnabled) continue;
|
||||
if (textMeshProUGUI.TryGetComponent<UIEffectBase>(out var effect) && effect.isActiveAndEnabled)
|
||||
{
|
||||
effect.ReleaseMaterial();
|
||||
@@ -213,7 +213,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
private static void ModifyMesh(TextMeshProUGUI textMeshProUGUI)
|
||||
{
|
||||
if (s_Mesh == null)
|
||||
if (!s_Mesh)
|
||||
{
|
||||
s_Mesh = new Mesh();
|
||||
s_Mesh.MarkDynamic();
|
||||
@@ -240,7 +240,7 @@ namespace Coffee.UIEffects
|
||||
else
|
||||
{
|
||||
var subMeshUI = GetSubMeshUI(subMeshes, meshInfo.material, meshInfo.mesh, i - 1);
|
||||
if (subMeshUI != null)
|
||||
if (subMeshUI)
|
||||
{
|
||||
subMeshUI.canvasRenderer.SetMesh(s_Mesh);
|
||||
}
|
||||
@@ -270,7 +270,7 @@ namespace Coffee.UIEffects
|
||||
}
|
||||
|
||||
var subMeshUI = GetSubMeshUI(subMeshes, meshInfo.material, meshInfo.mesh, i - 1);
|
||||
if (subMeshUI == null) break;
|
||||
if (!subMeshUI) break;
|
||||
|
||||
// fix: TMP Text sprite submesh lost when changing fontMaterial (#368)
|
||||
if (!subMeshUI.TryGetComponent<UIEffectReplica>(out var replica))
|
||||
@@ -278,7 +278,7 @@ namespace Coffee.UIEffects
|
||||
replica = subMeshUI.gameObject.AddComponent<UIEffectReplica>();
|
||||
textMeshProUGUI.RegisterDirtyMaterialCallback(() =>
|
||||
{
|
||||
if (subMeshUI != null) subMeshUI.SetMaterialDirty();
|
||||
if (subMeshUI) subMeshUI.SetMaterialDirty();
|
||||
});
|
||||
}
|
||||
|
||||
@@ -305,16 +305,15 @@ namespace Coffee.UIEffects
|
||||
Misc.QueuePlayerLoopUpdate();
|
||||
}
|
||||
|
||||
private static TMP_SubMeshUI GetSubMeshUI(List<TMP_SubMeshUI> subMeshes, Material material, Mesh mesh,
|
||||
int start)
|
||||
private static TMP_SubMeshUI GetSubMeshUI(List<TMP_SubMeshUI> subMeshes, Material material, Mesh mesh, int start)
|
||||
{
|
||||
var count = subMeshes.Count;
|
||||
if (mesh != null)
|
||||
if (mesh)
|
||||
{
|
||||
for (var j = 0; j < count; j++)
|
||||
{
|
||||
var s = subMeshes[(j + start + count) % count];
|
||||
if (s == null) continue;
|
||||
if (!s) continue;
|
||||
if (s.mesh == mesh) return s;
|
||||
}
|
||||
}
|
||||
@@ -322,7 +321,7 @@ namespace Coffee.UIEffects
|
||||
for (var j = 0; j < count; j++)
|
||||
{
|
||||
var s = subMeshes[(j + start + count) % count];
|
||||
if (s == null) continue;
|
||||
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:
|
||||
@@ -25,29 +25,29 @@ public class UIEffect_TweenerControler : MonoBehaviour
|
||||
|
||||
private void Update()
|
||||
{
|
||||
if (m_Info != null)
|
||||
if (m_Info)
|
||||
{
|
||||
var tw = tweener;
|
||||
m_Info.text =
|
||||
$"{tw.time:F2}/{tw.totalTime:F2} ({tw.rate:F2}), {tw.direction}, isTweening={tw.isTweening}, isDelaying={tw.isDelaying}, isPaused={tw.isPaused}";
|
||||
}
|
||||
|
||||
if (m_SeekBar != null)
|
||||
if (m_SeekBar)
|
||||
{
|
||||
m_SeekBar.value = tweener.time / tweener.totalTime;
|
||||
}
|
||||
|
||||
if (m_SeekBarBgInterval1 != null)
|
||||
if (m_SeekBarBgInterval1)
|
||||
{
|
||||
m_SeekBarBgInterval1.SetActive(UIEffectTweener.WrapMode.Loop <= tweener.wrapMode);
|
||||
}
|
||||
|
||||
if (m_SeekBarBgDuration2 != null)
|
||||
if (m_SeekBarBgDuration2)
|
||||
{
|
||||
m_SeekBarBgDuration2.SetActive(UIEffectTweener.WrapMode.PingPongOnce <= tweener.wrapMode);
|
||||
}
|
||||
|
||||
if (m_SeekBarBgInterval2 != null)
|
||||
if (m_SeekBarBgInterval2)
|
||||
{
|
||||
m_SeekBarBgInterval2.SetActive(UIEffectTweener.WrapMode.PingPongLoop <= tweener.wrapMode);
|
||||
}
|
||||
|
||||
-5
@@ -170,12 +170,7 @@ namespace UnityEditor.Rendering.BuiltIn.ShaderGraph
|
||||
BlockFields.SurfaceDescription.Alpha,
|
||||
BlockFields.SurfaceDescription.AlphaClipThreshold
|
||||
};
|
||||
|
||||
#if UNITY_6000_6_OR_NEWER
|
||||
ProjectWindowUtil.StartNameEditingIfProjectWindowExists(EntityId.None, graphItem, name, null, null);
|
||||
#else
|
||||
ProjectWindowUtil.StartNameEditingIfProjectWindowExists(0, graphItem, name, null, null);
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData: v5.11.0
|
||||
userData: v5.9.0
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ ScriptedImporter:
|
||||
internalIDToNameTable: []
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
userData: v5.11.0
|
||||
userData: v5.9.0
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
|
||||
|
||||
+1
-1
@@ -4,6 +4,6 @@ ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData: v5.11.0 (Unity 6)
|
||||
userData: v5.9.0 (Unity 6)
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
+1
-1
@@ -4,6 +4,6 @@ ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData: v5.11.0 (Unity 6)
|
||||
userData: v5.9.0 (Unity 6)
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
+1
-1
@@ -4,6 +4,6 @@ ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData: v5.11.0 (Unity 6)
|
||||
userData: v5.9.0 (Unity 6)
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
+1
-1
@@ -4,6 +4,6 @@ ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData: v5.11.0 (Unity 6)
|
||||
userData: v5.9.0 (Unity 6)
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
+1
-1
@@ -4,6 +4,6 @@ ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData: v5.11.0 (Unity 6)
|
||||
userData: v5.9.0 (Unity 6)
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
+1
-1
@@ -4,6 +4,6 @@ ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData: v5.11.0 (Unity 6)
|
||||
userData: v5.9.0 (Unity 6)
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
+1
-1
@@ -4,6 +4,6 @@ ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData: v5.11.0 (Unity 6)
|
||||
userData: v5.9.0 (Unity 6)
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
+1
-1
@@ -4,6 +4,6 @@ ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData: v5.11.0 (Unity 6)
|
||||
userData: v5.9.0 (Unity 6)
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
+1
-1
@@ -4,6 +4,6 @@ ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData: v5.11.0
|
||||
userData: v5.9.0
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@@ -4,6 +4,6 @@ ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData: v5.11.0
|
||||
userData: v5.9.0
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
+1
-1
@@ -4,6 +4,6 @@ ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData: v5.11.0
|
||||
userData: v5.9.0
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@@ -4,6 +4,6 @@ ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData: v5.11.0
|
||||
userData: v5.9.0
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
+1
-1
@@ -4,6 +4,6 @@ ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData: v5.11.0
|
||||
userData: v5.9.0
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
+1
-1
@@ -4,6 +4,6 @@ ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData: v5.11.0
|
||||
userData: v5.9.0
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
+1
-1
@@ -4,6 +4,6 @@ ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData: v5.11.0
|
||||
userData: v5.9.0
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@@ -4,6 +4,6 @@ ShaderImporter:
|
||||
externalObjects: {}
|
||||
defaultTextures: []
|
||||
nonModifiableTextures: []
|
||||
userData: v5.11.0
|
||||
userData: v5.9.0
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
|
||||
@@ -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
+1
-1
@@ -1,5 +1,5 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 96c707d74b3d841a5a3015029fa74330
|
||||
guid: dee20160ea4174bdda8f2db637c74b64
|
||||
DefaultImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
@@ -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:
|
||||
@@ -82,7 +82,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
play = true;
|
||||
SetupProperty();
|
||||
if (reset && _tweener != null)
|
||||
if (reset && _tweener)
|
||||
{
|
||||
_tweener.direction = UIEffectTweener.Direction.Forward;
|
||||
_tweener.SetTime(0);
|
||||
@@ -93,7 +93,7 @@ namespace Coffee.UIEffects
|
||||
{
|
||||
play = true;
|
||||
SetupProperty();
|
||||
if (reset && _tweener != null)
|
||||
if (reset && _tweener)
|
||||
{
|
||||
_tweener.direction = UIEffectTweener.Direction.Reverse;
|
||||
_tweener.SetTime(_tweener.totalTime);
|
||||
@@ -106,7 +106,7 @@ namespace Coffee.UIEffects
|
||||
public void Stop(bool reset)
|
||||
{
|
||||
play = false;
|
||||
if (reset && _tweener != null)
|
||||
if (reset && _tweener)
|
||||
{
|
||||
SetupProperty();
|
||||
_tweener.SetTime(0);
|
||||
@@ -121,7 +121,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
private void SetupProperty()
|
||||
{
|
||||
if (_target == null) return;
|
||||
if (!_target) return;
|
||||
_tweener = _target.GetOrAddComponent<UIEffectTweener>();
|
||||
_tweener.enabled = play;
|
||||
_tweener.duration = duration;
|
||||
|
||||
@@ -226,7 +226,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
private void LoadDefaultTransitionTextureIfNeeded()
|
||||
{
|
||||
if (m_TransitionTexture != null) return;
|
||||
if (m_TransitionTexture) return;
|
||||
var preset = UIEffectProjectSettings.LoadPreset("Legacy-UIDissolve");
|
||||
if (preset is UIEffect presetV1)
|
||||
{
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace Coffee.UIEffects
|
||||
private bool m_Vertical = false;
|
||||
|
||||
private Graphic _graphic;
|
||||
public Graphic graphic => _graphic != null ? _graphic : _graphic = GetComponent<Graphic>();
|
||||
public Graphic graphic => _graphic ? _graphic : _graphic = GetComponent<Graphic>();
|
||||
|
||||
/// <summary>
|
||||
/// Gets or sets a value indicating whether this <see cref="Coffee.UIEffects.UIFlip"/> should be flipped horizontally.
|
||||
@@ -64,7 +64,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
public void SetVerticesDirty()
|
||||
{
|
||||
if (graphic != null)
|
||||
if (graphic)
|
||||
{
|
||||
graphic.SetVerticesDirty();
|
||||
GraphicProxy.Find(graphic).SetVerticesDirty(graphic, enabled);
|
||||
@@ -78,7 +78,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
public void ModifyMesh(VertexHelper vh)
|
||||
{
|
||||
if (!isActiveAndEnabled || graphic == null || !graphic.IsActive() || (!horizontal && !vertical)) return;
|
||||
if (!isActiveAndEnabled || !graphic || !graphic.IsActive() || (!horizontal && !vertical)) return;
|
||||
|
||||
var count = vh.currentVertCount;
|
||||
var vt = default(UIVertex);
|
||||
|
||||
@@ -207,7 +207,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
private void LoadDefaultTransitionTextureIfNeeded()
|
||||
{
|
||||
if (m_TransitionTexture != null) return;
|
||||
if (m_TransitionTexture) return;
|
||||
var preset = UIEffectProjectSettings.LoadPreset("Legacy-UIShiny");
|
||||
if (preset is UIEffect presetV1)
|
||||
{
|
||||
|
||||
@@ -251,7 +251,7 @@ namespace Coffee.UIEffects
|
||||
|
||||
private void LoadDefaultTransitionTextureIfNeeded()
|
||||
{
|
||||
if (m_TransitionTexture != null) return;
|
||||
if (m_TransitionTexture) return;
|
||||
var preset = UIEffectProjectSettings.LoadPreset("Legacy-UIDissolve");
|
||||
if (preset is UIEffect presetV1)
|
||||
{
|
||||
|
||||
@@ -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;
|
||||
@@ -82,9 +84,7 @@ uniform const matrix _CanvasToWorldMatrix;
|
||||
#endif
|
||||
|
||||
#ifndef UIEFFECT_FRAG_STRUCT
|
||||
struct uieffect_v2f
|
||||
{
|
||||
};
|
||||
struct uieffect_v2f{};
|
||||
#define UIEFFECT_FRAG_STRUCT uieffect_v2f
|
||||
#endif
|
||||
|
||||
@@ -542,7 +542,7 @@ float edge(float2 uv, const float4 uvMask, float width)
|
||||
e = min(e, (TEX_SAMPLE_CLAMP((uv + d * float2(0.0, -1.0)), uvMask)).a);
|
||||
e = min(e, (TEX_SAMPLE_CLAMP((uv + d * float2(0.5, -0.866025)), uvMask)).a);
|
||||
e = min(e, (TEX_SAMPLE_CLAMP((uv + d * float2(0.866025, -0.5)), uvMask)).a);
|
||||
|
||||
|
||||
return 1 - inv_lerp(0.15, 0.3, e);
|
||||
#else
|
||||
return 0;
|
||||
|
||||
@@ -156,7 +156,6 @@ Shader "Hidden/UI/Default (UIEffect)"
|
||||
color.rgb *= color.a;
|
||||
return color;
|
||||
}
|
||||
|
||||
#define UIEFFECT_FRAG_STRUCT v2f
|
||||
#include "Packages/com.coffee.ui-effect/Shaders/UIEffect.cginc"
|
||||
// ==== UIEFFECT END ====
|
||||
@@ -187,7 +186,7 @@ Shader "Hidden/UI/Default (UIEffect)"
|
||||
// ==== SOFTMASKABLE END ====
|
||||
|
||||
#ifdef UNITY_UI_ALPHACLIP
|
||||
clip(c.a - 0.001);
|
||||
clip (c.a - 0.001);
|
||||
#endif
|
||||
|
||||
return c;
|
||||
|
||||
@@ -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.11.9",
|
||||
"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~"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
m_EditorVersion: 2020.3.49f1
|
||||
m_EditorVersionWithRevision: 2020.3.49f1 (18249dd5551b)
|
||||
m_EditorVersion: 2022.3.62f2
|
||||
m_EditorVersionWithRevision: 2022.3.62f2 (7670c08855a9)
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
{
|
||||
"useBuildCacheServer": false,
|
||||
"cacheServerHost": "",
|
||||
"cacheServerPort": 8126,
|
||||
"threadedArchiving": true,
|
||||
"logCacheMiss": false,
|
||||
"slimWriteResults": true,
|
||||
"maximumCacheSize": 20,
|
||||
"useDetailedBuildLog": false,
|
||||
"useV2Hasher": false,
|
||||
"fileIDHashSeed": 0,
|
||||
"prefabPackedHeaderSize": 2
|
||||
}
|
||||
@@ -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": ""
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,5 @@
|
||||
{
|
||||
"gradients": "25571032a92321f4997329d90f499d06",
|
||||
"defaultFontStack": "72f6e3edfbc82804791ebe8e4814fa46",
|
||||
"defaultAppearance": "36ee3940d360ced43a59dd530844bf3d"
|
||||
}
|
||||
@@ -8,6 +8,21 @@ ShaderVariantCollection:
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_Name: ShaderVariants
|
||||
m_Shaders:
|
||||
- first: {fileID: -6465566751694194690, guid: 2da9d5515fb3241beb8b1aedff6ade6f, type: 3}
|
||||
second:
|
||||
variants:
|
||||
- keywords: COLOR_ADDITIVE TONE_GRAYSCALE
|
||||
passType: 0
|
||||
- keywords: COLOR_MULTIPLY SAMPLING_BLUR_FAST TONE_GRAYSCALE
|
||||
passType: 0
|
||||
- keywords: COLOR_MULTIPLY SAMPLING_PIXELATION TONE_GRAYSCALE
|
||||
passType: 0
|
||||
- keywords: COLOR_MULTIPLY TONE_GRAYSCALE
|
||||
passType: 0
|
||||
- keywords: COLOR_REPLACE TONE_GRAYSCALE
|
||||
passType: 0
|
||||
- keywords: TONE_GRAYSCALE
|
||||
passType: 0
|
||||
- first: {fileID: 4800000, guid: 96246b1ead49a4c5a996fd477bc5a117, type: 3}
|
||||
second:
|
||||
variants:
|
||||
@@ -202,41 +217,6 @@ ShaderVariantCollection:
|
||||
passType: 0
|
||||
- keywords: TRANSITION_FADE
|
||||
passType: 0
|
||||
- first: {fileID: 4800000, guid: 935b7be1c88464d2eb87204fdfab5a38, type: 3}
|
||||
second:
|
||||
variants:
|
||||
- keywords: SAMPLING_RGB_SHIFT TONE_RETRO TRANSITION_SHINY
|
||||
passType: 0
|
||||
- first: {fileID: 4800000, guid: 03ea49e29b5ad4fbe8e340af208fe8e7, type: 3}
|
||||
second:
|
||||
variants:
|
||||
- keywords: SAMPLING_RGB_SHIFT TONE_RETRO TRANSITION_SHINY
|
||||
passType: 0
|
||||
- first: {fileID: 4800000, guid: 2c69b4dabb5c24ae99889f581c8b556a, type: 3}
|
||||
second:
|
||||
variants:
|
||||
- keywords: SAMPLING_RGB_SHIFT TONE_RETRO TRANSITION_SHINY
|
||||
passType: 0
|
||||
- first: {fileID: 4800000, guid: 26b66f9b09b8d4ac6a2790c3fa8b21c1, type: 3}
|
||||
second:
|
||||
variants:
|
||||
- keywords: SAMPLING_RGB_SHIFT TONE_RETRO TRANSITION_SHINY
|
||||
passType: 0
|
||||
- first: {fileID: 4800000, guid: 63a1dba10bff94661a909d63808a9a3b, type: 3}
|
||||
second:
|
||||
variants:
|
||||
- keywords: SAMPLING_RGB_SHIFT TONE_RETRO TRANSITION_SHINY
|
||||
passType: 0
|
||||
- first: {fileID: 4800000, guid: d1cb940e3804b4adcaf9b22083fadfad, type: 3}
|
||||
second:
|
||||
variants:
|
||||
- keywords: SAMPLING_RGB_SHIFT TONE_RETRO TRANSITION_SHINY
|
||||
passType: 0
|
||||
- first: {fileID: 4800000, guid: e65241fa80a374114b3f55ed746c04d9, type: 3}
|
||||
second:
|
||||
variants:
|
||||
- keywords: SAMPLING_RGB_SHIFT TONE_RETRO TRANSITION_SHINY
|
||||
passType: 0
|
||||
- first: {fileID: -6465566751694194690, guid: c4b99d7494b704b7c885015e0153163b, type: 3}
|
||||
second:
|
||||
variants:
|
||||
@@ -246,16 +226,6 @@ ShaderVariantCollection:
|
||||
passType: 0
|
||||
- keywords: COLOR_CONTRAST
|
||||
passType: 0
|
||||
- keywords: COLOR_FILTER
|
||||
passType: 0
|
||||
- keywords: COLOR_FILTER SAMPLING_BLUR_FAST
|
||||
passType: 0
|
||||
- keywords: COLOR_FILTER TARGET_HUE
|
||||
passType: 0
|
||||
- keywords: COLOR_FILTER TARGET_LUMINANCE
|
||||
passType: 0
|
||||
- keywords: COLOR_FILTER TRANSITION_MELT
|
||||
passType: 0
|
||||
- keywords: COLOR_HSV_MODIFIER
|
||||
passType: 0
|
||||
- keywords: COLOR_HSV_MODIFIER TARGET_HUE
|
||||
@@ -288,10 +258,6 @@ ShaderVariantCollection:
|
||||
passType: 0
|
||||
- keywords: EDGE_COLOR_MULTIPLY_ADDITIVE EDGE_SHINY
|
||||
passType: 0
|
||||
- keywords: EDGE_PLAIN
|
||||
passType: 0
|
||||
- keywords: EDGE_SHINY
|
||||
passType: 0
|
||||
- keywords: GRADATION_COLOR2
|
||||
passType: 0
|
||||
- keywords: GRADATION_COLOR4
|
||||
@@ -330,8 +296,6 @@ ShaderVariantCollection:
|
||||
passType: 0
|
||||
- keywords: TONE_SEPIA
|
||||
passType: 0
|
||||
- keywords: TRANSITION_BURN
|
||||
passType: 0
|
||||
- keywords: TRANSITION_BURN TRANSITION_COLOR_MULTIPLY_ADDITIVE
|
||||
passType: 0
|
||||
- keywords: TRANSITION_COLOR_MULTIPLY TRANSITION_PATTERN
|
||||
@@ -346,38 +310,8 @@ ShaderVariantCollection:
|
||||
passType: 0
|
||||
- keywords: TRANSITION_CUTOFF
|
||||
passType: 0
|
||||
- keywords: TRANSITION_DISSOLVE
|
||||
passType: 0
|
||||
- keywords: TRANSITION_FADE
|
||||
passType: 0
|
||||
- keywords: TRANSITION_MASK
|
||||
passType: 0
|
||||
- keywords: TRANSITION_MELT
|
||||
passType: 0
|
||||
- keywords: TRANSITION_PATTERN
|
||||
passType: 0
|
||||
- keywords: TRANSITION_SHINY
|
||||
passType: 0
|
||||
- first: {fileID: 4800000, guid: 16f26337621974eaf998b9857bac39c6, type: 3}
|
||||
second:
|
||||
variants:
|
||||
- keywords: SAMPLING_RGB_SHIFT TONE_RETRO TRANSITION_SHINY
|
||||
passType: 0
|
||||
- first: {fileID: -6465566751694194690, guid: 2da9d5515fb3241beb8b1aedff6ade6f, type: 3}
|
||||
second:
|
||||
variants:
|
||||
- keywords: COLOR_ADDITIVE TONE_GRAYSCALE
|
||||
passType: 0
|
||||
- keywords: COLOR_MULTIPLY SAMPLING_BLUR_FAST TONE_GRAYSCALE
|
||||
passType: 0
|
||||
- keywords: COLOR_MULTIPLY SAMPLING_PIXELATION TONE_GRAYSCALE
|
||||
passType: 0
|
||||
- keywords: COLOR_MULTIPLY TONE_GRAYSCALE
|
||||
passType: 0
|
||||
- keywords: COLOR_REPLACE TONE_GRAYSCALE
|
||||
passType: 0
|
||||
- keywords: TONE_GRAYSCALE
|
||||
passType: 0
|
||||
--- !u!114 &11400000
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
@@ -390,11 +324,10 @@ MonoBehaviour:
|
||||
m_Script: {fileID: 11500000, guid: 7d43f626d9b5f4d729097092ded48bdb, type: 3}
|
||||
m_Name: UIEffectProjectSettings
|
||||
m_EditorClassIdentifier:
|
||||
m_PreLoadSettingsInBuild: 1
|
||||
m_TransformSensitivity: 1
|
||||
m_RuntimePresets:
|
||||
- {fileID: 1645081683573595507, guid: 3b09ad143990c4c8795c6e93760e132a, type: 3}
|
||||
- {fileID: 1645081683573595507, guid: 4f70ff0f1e25b4388b9bcb38d619f7bf, type: 3}
|
||||
m_RuntimePresetsV2: []
|
||||
m_UseHDRColorPicker: 1
|
||||
m_ShaderVariantCollection: {fileID: 0}
|
||||
m_ShaderVariantRegistry:
|
||||
@@ -420,17 +353,5 @@ MonoBehaviour:
|
||||
- key: Shader Graphs/UISample (UIEffect)
|
||||
value: Shader Graphs/UISample (UIEffect)
|
||||
m_Asset: {fileID: -7225376290180000660}
|
||||
m_RegisteredShaders:
|
||||
- {fileID: 4800000, guid: 96246b1ead49a4c5a996fd477bc5a117, type: 3}
|
||||
- {fileID: -6465566751694194690, guid: e5b632cdcfc38478ebc1424ae9371f99, type: 3}
|
||||
- {fileID: 4800000, guid: 935b7be1c88464d2eb87204fdfab5a38, type: 3}
|
||||
- {fileID: 4800000, guid: 03ea49e29b5ad4fbe8e340af208fe8e7, type: 3}
|
||||
- {fileID: 4800000, guid: 2c69b4dabb5c24ae99889f581c8b556a, type: 3}
|
||||
- {fileID: 4800000, guid: 26b66f9b09b8d4ac6a2790c3fa8b21c1, type: 3}
|
||||
- {fileID: 4800000, guid: 63a1dba10bff94661a909d63808a9a3b, type: 3}
|
||||
- {fileID: 4800000, guid: d1cb940e3804b4adcaf9b22083fadfad, type: 3}
|
||||
- {fileID: 4800000, guid: e65241fa80a374114b3f55ed746c04d9, type: 3}
|
||||
- {fileID: -6465566751694194690, guid: c4b99d7494b704b7c885015e0153163b, type: 3}
|
||||
- {fileID: 4800000, guid: 16f26337621974eaf998b9857bac39c6, type: 3}
|
||||
m_ErrorOnUnregisteredVariant: 0
|
||||
m_UnregisteredVariants: []
|
||||
|
||||
@@ -13,7 +13,6 @@ MonoBehaviour:
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
shaderVariantLimit: 2048
|
||||
overrideShaderVariantLimit: 0
|
||||
customInterpolatorErrorThreshold: 32
|
||||
customInterpolatorWarningThreshold: 16
|
||||
customHeatmapValues: {fileID: 0}
|
||||
|
||||
Reference in New Issue
Block a user