Compare commits

..

21 Commits

Author SHA1 Message Date
semantic-release-bot 184967c120 chore(release): 5.8.2 [skip ci]
## [5.8.2](https://github.com/mob-sakai/UIEffect/compare/5.8.1...5.8.2) (2025-04-23)

### Bug Fixes

* `Flip` is ignored when loading a preset ([e1f3abf](https://github.com/mob-sakai/UIEffect/commit/e1f3abf7a65b62718b28e33ac2f7d700c3ae3f5a))
* fix detail color ([90ab16c](https://github.com/mob-sakai/UIEffect/commit/90ab16c3fd46435ebf7c8e47ffb4ec521d2f61c9))
* indicate in the inspector using tooltips and asterisks that `Rotation` and `Keep Aspect Ratio` are shared properties ([2cca822](https://github.com/mob-sakai/UIEffect/commit/2cca822413aa7580e1eb777c3295d1de928cd65f))
2025-04-23 23:24:29 +00:00
mob-sakai 2cca822413 fix: indicate in the inspector using tooltips and asterisks that Rotation and Keep Aspect Ratio are shared properties 2025-04-19 10:22:34 +09:00
mob-sakai 90ab16c3fd fix: fix detail color 2025-04-19 10:22:34 +09:00
mob-sakai e1f3abf7a6 fix: Flip is ignored when loading a preset 2025-04-19 10:21:16 +09:00
mob-sakai 770e61bb12 chore: refactor 2025-04-18 17:32:30 +09:00
mob-sakai a0820bf847 chore: update coffee.internal 2025-04-18 17:14:44 +09:00
semantic-release-bot 1a21464c0e chore(release): 5.8.1 [skip ci]
## [5.8.1](https://github.com/mob-sakai/UIEffect/compare/5.8.0...5.8.1) (2025-04-17)

### Bug Fixes

* built-in presets cannot be used with `UIEffectReplica` ([1106f4b](https://github.com/mob-sakai/UIEffect/commit/1106f4bf4632e1372d44ced9a38e98209a6b55e8))
* New presets ignore `DetailColor` property ([1143fbb](https://github.com/mob-sakai/UIEffect/commit/1143fbb84a1e08817de93f1349ee5cdad0972db5)), closes [#336](https://github.com/mob-sakai/UIEffect/issues/336)
* prevent built-in preset assets from being editable ([0898d73](https://github.com/mob-sakai/UIEffect/commit/0898d730add42970fb74bf2ad8aca9809bf6dd39))
2025-04-17 11:20:54 +00:00
mob-sakai 1143fbb84a fix: New presets ignore DetailColor property
close #336
2025-04-17 20:20:14 +09:00
mob-sakai eff923493a update demo 2025-04-17 18:56:24 +09:00
mob-sakai 0898d730ad fix: prevent built-in preset assets from being editable 2025-04-17 17:48:12 +09:00
mob-sakai 1106f4bf46 fix: built-in presets cannot be used with UIEffectReplica 2025-04-17 17:38:03 +09:00
semantic-release-bot 2861b1ce61 chore(release): 5.8.0 [skip ci]
# [5.8.0](https://github.com/mob-sakai/UIEffect/compare/5.7.0...5.8.0) (2025-04-17)

### Bug Fixes

* `ShadowMode.Mirror` does not flip the effect ([37daad0](https://github.com/mob-sakai/UIEffect/commit/37daad01c4f3f4c259650b1493aeae204e0bd247))
* fix alpha clipping for ShaderGraph ([ae177a8](https://github.com/mob-sakai/UIEffect/commit/ae177a800cba1561b523292279d7986d4eff9f9c))
* unable to add editor presets as runtime presets to project settings ([726bb10](https://github.com/mob-sakai/UIEffect/commit/726bb100a0ad327619634ea73ccdccc36276d0d0)), closes [#330](https://github.com/mob-sakai/UIEffect/issues/330)

### Features

* add `DetailColor` property ([30bf783](https://github.com/mob-sakai/UIEffect/commit/30bf783320398d68b90b09b0dcf93738b4683e00)), closes [#332](https://github.com/mob-sakai/UIEffect/issues/332)
* ScriptableObject based preset system ([f8682f3](https://github.com/mob-sakai/UIEffect/commit/f8682f3c9889fb56ff3cd9010934f998e121553a)), closes [#333](https://github.com/mob-sakai/UIEffect/issues/333)
2025-04-17 05:07:03 +00:00
mob-sakai 6eabdc694e docs: update readme 2025-04-17 14:06:24 +09:00
mob-sakai ae177a800c fix: fix alpha clipping for ShaderGraph 2025-04-17 02:57:46 +09:00
mob-sakai 88bb76d735 update demo 2025-04-17 02:57:46 +09:00
mob-sakai 37daad01c4 fix: ShadowMode.Mirror does not flip the effect 2025-04-17 02:57:46 +09:00
mob-sakai 1ce32f7829 refactor: refactor code 2025-04-17 02:23:09 +09:00
mob-sakai 726bb100a0 fix: unable to add editor presets as runtime presets to project settings
close #330
2025-04-17 02:23:09 +09:00
mob-sakai f8682f3c98 feat: ScriptableObject based preset system
NOTE: This change will rename the built-in runtime preset.
For example, change the name `001 - Tone - Glayscale` to `Tone-Glayscale`.
close #333
2025-04-17 02:23:09 +09:00
mob-sakai 99669728cc refactor: refactor code 2025-04-17 02:23:09 +09:00
mob-sakai 30bf783320 feat: add DetailColor property
close #332
2025-04-17 02:23:09 +09:00
256 changed files with 7315 additions and 4458 deletions
@@ -1,6 +1,7 @@
fileFormatVersion: 2
guid: 3b09ad143990c4c8795c6e93760e132a
PrefabImporter:
guid: 7b8df35684c964c1da889d4128ed94ed
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
@@ -0,0 +1,63 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-7987516966893236458
MonoBehaviour:
m_ObjectHideFlags: 3
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: 0b2db86121404754db890f4c8dfe81b2, type: 3}
m_Name: Bloom
m_EditorClassIdentifier:
active: 1
skipIterations:
m_OverrideState: 0
m_Value: 1
threshold:
m_OverrideState: 1
m_Value: 0.99
intensity:
m_OverrideState: 1
m_Value: 2
scatter:
m_OverrideState: 0
m_Value: 0.7
clamp:
m_OverrideState: 0
m_Value: 65472
tint:
m_OverrideState: 0
m_Value: {r: 1, g: 1, b: 1, a: 1}
highQualityFiltering:
m_OverrideState: 0
m_Value: 0
downscale:
m_OverrideState: 0
m_Value: 0
maxIterations:
m_OverrideState: 0
m_Value: 6
dirtTexture:
m_OverrideState: 0
m_Value: {fileID: 0}
dimension: 1
dirtIntensity:
m_OverrideState: 0
m_Value: 0
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3}
m_Name: MultiColorDissolve
m_EditorClassIdentifier:
components:
- {fileID: -7987516966893236458}
@@ -1,7 +1,8 @@
fileFormatVersion: 2
guid: 4f70ff0f1e25b4388b9bcb38d619f7bf
PrefabImporter:
guid: 57ac8962e3fd34b1ab7016e803973b51
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,80 @@
using Coffee.UIEffects;
using UnityEngine;
[ExecuteAlways]
public class MultiColorDissolve : MonoBehaviour
{
[SerializeField] private UIEffect m_Base;
[Header("Dissolve 1")]
[SerializeField] private UIEffect m_Dissolve1;
[ColorUsage(true, true)]
[SerializeField]
private Color m_DissolveColor1 = Color.red;
[Range(0, 0.1f)]
[SerializeField]
private float m_Delay1 = 0.05f;
[Range(0, 0.2f)]
[SerializeField]
private float m_Width1 = 0.1f;
[Range(0, 1f)]
[SerializeField]
private float m_Softness1 = 0.5f;
[Header("Dissolve 2")]
[SerializeField]
private UIEffect m_Dissolve2;
[ColorUsage(true, true)]
[SerializeField]
private Color m_DissolveColor2 = Color.magenta;
[Range(0, 0.1f)]
[SerializeField]
private float m_Delay2 = 0.1f;
[Range(0, 0.2f)]
[SerializeField]
private float m_Width2 = 0.1f;
[Range(0, 1f)]
[SerializeField]
private float m_Softness2 = 0.5f;
[Space]
[Range(0, 1)] [SerializeField] private float m_Rate;
public void SetRate(float rate)
{
m_Rate = rate;
if (m_Base)
{
m_Base.transitionRate = rate;
}
if (m_Dissolve1)
{
m_Dissolve1.transitionRate = rate - m_Delay1;
m_Dissolve1.transitionColor = m_DissolveColor1;
m_Dissolve1.transitionWidth = m_Width1;
m_Dissolve1.transitionSoftness = m_Softness1;
}
if (m_Dissolve2)
{
m_Dissolve2.transitionRate = rate - m_Delay2 * 2;
m_Dissolve2.transitionColor = m_DissolveColor2;
m_Dissolve2.transitionWidth = m_Width2;
m_Dissolve2.transitionSoftness = m_Softness2;
}
}
private void OnValidate()
{
SetRate(m_Rate);
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1cb0fa86a0fba445092aa81b4974b7cd
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
File diff suppressed because it is too large Load Diff
@@ -1,6 +1,6 @@
fileFormatVersion: 2
guid: 9f02363c499e3488da5755c9b528ab9f
PrefabImporter:
guid: ba87f0cfb8c4b4eaea328308391c06e5
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
File diff suppressed because it is too large Load Diff
@@ -9,7 +9,7 @@ using Debug = UnityEngine.Debug;
internal static class TextMeshProSupport
{
private const string k_Version = "userData: v5.7.0";
private const string k_Version = "userData: v5.8.0";
private const string k_VersionUnity6 = k_Version + " (Unity 6)";
private static readonly Dictionary<string, string> s_FileGuids = new Dictionary<string, string>()
@@ -1,6 +1,7 @@
fileFormatVersion: 2
guid: 6ea354ac6895e4e7489fd006c9b61082
PrefabImporter:
guid: c00285a6a9d0843f4a7da23d7dda6582
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
+27
View File
@@ -0,0 +1,27 @@
using UnityEditor;
internal static class UserDataEditor
{
[InitializeOnLoadMethod]
private static void InitializeOnLoadMethod()
{
Editor.finishedDefaultHeaderGUI += OnFinishedDefaultHeaderGUI;
}
private static void OnFinishedDefaultHeaderGUI(Editor editor)
{
var importer = editor.target as AssetImporter;
if (!importer)
{
if (!AssetDatabase.Contains(editor.target)) return;
importer = AssetImporter.GetAtPath(AssetDatabase.GetAssetPath(editor.target));
}
if (!importer) return;
EditorGUIUtility.labelWidth = 55;
importer.userData = EditorGUILayout.DelayedTextField("userdata", importer.userData);
AssetDatabase.WriteImportSettingsIfDirty(importer.assetPath);
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 92afd1c51675640e88e3abb238cd225f
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -8,32 +8,16 @@ ShaderVariantCollection:
m_PrefabAsset: {fileID: 0}
m_Name: UIEffectShaderVariants
m_Shaders:
- first: {fileID: 4800000, guid: d1cb940e3804b4adcaf9b22083fadfad, type: 3}
second:
variants:
- keywords: SAMPLING_RGB_SHIFT TONE_RETRO TRANSITION_COLOR_MULTIPLY_ADDITIVE
TRANSITION_SHINY
passType: 0
- first: {fileID: 4800000, guid: 63a1dba10bff94661a909d63808a9a3b, type: 3}
second:
variants:
- keywords: SAMPLING_RGB_SHIFT TONE_RETRO TRANSITION_COLOR_MULTIPLY_ADDITIVE
TRANSITION_SHINY
passType: 0
- first: {fileID: 4800000, guid: e65241fa80a374114b3f55ed746c04d9, type: 3}
second:
variants:
- keywords: SAMPLING_RGB_SHIFT TONE_RETRO TRANSITION_COLOR_MULTIPLY_ADDITIVE
TRANSITION_SHINY
passType: 0
- first: {fileID: 4800000, guid: 935b7be1c88464d2eb87204fdfab5a38, type: 3}
second:
variants:
- keywords: COLOR_HSV_MODIFIER GLOW_ON UNDERLAY_ON
- keywords: COLOR_FILTER GLOW_ON GRADATION_GRADIENT UNDERLAY_ON
passType: 0
- keywords: COLOR_MULTIPLY GLOW_ON UNDERLAY_ON
- keywords: COLOR_FILTER GLOW_ON TRANSITION_BURN UNDERLAY_ON
passType: 0
- keywords: EDGE_COLOR_REPLACE EDGE_PLAIN GLOW_ON UNDERLAY_ON
- keywords: COLOR_FILTER GLOW_ON UNDERLAY_ON
passType: 0
- keywords: EDGE_PLAIN GLOW_ON UNDERLAY_ON
passType: 0
- keywords: GLOW_ON SAMPLING_BLUR_DETAIL UNDERLAY_ON
passType: 0
@@ -45,64 +29,42 @@ ShaderVariantCollection:
passType: 0
- keywords: GLOW_ON SAMPLING_RGB_SHIFT UNDERLAY_ON
passType: 0
- keywords: GLOW_ON SHADOW_COLOR_REPLACE TRANSITION_BURN TRANSITION_COLOR_MULTIPLY_ADDITIVE
UNDERLAY_ON
passType: 0
- keywords: GLOW_ON SHADOW_COLOR_REPLACE UNDERLAY_ON
passType: 0
- keywords: GLOW_ON TONE_RETRO UNDERLAY_ON
passType: 0
- keywords: GLOW_ON TRANSITION_BURN TRANSITION_COLOR_MULTIPLY_ADDITIVE UNDERLAY_ON
- keywords: GLOW_ON TRANSITION_BURN UNDERLAY_ON
passType: 0
- keywords: GLOW_ON TRANSITION_COLOR_MULTIPLY TRANSITION_PATTERN UNDERLAY_ON
- keywords: GLOW_ON TRANSITION_DISSOLVE UNDERLAY_ON
passType: 0
- keywords: GLOW_ON TRANSITION_COLOR_MULTIPLY_ADDITIVE TRANSITION_DISSOLVE
UNDERLAY_ON
- keywords: GLOW_ON TRANSITION_MELT UNDERLAY_ON
passType: 0
- keywords: GLOW_ON TRANSITION_COLOR_MULTIPLY_ADDITIVE TRANSITION_MELT UNDERLAY_ON
- keywords: GLOW_ON TRANSITION_PATTERN UNDERLAY_ON
passType: 0
- keywords: GLOW_ON TRANSITION_COLOR_MULTIPLY_ADDITIVE TRANSITION_PATTERN UNDERLAY_ON
passType: 0
- keywords: GLOW_ON TRANSITION_COLOR_MULTIPLY_ADDITIVE TRANSITION_SHINY UNDERLAY_ON
passType: 0
- keywords: GLOW_ON TRANSITION_COLOR_REPLACE TRANSITION_MELT UNDERLAY_ON
passType: 0
- keywords: SAMPLING_RGB_SHIFT TONE_RETRO TRANSITION_COLOR_MULTIPLY_ADDITIVE
TRANSITION_SHINY
- keywords: GLOW_ON TRANSITION_SHINY UNDERLAY_ON
passType: 0
- first: {fileID: 4800000, guid: 96246b1ead49a4c5a996fd477bc5a117, type: 3}
second:
variants:
- keywords:
passType: 0
- keywords: COLOR_ADDITIVE
- keywords: COLOR_FILTER
passType: 0
- keywords: COLOR_CONTRAST
- keywords: COLOR_FILTER EDGE_PLAIN
passType: 0
- keywords: COLOR_HSV_MODIFIER
- keywords: COLOR_FILTER EDGE_PLAIN TRANSITION_PATTERN
passType: 0
- keywords: COLOR_HSV_MODIFIER TARGET_HUE
- keywords: COLOR_FILTER EDGE_SHINY
passType: 0
- keywords: COLOR_HSV_MODIFIER TARGET_LUMINANCE
- keywords: COLOR_FILTER SAMPLING_BLUR_FAST
passType: 0
- keywords: COLOR_MULTIPLY
- keywords: COLOR_FILTER SAMPLING_BLUR_FAST TONE_GRAYSCALE
passType: 0
- keywords: COLOR_MULTIPLY DETAIL_MASKING EDGE_COLOR_MULTIPLY_ADDITIVE EDGE_SHINY
SAMPLING_BLUR_FAST SHADOW_COLOR_REPLACE TARGET_HUE TONE_GRAYSCALE TRANSITION_COLOR_MULTIPLY_ADDITIVE
TRANSITION_DISSOLVE
- keywords: COLOR_FILTER SAMPLING_BLUR_FAST TONE_GRAYSCALE TRANSITION_DISSOLVE
passType: 0
- keywords: COLOR_MULTIPLY SHADOW_COLOR_REPLACE
- keywords: COLOR_FILTER TARGET_HUE
passType: 0
- keywords: COLOR_MULTIPLY_ADDITIVE
- keywords: COLOR_FILTER TARGET_LUMINANCE
passType: 0
- keywords: COLOR_MULTIPLY_ADDITIVE SAMPLING_BLUR_FAST TONE_GRAYSCALE TRANSITION_COLOR_MULTIPLY_ADDITIVE
TRANSITION_DISSOLVE
passType: 0
- keywords: COLOR_MULTIPLY_LUMINANCE
passType: 0
- keywords: COLOR_REPLACE
passType: 0
- keywords: COLOR_SUBTRACTIVE
- keywords: COLOR_FILTER TRANSITION_MELT
passType: 0
- keywords: DETAIL_ADDITIVE
passType: 0
@@ -110,47 +72,41 @@ ShaderVariantCollection:
passType: 0
- keywords: DETAIL_MULTIPLY
passType: 0
- keywords: DETAIL_MULTIPLY EDGE_COLOR_MULTIPLY_ADDITIVE EDGE_SHINY
passType: 0
- keywords: DETAIL_MULTIPLY_ADDITIVE
passType: 0
- keywords: DETAIL_REPLACE
passType: 0
- keywords: EDGE_COLOR_MULTIPLY_ADDITIVE EDGE_PLAIN
- keywords: DETAIL_SUBTRACTIVE
passType: 0
- keywords: EDGE_COLOR_MULTIPLY_ADDITIVE EDGE_PLAIN SHADOW_COLOR_MULTIPLY_ADDITIVE
- keywords: EDGE_PLAIN
passType: 0
- keywords: EDGE_COLOR_MULTIPLY_ADDITIVE EDGE_SHINY
- keywords: EDGE_PLAIN TRANSITION_PATTERN
passType: 0
- keywords: EDGE_COLOR_MULTIPLY_ADDITIVE EDGE_SHINY SAMPLING_EDGE_ALPHA
- keywords: EDGE_SHINY
passType: 0
- keywords: EDGE_COLOR_MULTIPLY_ADDITIVE EDGE_SHINY SHADOW_COLOR_MULTIPLY_ADDITIVE
- keywords: EDGE_SHINY SAMPLING_EDGE_ALPHA
passType: 0
- keywords: EDGE_COLOR_MULTIPLY_ADDITIVE EDGE_SHINY TRANSITION_COLOR_MULTIPLY
TRANSITION_PATTERN
- keywords: EDGE_SHINY TRANSITION_PATTERN
passType: 0
- keywords: EDGE_COLOR_MULTIPLY_ADDITIVE EDGE_SHINY TRANSITION_COLOR_MULTIPLY_ADDITIVE
TRANSITION_PATTERN
- keywords: GRADATION_COLOR2
passType: 0
- keywords: EDGE_PLAIN SHADOW_COLOR_REPLACE TRANSITION_COLOR_MULTIPLY TRANSITION_PATTERN
- keywords: GRADATION_COLOR4
passType: 0
- keywords: EDGE_PLAIN TRANSITION_COLOR_MULTIPLY TRANSITION_PATTERN
- keywords: GRADATION_GRADIENT
passType: 0
- keywords: GRADATION_RADIAL
passType: 0
- keywords: SAMPLING_BLUR_DETAIL
passType: 0
- keywords: SAMPLING_BLUR_FAST
passType: 0
- keywords: SAMPLING_BLUR_FAST SHADOW_COLOR_MULTIPLY_ADDITIVE TONE_GRAYSCALE
passType: 0
- keywords: SAMPLING_BLUR_FAST SHADOW_COLOR_REPLACE
passType: 0
- keywords: SAMPLING_BLUR_MEDIUM
passType: 0
- keywords: SAMPLING_EDGE_ALPHA
passType: 0
- keywords: SAMPLING_EDGE_LUMINANCE
passType: 0
- keywords: SAMPLING_EDGE_LUMINANCE TRANSITION_COLOR_MULTIPLY_ADDITIVE TRANSITION_MASK
- keywords: SAMPLING_EDGE_LUMINANCE TRANSITION_MASK
passType: 0
- keywords: SAMPLING_PIXELATION
passType: 0
@@ -158,18 +114,8 @@ ShaderVariantCollection:
passType: 0
- keywords: SAMPLING_PIXELATION TONE_RETRO UNITY_UI_CLIP_RECT
passType: 0
- keywords: SAMPLING_PIXELATION TRANSITION_COLOR_MULTIPLY TRANSITION_PATTERN
passType: 0
- keywords: SAMPLING_PIXELATION TRANSITION_COLOR_MULTIPLY_ADDITIVE TRANSITION_DISSOLVE
passType: 0
- keywords: SAMPLING_RGB_SHIFT
passType: 0
- keywords: SAMPLING_RGB_SHIFT TRANSITION_COLOR_MULTIPLY TRANSITION_PATTERN
passType: 0
- keywords: SHADOW_COLOR_REPLACE
passType: 0
- keywords: SHADOW_COLOR_REPLACE TRANSITION_COLOR_REPLACE TRANSITION_MELT
passType: 0
- keywords: TONE_GRAYSCALE
passType: 0
- keywords: TONE_NEGATIVE
@@ -180,59 +126,31 @@ ShaderVariantCollection:
passType: 0
- keywords: TONE_SEPIA
passType: 0
- keywords: TRANSITION_BURN TRANSITION_COLOR_MULTIPLY_ADDITIVE
- keywords: TRANSITION_BURN
passType: 0
- keywords: TRANSITION_BURN TRANSITION_COLOR_MULTIPLY_ADDITIVE UNITY_UI_CLIP_RECT
passType: 0
- keywords: TRANSITION_COLOR_MULTIPLY TRANSITION_PATTERN
passType: 0
- keywords: TRANSITION_COLOR_MULTIPLY TRANSITION_PATTERN UNITY_UI_CLIP_RECT
passType: 0
- keywords: TRANSITION_COLOR_MULTIPLY_ADDITIVE TRANSITION_DISSOLVE
passType: 0
- keywords: TRANSITION_COLOR_MULTIPLY_ADDITIVE TRANSITION_DISSOLVE UNITY_UI_CLIP_RECT
passType: 0
- keywords: TRANSITION_COLOR_MULTIPLY_ADDITIVE TRANSITION_MASK
passType: 0
- keywords: TRANSITION_COLOR_MULTIPLY_ADDITIVE TRANSITION_MELT
passType: 0
- keywords: TRANSITION_COLOR_MULTIPLY_ADDITIVE TRANSITION_MELT UNITY_UI_CLIP_RECT
passType: 0
- keywords: TRANSITION_COLOR_MULTIPLY_ADDITIVE TRANSITION_PATTERN
passType: 0
- keywords: TRANSITION_COLOR_MULTIPLY_ADDITIVE TRANSITION_SHINY
passType: 0
- keywords: TRANSITION_COLOR_MULTIPLY_ADDITIVE TRANSITION_SHINY UNITY_UI_CLIP_RECT
passType: 0
- keywords: TRANSITION_COLOR_REPLACE TRANSITION_MELT
- keywords: TRANSITION_BURN UNITY_UI_CLIP_RECT
passType: 0
- keywords: TRANSITION_CUTOFF
passType: 0
- keywords: TRANSITION_DISSOLVE
passType: 0
- keywords: TRANSITION_DISSOLVE UNITY_UI_CLIP_RECT
passType: 0
- keywords: TRANSITION_FADE
passType: 0
- first: {fileID: 4800000, guid: 03ea49e29b5ad4fbe8e340af208fe8e7, type: 3}
second:
variants:
- keywords: SAMPLING_RGB_SHIFT TONE_RETRO TRANSITION_COLOR_MULTIPLY_ADDITIVE
TRANSITION_SHINY
- keywords: TRANSITION_MASK
passType: 0
- first: {fileID: 4800000, guid: 16f26337621974eaf998b9857bac39c6, type: 3}
second:
variants:
- keywords: SAMPLING_RGB_SHIFT TONE_RETRO TRANSITION_COLOR_MULTIPLY_ADDITIVE
TRANSITION_SHINY
- keywords: TRANSITION_MELT
passType: 0
- first: {fileID: 4800000, guid: 2c69b4dabb5c24ae99889f581c8b556a, type: 3}
second:
variants:
- keywords: SAMPLING_RGB_SHIFT TONE_RETRO TRANSITION_COLOR_MULTIPLY_ADDITIVE
TRANSITION_SHINY
- keywords: TRANSITION_MELT UNITY_UI_CLIP_RECT
passType: 0
- first: {fileID: 4800000, guid: 26b66f9b09b8d4ac6a2790c3fa8b21c1, type: 3}
second:
variants:
- keywords: SAMPLING_RGB_SHIFT TONE_RETRO TRANSITION_COLOR_MULTIPLY_ADDITIVE
TRANSITION_SHINY
- keywords: TRANSITION_PATTERN
passType: 0
- keywords: TRANSITION_PATTERN UNITY_UI_CLIP_RECT
passType: 0
- keywords: TRANSITION_SHINY
passType: 0
- keywords: TRANSITION_SHINY UNITY_UI_CLIP_RECT
passType: 0
--- !u!114 &11400000
MonoBehaviour:
@@ -246,10 +164,10 @@ MonoBehaviour:
m_Script: {fileID: 11500000, guid: 7d43f626d9b5f4d729097092ded48bdb, type: 3}
m_Name: UIEffectProjectSettings
m_EditorClassIdentifier:
m_TransformSensitivity: 1
m_RuntimePresets:
- {fileID: 1645081683573595507, guid: 3b09ad143990c4c8795c6e93760e132a, type: 3}
- {fileID: 1645081683573595507, guid: 4f70ff0f1e25b4388b9bcb38d619f7bf, type: 3}
m_RuntimePresets: []
m_RuntimePresetsV2:
- {fileID: 11400000, guid: 460881a8263ce454799a8c689c28d8c9, type: 2}
- {fileID: 11400000, guid: b919bc84de9254bcf8f614d392db83bb, type: 2}
m_UseHDRColorPicker: 1
m_ShaderVariantCollection: {fileID: -8740588384831342173}
m_ShaderVariantRegistry:
+1 -1
View File
@@ -4,7 +4,7 @@
"com.coffee.minimal-resource": "https://github.com/mob-sakai/Coffee.Internal.git?path=Packages/MinimalResource",
"com.coffee.nano-monitor": "https://github.com/mob-sakai/Coffee.Internal.git?path=Packages/NanoMonitor",
"com.coffee.symbolic-linker": "https://github.com/mob-sakai/Coffee.Internal.git?path=Packages/SymbolicLinker",
"com.unity.ide.rider": "3.0.34",
"com.unity.ide.rider": "3.0.36",
"com.unity.test-framework": "1.1.33",
"com.unity.textmeshpro": "3.0.9",
"com.unity.modules.animation": "1.0.0"
+5 -5
View File
@@ -5,14 +5,14 @@
"depth": 0,
"source": "git",
"dependencies": {},
"hash": "2045eaab5b485827cef8bf0bb9e1552dce4f8d6d"
"hash": "4a182298bd6293c4e6e33dd40bb7a050847190d8"
},
"com.coffee.minimal-resource": {
"version": "https://github.com/mob-sakai/Coffee.Internal.git?path=Packages/MinimalResource",
"depth": 0,
"source": "git",
"dependencies": {},
"hash": "2bd2bf356dd692a39de9db2ff11faaf79fbfaea3"
"hash": "4a182298bd6293c4e6e33dd40bb7a050847190d8"
},
"com.coffee.nano-monitor": {
"version": "https://github.com/mob-sakai/Coffee.Internal.git?path=Packages/NanoMonitor",
@@ -21,14 +21,14 @@
"dependencies": {
"com.unity.ugui": "1.0.0"
},
"hash": "2045eaab5b485827cef8bf0bb9e1552dce4f8d6d"
"hash": "4a182298bd6293c4e6e33dd40bb7a050847190d8"
},
"com.coffee.symbolic-linker": {
"version": "https://github.com/mob-sakai/Coffee.Internal.git?path=Packages/SymbolicLinker",
"depth": 0,
"source": "git",
"dependencies": {},
"hash": "3c280f1a8f4db5038b881ff07f270efd9638fa31"
"hash": "4a182298bd6293c4e6e33dd40bb7a050847190d8"
},
"com.coffee.ui-effect": {
"version": "file:src",
@@ -46,7 +46,7 @@
"url": "https://packages.unity.com"
},
"com.unity.ide.rider": {
"version": "3.0.34",
"version": "3.0.36",
"depth": 0,
"source": "registry",
"dependencies": {
+33
View File
@@ -1,3 +1,36 @@
## [5.8.2](https://github.com/mob-sakai/UIEffect/compare/5.8.1...5.8.2) (2025-04-23)
### Bug Fixes
* `Flip` is ignored when loading a preset ([e1f3abf](https://github.com/mob-sakai/UIEffect/commit/e1f3abf7a65b62718b28e33ac2f7d700c3ae3f5a))
* fix detail color ([90ab16c](https://github.com/mob-sakai/UIEffect/commit/90ab16c3fd46435ebf7c8e47ffb4ec521d2f61c9))
* indicate in the inspector using tooltips and asterisks that `Rotation` and `Keep Aspect Ratio` are shared properties ([2cca822](https://github.com/mob-sakai/UIEffect/commit/2cca822413aa7580e1eb777c3295d1de928cd65f))
## [5.8.1](https://github.com/mob-sakai/UIEffect/compare/5.8.0...5.8.1) (2025-04-17)
### Bug Fixes
* built-in presets cannot be used with `UIEffectReplica` ([1106f4b](https://github.com/mob-sakai/UIEffect/commit/1106f4bf4632e1372d44ced9a38e98209a6b55e8))
* New presets ignore `DetailColor` property ([1143fbb](https://github.com/mob-sakai/UIEffect/commit/1143fbb84a1e08817de93f1349ee5cdad0972db5)), closes [#336](https://github.com/mob-sakai/UIEffect/issues/336)
* prevent built-in preset assets from being editable ([0898d73](https://github.com/mob-sakai/UIEffect/commit/0898d730add42970fb74bf2ad8aca9809bf6dd39))
# [5.8.0](https://github.com/mob-sakai/UIEffect/compare/5.7.0...5.8.0) (2025-04-17)
### Bug Fixes
* `ShadowMode.Mirror` does not flip the effect ([37daad0](https://github.com/mob-sakai/UIEffect/commit/37daad01c4f3f4c259650b1493aeae204e0bd247))
* fix alpha clipping for ShaderGraph ([ae177a8](https://github.com/mob-sakai/UIEffect/commit/ae177a800cba1561b523292279d7986d4eff9f9c))
* unable to add editor presets as runtime presets to project settings ([726bb10](https://github.com/mob-sakai/UIEffect/commit/726bb100a0ad327619634ea73ccdccc36276d0d0)), closes [#330](https://github.com/mob-sakai/UIEffect/issues/330)
### Features
* add `DetailColor` property ([30bf783](https://github.com/mob-sakai/UIEffect/commit/30bf783320398d68b90b09b0dcf93738b4683e00)), closes [#332](https://github.com/mob-sakai/UIEffect/issues/332)
* ScriptableObject based preset system ([f8682f3](https://github.com/mob-sakai/UIEffect/commit/f8682f3c9889fb56ff3cd9010934f998e121553a)), closes [#333](https://github.com/mob-sakai/UIEffect/issues/333)
# [5.7.0](https://github.com/mob-sakai/UIEffect/compare/5.6.4...5.7.0) (2025-04-11)
+17 -579
View File
@@ -2,7 +2,6 @@
using UnityEngine;
using System.Linq;
using System;
using System.Reflection;
using Object = UnityEngine.Object;
namespace Coffee.UIEffects.Editors
@@ -12,109 +11,16 @@ namespace Coffee.UIEffects.Editors
/// </summary>
[CustomEditor(typeof(UIEffect), true)]
[CanEditMultipleObjects]
public class UIEffectEditor : Editor
public class UIEffectEditor : UIEffectPropertyEditor
{
private class UIEffectEditorSettings : ScriptableSingleton<UIEffectEditorSettings>
{
public bool m_ExpandOthers = true;
}
private static readonly PropertyInfo s_PiGradient = typeof(SerializedProperty)
.GetProperty("gradientValue", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
private static readonly Func<SerializedProperty, Gradient> s_GetGradient =
(Func<SerializedProperty, Gradient>)Delegate.CreateDelegate(typeof(Func<SerializedProperty, Gradient>),
s_PiGradient.GetMethod);
private static readonly Action<SerializedProperty, Gradient> s_SetGradient =
(Action<SerializedProperty, Gradient>)Delegate.CreateDelegate(typeof(Action<SerializedProperty, Gradient>),
s_PiGradient.SetMethod);
private SerializedProperty _toneFilter;
private SerializedProperty _toneIntensity;
private SerializedProperty _colorFilter;
private SerializedProperty _color;
private SerializedProperty _colorIntensity;
private SerializedProperty _colorGlow;
private SerializedProperty _samplingFilter;
private SerializedProperty _samplingIntensity;
private SerializedProperty _samplingWidth;
private SerializedProperty _samplingScale;
private SerializedProperty _transitionFilter;
private SerializedProperty _transitionRate;
private SerializedProperty _transitionTex;
private SerializedProperty _transitionTexScale;
private SerializedProperty _transitionTexOffset;
private SerializedProperty _transitionTexSpeed;
private SerializedProperty _transitionReverse;
private SerializedProperty _transitionRotation;
private SerializedProperty _transitionKeepAspectRatio;
private SerializedProperty _transitionWidth;
private SerializedProperty _transitionSoftness;
private SerializedProperty _transitionRange;
private SerializedProperty _transitionColorFilter;
private SerializedProperty _transitionColor;
private SerializedProperty _transitionColorGlow;
private SerializedProperty _transitionPatternReverse;
private SerializedProperty _transitionAutoPlaySpeed;
private SerializedProperty _targetMode;
private SerializedProperty _targetColor;
private SerializedProperty _targetRange;
private SerializedProperty _targetSoftness;
private SerializedProperty _blendType;
private SerializedProperty _srcBlendMode;
private SerializedProperty _dstBlendMode;
private SerializedProperty _shadowMode;
private SerializedProperty _shadowDistance;
private SerializedProperty _shadowDistanceX;
private SerializedProperty _shadowDistanceY;
private SerializedProperty _shadowIteration;
private SerializedProperty _shadowFade;
private SerializedProperty _shadowMirrorScale;
private SerializedProperty _shadowBlurIntensity;
private SerializedProperty _shadowColorFilter;
private SerializedProperty _shadowColor;
private SerializedProperty _shadowColorGlow;
private SerializedProperty _gradationMode;
private SerializedProperty _gradationIntensity;
private SerializedProperty _gradationColorFilter;
private SerializedProperty _gradationColor1;
private SerializedProperty _gradationColor2;
private SerializedProperty _gradationColor3;
private SerializedProperty _gradationColor4;
private SerializedProperty _gradationGradient;
private SerializedProperty _gradationOffset;
private SerializedProperty _gradationScale;
private SerializedProperty _gradationRotation;
private SerializedProperty _edgeMode;
private SerializedProperty _edgeWidth;
private SerializedProperty _edgeColorFilter;
private SerializedProperty _edgeColor;
private SerializedProperty _edgeColorGlow;
private SerializedProperty _edgeShinyRate;
private SerializedProperty _edgeShinyWidth;
private SerializedProperty _edgeShinyAutoPlaySpeed;
private SerializedProperty _patternArea;
private SerializedProperty _detailFilter;
private SerializedProperty _detailIntensity;
private SerializedProperty _detailThreshold;
private SerializedProperty _detailTex;
private SerializedProperty _detailTexScale;
private SerializedProperty _detailTexOffset;
private SerializedProperty _detailTexSpeed;
private SerializedProperty _allowToModifyMeshShape;
private SerializedProperty _customRoot;
private SerializedProperty _flip;
private static bool expandOthers
{
@@ -122,358 +28,27 @@ namespace Coffee.UIEffects.Editors
get => UIEffectEditorSettings.instance.m_ExpandOthers;
}
private void OnEnable()
protected override void OnEnable()
{
if (target == null) return;
base.OnEnable();
_toneFilter = serializedObject.FindProperty("m_ToneFilter");
_toneIntensity = serializedObject.FindProperty("m_ToneIntensity");
_colorFilter = serializedObject.FindProperty("m_ColorFilter");
_color = serializedObject.FindProperty("m_Color");
_colorIntensity = serializedObject.FindProperty("m_ColorIntensity");
_colorGlow = serializedObject.FindProperty("m_ColorGlow");
_samplingFilter = serializedObject.FindProperty("m_SamplingFilter");
_samplingIntensity = serializedObject.FindProperty("m_SamplingIntensity");
_samplingWidth = serializedObject.FindProperty("m_SamplingWidth");
_samplingScale = serializedObject.FindProperty("m_SamplingScale");
_transitionFilter = serializedObject.FindProperty("m_TransitionFilter");
_transitionRate = serializedObject.FindProperty("m_TransitionRate");
_transitionTex = serializedObject.FindProperty("m_TransitionTex");
_transitionTexScale = serializedObject.FindProperty("m_TransitionTexScale");
_transitionTexOffset = serializedObject.FindProperty("m_TransitionTexOffset");
_transitionTexSpeed = serializedObject.FindProperty("m_TransitionTexSpeed");
_transitionReverse = serializedObject.FindProperty("m_TransitionReverse");
_transitionRotation = serializedObject.FindProperty("m_TransitionRotation");
_transitionKeepAspectRatio = serializedObject.FindProperty("m_TransitionKeepAspectRatio");
_transitionWidth = serializedObject.FindProperty("m_TransitionWidth");
_transitionSoftness = serializedObject.FindProperty("m_TransitionSoftness");
_transitionRange = serializedObject.FindProperty("m_TransitionRange");
_transitionColorFilter = serializedObject.FindProperty("m_TransitionColorFilter");
_transitionColor = serializedObject.FindProperty("m_TransitionColor");
_transitionColorGlow = serializedObject.FindProperty("m_TransitionColorGlow");
_transitionPatternReverse = serializedObject.FindProperty("m_TransitionPatternReverse");
_transitionAutoPlaySpeed = serializedObject.FindProperty("m_TransitionAutoPlaySpeed");
_targetMode = serializedObject.FindProperty("m_TargetMode");
_targetColor = serializedObject.FindProperty("m_TargetColor");
_targetRange = serializedObject.FindProperty("m_TargetRange");
_targetSoftness = serializedObject.FindProperty("m_TargetSoftness");
_blendType = serializedObject.FindProperty("m_BlendType");
_srcBlendMode = serializedObject.FindProperty("m_SrcBlendMode");
_dstBlendMode = serializedObject.FindProperty("m_DstBlendMode");
_shadowMode = serializedObject.FindProperty("m_ShadowMode");
_shadowDistance = serializedObject.FindProperty("m_ShadowDistance");
_shadowDistanceX = _shadowDistance.FindPropertyRelative("x");
_shadowDistanceY = _shadowDistance.FindPropertyRelative("y");
_shadowIteration = serializedObject.FindProperty("m_ShadowIteration");
_shadowFade = serializedObject.FindProperty("m_ShadowFade");
_shadowMirrorScale = serializedObject.FindProperty("m_ShadowMirrorScale");
_shadowBlurIntensity = serializedObject.FindProperty("m_ShadowBlurIntensity");
_shadowColorFilter = serializedObject.FindProperty("m_ShadowColorFilter");
_shadowColor = serializedObject.FindProperty("m_ShadowColor");
_shadowColorGlow = serializedObject.FindProperty("m_ShadowColorGlow");
_edgeMode = serializedObject.FindProperty("m_EdgeMode");
_edgeWidth = serializedObject.FindProperty("m_EdgeWidth");
_edgeColorFilter = serializedObject.FindProperty("m_EdgeColorFilter");
_edgeColor = serializedObject.FindProperty("m_EdgeColor");
_edgeColorGlow = serializedObject.FindProperty("m_EdgeColorGlow");
_edgeShinyRate = serializedObject.FindProperty("m_EdgeShinyRate");
_edgeShinyWidth = serializedObject.FindProperty("m_EdgeShinyWidth");
_edgeShinyAutoPlaySpeed = serializedObject.FindProperty("m_EdgeShinyAutoPlaySpeed");
_patternArea = serializedObject.FindProperty("m_PatternArea");
_gradationMode = serializedObject.FindProperty("m_GradationMode");
_gradationIntensity = serializedObject.FindProperty("m_GradationIntensity");
_gradationColorFilter = serializedObject.FindProperty("m_GradationColorFilter");
_gradationColor1 = serializedObject.FindProperty("m_GradationColor1");
_gradationColor2 = serializedObject.FindProperty("m_GradationColor2");
_gradationColor3 = serializedObject.FindProperty("m_GradationColor3");
_gradationColor4 = serializedObject.FindProperty("m_GradationColor4");
_gradationGradient = serializedObject.FindProperty("m_GradationGradient");
_gradationOffset = serializedObject.FindProperty("m_GradationOffset");
_gradationScale = serializedObject.FindProperty("m_GradationScale");
_gradationRotation = serializedObject.FindProperty("m_GradationRotation");
_detailFilter = serializedObject.FindProperty("m_DetailFilter");
_detailIntensity = serializedObject.FindProperty("m_DetailIntensity");
_detailThreshold = serializedObject.FindProperty("m_DetailThreshold");
_detailTex = serializedObject.FindProperty("m_DetailTex");
_detailTexScale = serializedObject.FindProperty("m_DetailTexScale");
_detailTexOffset = serializedObject.FindProperty("m_DetailTexOffset");
_detailTexSpeed = serializedObject.FindProperty("m_DetailTexSpeed");
_allowToModifyMeshShape = serializedObject.FindProperty("m_AllowToModifyMeshShape");
_customRoot = serializedObject.FindProperty("m_CustomRoot");
_flip = serializedObject.FindProperty("m_Flip");
}
public override void OnInspectorGUI()
{
serializedObject.Update();
// Preset
DrawPresetMenu(targets);
DrawSeparator();
// Properties
DrawProperties();
serializedObject.ApplyModifiedProperties();
}
public void DrawProperties()
{
// Tone filter
if (DrawHeaderPopup(_toneFilter))
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_toneIntensity);
EditorGUI.indentLevel--;
}
// Color filter
DrawSeparator();
var prevColorFilter = (ColorFilter)_colorFilter.intValue;
if (DrawHeaderPopup(_colorFilter))
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_colorIntensity);
DrawColor(_color, (ColorFilter)_colorFilter.intValue, prevColorFilter, false);
EditorGUILayout.PropertyField(_colorGlow);
EditorGUI.indentLevel--;
}
EditorGUI.EndChangeCheck();
// Sampling filter
DrawSeparator();
if (DrawHeaderPopup(_samplingFilter))
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_samplingIntensity);
if (_samplingFilter.intValue == (int)SamplingFilter.EdgeAlpha
|| _samplingFilter.intValue == (int)SamplingFilter.EdgeLuminance)
{
EditorGUILayout.PropertyField(_samplingWidth);
}
EditorGUI.indentLevel--;
}
// Transition filter
DrawSeparator();
if (DrawHeaderPopup(_transitionFilter))
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_transitionRate);
EditorGUILayout.PropertyField(_transitionTex);
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_transitionTexScale, EditorGUIUtility.TrTempContent("Scale"));
EditorGUILayout.PropertyField(_transitionTexOffset, EditorGUIUtility.TrTempContent("Offset"));
EditorGUILayout.PropertyField(_transitionTexSpeed, EditorGUIUtility.TrTempContent("Speed"));
if (_transitionTexSpeed.vector2Value != Vector2.zero)
{
EditorApplication.QueuePlayerLoopUpdate();
}
EditorGUILayout.PropertyField(_transitionRotation, EditorGUIUtility.TrTempContent("Rotation"));
EditorGUILayout.PropertyField(_transitionKeepAspectRatio,
EditorGUIUtility.TrTempContent("Keep Aspect Ratio"));
EditorGUILayout.PropertyField(_transitionReverse, EditorGUIUtility.TrTempContent("Reverse"));
EditorGUI.indentLevel--;
if (_transitionFilter.intValue == (int)TransitionFilter.Pattern)
{
EditorGUILayout.PropertyField(_transitionWidth, EditorGUIUtility.TrTempContent("Pattern Size"));
EditorGUILayout.PropertyField(_transitionRange, EditorGUIUtility.TrTempContent("Pattern Range"));
EditorGUILayout.PropertyField(_transitionPatternReverse,
EditorGUIUtility.TrTempContent("Pattern Reverse"));
DrawColor(_transitionColorFilter, _transitionColor, null);
}
else if (2 < _transitionFilter.intValue)
{
EditorGUILayout.PropertyField(_transitionWidth);
EditorGUILayout.PropertyField(_transitionSoftness);
DrawColor(_transitionColorFilter, _transitionColor, _transitionColorGlow);
}
EditorGUILayout.PropertyField(_transitionAutoPlaySpeed);
if (0 < _transitionFilter.intValue && !Mathf.Approximately(0, _transitionAutoPlaySpeed.floatValue))
{
EditorApplication.QueuePlayerLoopUpdate();
}
EditorGUI.indentLevel--;
}
// Target
DrawSeparator();
if (DrawHeaderPopup(_targetMode))
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_targetColor);
EditorGUILayout.PropertyField(_targetRange);
EditorGUILayout.PropertyField(_targetSoftness);
EditorGUI.indentLevel--;
}
// Blending
DrawSeparator();
if (!DrawHeaderPopup(_blendType))
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_srcBlendMode);
EditorGUILayout.PropertyField(_dstBlendMode);
EditorGUI.indentLevel--;
}
// Shadow
DrawSeparator();
var prevShadowMode = (ShadowMode)_shadowMode.intValue;
if (DrawHeaderPopup(_shadowMode))
{
EditorGUI.indentLevel++;
if ((ShadowMode)_shadowMode.intValue == ShadowMode.Mirror)
{
if (prevShadowMode != ShadowMode.Mirror)
{
_shadowDistanceX.floatValue = 0.5f;
_shadowDistanceY.floatValue = 0f;
}
EditorGUILayout.Slider(_shadowDistanceX, 0, 1, "Reflection");
EditorGUILayout.PropertyField(_shadowDistanceY, EditorGUIUtility.TrTempContent("Offset"));
EditorGUILayout.PropertyField(_shadowMirrorScale);
EditorGUILayout.PropertyField(_shadowFade);
}
else
{
if (prevShadowMode == ShadowMode.Mirror)
{
_shadowDistanceX.floatValue = 1f;
_shadowDistanceY.floatValue = -1f;
}
EditorGUILayout.PropertyField(_shadowDistance);
EditorGUILayout.PropertyField(_shadowIteration);
DrawColor(_shadowColorFilter, _shadowColor, _shadowColorGlow, false);
EditorGUILayout.PropertyField(_shadowFade);
}
// Shadow blur intensity
switch ((SamplingFilter)_samplingFilter.intValue)
{
case SamplingFilter.BlurFast:
case SamplingFilter.BlurMedium:
case SamplingFilter.BlurDetail:
EditorGUILayout.PropertyField(_shadowBlurIntensity);
break;
}
EditorGUI.indentLevel--;
}
// Gradient
DrawSeparator();
if (DrawHeaderPopup(_gradationMode))
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_gradationColorFilter);
switch ((GradationMode)_gradationMode.intValue)
{
case GradationMode.HorizontalGradient:
case GradationMode.VerticalGradient:
case GradationMode.AngleGradient:
DrawGradientField(_gradationGradient);
break;
case GradationMode.Diagonal:
DrawColorPickerField("Top", _gradationColor1, _gradationColor2);
DrawColorPickerField("Bottom", _gradationColor3, _gradationColor4);
break;
default:
DrawColorPickerField(EditorGUILayout.GetControlRect(), _gradationColor1, true);
var r = EditorGUILayout.GetControlRect();
r.width -= 24;
DrawColorPickerField(r, _gradationColor2, true);
r.x += r.width + 4;
r.width = 20;
SwapColorsButton(r, _gradationColor1, _gradationColor2);
break;
}
EditorGUILayout.PropertyField(_gradationIntensity);
EditorGUILayout.PropertyField(_gradationOffset);
EditorGUILayout.PropertyField(_gradationScale);
if ((GradationMode)_gradationMode.intValue == GradationMode.Angle
|| (GradationMode)_gradationMode.intValue == GradationMode.AngleGradient)
{
EditorGUILayout.PropertyField(_gradationRotation);
}
EditorGUILayout.PropertyField(_transitionKeepAspectRatio,
EditorGUIUtility.TrTempContent("Keep Aspect Ratio"));
EditorGUI.indentLevel--;
}
// Edge Mode
DrawSeparator();
if (DrawHeaderPopup(_edgeMode))
{
EditorGUILayout.PropertyField(_edgeWidth);
DrawColor(_edgeColorFilter, _edgeColor, _edgeColorGlow);
if ((EdgeMode)_edgeMode.intValue == EdgeMode.Shiny)
{
EditorGUILayout.PropertyField(_edgeShinyRate);
EditorGUILayout.PropertyField(_edgeShinyWidth);
EditorGUILayout.PropertyField(_edgeShinyAutoPlaySpeed);
if (!Mathf.Approximately(0, _edgeShinyAutoPlaySpeed.floatValue))
{
EditorApplication.QueuePlayerLoopUpdate();
}
}
if (_transitionFilter.intValue == (int)TransitionFilter.Pattern)
{
EditorGUILayout.PropertyField(_patternArea);
}
}
// Detail filter
DrawSeparator();
if (DrawHeaderPopup(_detailFilter))
{
EditorGUI.indentLevel++;
if ((DetailFilter)_detailFilter.intValue == DetailFilter.Masking)
{
EditorGUILayout.PropertyField(_detailThreshold);
}
else
{
EditorGUILayout.PropertyField(_detailIntensity);
}
EditorGUILayout.PropertyField(_detailTex);
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_detailTexScale, EditorGUIUtility.TrTempContent("Scale"));
EditorGUILayout.PropertyField(_detailTexOffset, EditorGUIUtility.TrTempContent("Offset"));
EditorGUILayout.PropertyField(_detailTexSpeed, EditorGUIUtility.TrTempContent("Speed"));
if (_detailTexSpeed.vector2Value != Vector2.zero)
{
EditorApplication.QueuePlayerLoopUpdate();
}
EditorGUILayout.PropertyField(_transitionRotation, EditorGUIUtility.TrTempContent("Rotation"));
EditorGUILayout.PropertyField(_transitionKeepAspectRatio,
EditorGUIUtility.TrTempContent("Keep Aspect Ratio"));
EditorGUI.indentLevel--;
EditorGUI.indentLevel--;
}
// Others
DrawSeparator();
expandOthers = EditorGUILayout.BeginFoldoutHeaderGroup(expandOthers, "Others");
if (expandOthers)
@@ -481,143 +56,11 @@ namespace Coffee.UIEffects.Editors
EditorGUILayout.PropertyField(_samplingScale);
EditorGUILayout.PropertyField(_allowToModifyMeshShape);
EditorGUILayout.PropertyField(_customRoot);
EditorGUILayout.PropertyField(_flip);
}
}
private static void DrawColorPickerField(string label, SerializedProperty color1, SerializedProperty color2)
{
var labelWidth = EditorGUIUtility.labelWidth;
var r = EditorGUILayout.GetControlRect();
r.width -= 24;
EditorGUI.PrefixLabel(new Rect(r.x, r.y, labelWidth, r.height), EditorGUIUtility.TrTempContent(label));
var indentLevel = EditorGUI.indentLevel;
EditorGUI.indentLevel = 0;
var rPos = new Rect(r.x + labelWidth, r.y, (r.width - labelWidth) / 2, r.height);
DrawColorPickerField(rPos, GUIContent.none, color1, true);
rPos.x += rPos.width;
DrawColorPickerField(rPos, GUIContent.none, color2, true);
// Swap colors button
SwapColorsButton(new Rect(r.x + r.width + 4, r.y, 20, 20), color1, color2);
EditorGUI.indentLevel = indentLevel;
}
private static void DrawColorPickerField(Rect rect, SerializedProperty color, bool showAlpha)
{
var label = EditorGUIUtility.TrTempContent(color.displayName);
label.tooltip = color.tooltip;
DrawColorPickerField(rect, label, color, showAlpha);
}
private static void DrawColorPickerField(Rect rect, GUIContent label, SerializedProperty color, bool showAlpha)
{
var hdr = UIEffectProjectSettings.useHdrColorPicker;
EditorGUI.showMixedValue = color.hasMultipleDifferentValues;
EditorGUI.BeginChangeCheck();
var colorValue = EditorGUI.ColorField(rect, label, color.colorValue, true, showAlpha, hdr);
if (EditorGUI.EndChangeCheck())
{
color.colorValue = colorValue;
}
}
private static void DrawGradientField(SerializedProperty gradient)
{
var r = EditorGUILayout.GetControlRect();
var label = EditorGUIUtility.TrTempContent(gradient.displayName);
label.tooltip = gradient.tooltip;
var hdr = UIEffectProjectSettings.useHdrColorPicker;
EditorGUI.showMixedValue = gradient.hasMultipleDifferentValues;
EditorGUI.BeginChangeCheck();
var gradientValue = EditorGUI.GradientField(r, label, s_GetGradient(gradient), hdr);
if (EditorGUI.EndChangeCheck())
{
s_SetGradient(gradient, gradientValue);
}
}
private static void DrawColor(SerializedProperty color, ColorFilter filter, ColorFilter prevFilter,
bool showAlpha = true)
{
if (filter == ColorFilter.None) return;
if (filter == ColorFilter.HsvModifier)
{
if (prevFilter != ColorFilter.HsvModifier)
{
color.colorValue = Color.black;
}
EditorGUILayout.Slider(color.FindPropertyRelative("r"), -0.5f, 0.5f, "Hue");
EditorGUILayout.Slider(color.FindPropertyRelative("g"), -1f, 1f, "Saturation");
EditorGUILayout.Slider(color.FindPropertyRelative("b"), -1f, 1f, "Value");
EditorGUILayout.Slider(color.FindPropertyRelative("a"), 0, 1, "Alpha");
}
else if (filter == ColorFilter.Contrast)
{
if (prevFilter != ColorFilter.Contrast)
{
color.colorValue = Color.black;
}
EditorGUILayout.Slider(color.FindPropertyRelative("r"), -1f, 1f, "Contrast");
EditorGUILayout.Slider(color.FindPropertyRelative("g"), -1f, 1f, "Brightness");
EditorGUILayout.Slider(color.FindPropertyRelative("a"), 0, 1, "Alpha");
}
else
{
if (prevFilter == ColorFilter.HsvModifier || prevFilter == ColorFilter.Contrast)
{
color.colorValue = Color.white;
}
DrawColorPickerField(EditorGUILayout.GetControlRect(), color, showAlpha);
}
}
private static void DrawColor(SerializedProperty filter, SerializedProperty color, SerializedProperty glow,
bool showAlpha = true)
{
var prevFilter = (ColorFilter)filter.intValue;
EditorGUILayout.PropertyField(filter);
if (filter.intValue == (int)ColorFilter.None) return;
EditorGUI.indentLevel++;
DrawColor(color, (ColorFilter)filter.intValue, prevFilter, showAlpha);
if (glow != null)
{
EditorGUILayout.PropertyField(glow);
}
EditorGUI.indentLevel--;
}
EditorGUILayout.EndFoldoutHeaderGroup();
private static void SwapColorsButton(Rect rect, SerializedProperty color1, SerializedProperty color2)
{
if (GUI.Button(rect, EditorGUIUtility.IconContent("preaudioloopoff"), "iconbutton"))
{
(color1.colorValue, color2.colorValue) = (color2.colorValue, color1.colorValue);
}
}
private static bool DrawHeaderPopup(SerializedProperty sp)
{
var r = EditorGUILayout.GetControlRect();
var pos = EditorGUI.PrefixLabel(r, EditorGUIUtility.TrTempContent(sp.displayName), EditorStyles.boldLabel);
EditorGUI.PropertyField(pos, sp, GUIContent.none);
return 0 < sp.intValue;
}
private static void DrawSeparator()
{
EditorGUILayout.Space(4);
GUILayout.Label(GUIContent.none, "sv_iconselector_sep", GUILayout.ExpandWidth(true));
serializedObject.ApplyModifiedProperties();
}
private static void DrawPresetMenu(Object[] targets)
@@ -676,28 +119,23 @@ namespace Coffee.UIEffects.Editors
}
}
public static void DropDownPreset(Rect r, Predicate<(string path, bool builtin, UIEffect preset)> valid,
Action<UIEffect> callback)
public static void DropDownPreset(Rect r, Predicate<(string path, bool builtin, UIEffectPreset preset)> valid,
Action<UIEffectPreset> callback)
{
var menu = new GenericMenu();
var separatorAdded = false;
foreach (var preset in UIEffectProjectSettings.LoadEditorPresets())
foreach (var preset in UIEffectProjectSettings.LoadEditorPresetsV2())
{
var (path, builtin) = UIEffectProjectSettings.GetPresetPath(preset);
if (valid != null && valid.Invoke((path, builtin, preset)) == false) continue;
if (builtin)
if (builtin && !separatorAdded)
{
if (!separatorAdded)
{
separatorAdded = true;
menu.AddSeparator(string.Empty);
}
path = path.Substring(6).Replace(" - ", "/");
separatorAdded = true;
menu.AddSeparator(string.Empty);
}
menu.AddItem(new GUIContent(path), false, x => callback(x as UIEffect), preset);
menu.AddItem(new GUIContent(path.Replace("-", "/")), false, x => callback(x as UIEffectPreset), preset);
}
menu.DropDown(r);
@@ -0,0 +1,13 @@
using UnityEditor;
namespace Coffee.UIEffects.Editors
{
/// <summary>
/// UIEffect editor.
/// </summary>
[CustomEditor(typeof(UIEffectPreset), true)]
[CanEditMultipleObjects]
public class UIEffectPresetEditor : UIEffectPropertyEditor
{
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 60b661e9d7501483dbd6b02ffa399405
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,4 +1,8 @@
using UnityEditor;
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using UnityEditor;
using UnityEngine;
using Coffee.UIEffectInternal;
using UnityEditorInternal;
@@ -9,24 +13,29 @@ namespace Coffee.UIEffects.Editors
public class UIEffectProjectSettingsEditor : Editor
{
private ReorderableList _reorderableList;
private SerializedProperty _runtimePresets;
private SerializedProperty _runtimePresetsV2;
private SerializedProperty _useHDRColorPicker;
private SerializedProperty _transformSensitivity;
private bool _isInitialized;
private ShaderVariantRegistryEditor _shaderVariantRegistryEditor;
private UIEffect[] _legacyPresets;
private bool _expandRuntimePresets;
private bool _expandLegacyPrefabs;
private void InitializeIfNeeded()
{
if (_isInitialized) return;
_transformSensitivity = serializedObject.FindProperty("m_TransformSensitivity");
_useHDRColorPicker = serializedObject.FindProperty("m_UseHDRColorPicker");
var runtimePresets = serializedObject.FindProperty("m_RuntimePresets");
_reorderableList = new ReorderableList(serializedObject, runtimePresets, true, true, true, true);
_runtimePresets = serializedObject.FindProperty("m_RuntimePresets");
_runtimePresetsV2 = serializedObject.FindProperty("m_RuntimePresetsV2");
_reorderableList = new ReorderableList(serializedObject, _runtimePresetsV2, true, true, true, true);
_reorderableList.drawHeaderCallback = rect => EditorGUI.LabelField(rect, "Runtime Presets");
_reorderableList.drawElementCallback = (rect, index, isActive, isFocused) =>
{
var element = _reorderableList.serializedProperty.GetArrayElementAtIndex(index);
var effect = element.objectReferenceValue as UIEffect;
var effect = element.objectReferenceValue as UIEffectPreset;
rect.y += 2;
rect.height = EditorGUIUtility.singleLineHeight;
@@ -37,13 +46,18 @@ namespace Coffee.UIEffects.Editors
_reorderableList.onAddDropdownCallback = (rect, list) =>
{
UIEffectEditor.DropDownPreset(rect,
x => !x.builtin && !UIEffectProjectSettings.instance.m_RuntimePresets.Contains(x.preset),
x => !UIEffectProjectSettings.instance.m_RuntimePresetsV2.Contains(x.preset),
UIEffectProjectSettings.RegisterRuntimePreset);
};
_isInitialized = true;
}
private void OnEnable()
{
_legacyPresets = UIEffectProjectSettings.LoadEditorPresets();
}
private void OnDisable()
{
_isInitialized = false;
@@ -55,12 +69,12 @@ namespace Coffee.UIEffects.Editors
InitializeIfNeeded();
// Settings
// Transform sensitivity.
EditorGUILayout.PropertyField(_transformSensitivity);
// Runtime Presets
_reorderableList.DoLayoutList();
// Legacy Presets
DrawLegacyPresets();
// Editor
// Use HDR color pickers.
EditorGUILayout.PropertyField(_useHDRColorPicker);
@@ -84,5 +98,118 @@ namespace Coffee.UIEffects.Editors
GUILayout.FlexibleSpace();
serializedObject.ApplyModifiedProperties();
}
private void DrawLegacyPresets()
{
for (var i = _runtimePresets.arraySize - 1; 0 <= i; i--)
{
if (!_runtimePresets.GetArrayElementAtIndex(i).objectReferenceValue)
{
_runtimePresets.DeleteArrayElementAtIndex(i);
}
}
if (_legacyPresets.Length == 0 && _runtimePresets.arraySize == 0) return;
EditorGUILayout.BeginVertical(EditorStyles.helpBox);
var title = EditorGUIUtility.TrTextContent("Legacy Presets (Obsolete)", "", "warning");
EditorGUILayout.LabelField(title,
EditorStyles.boldLabel);
_expandRuntimePresets = EditorGUILayout.Foldout(_expandRuntimePresets,
$"Legacy Runtime Presets ({_runtimePresets.arraySize})");
if (_expandRuntimePresets)
{
EditorGUI.BeginDisabledGroup(true);
EditorGUI.indentLevel++;
for (var i = 0; i < _runtimePresets.arraySize; i++)
{
EditorGUILayout.PropertyField(_runtimePresets.GetArrayElementAtIndex(i), GUIContent.none);
}
EditorGUI.indentLevel--;
EditorGUI.EndDisabledGroup();
}
_expandLegacyPrefabs = EditorGUILayout.Foldout(_expandLegacyPrefabs,
$"Legacy Preset Prefabs ({_legacyPresets.Length})");
if (_expandLegacyPrefabs)
{
EditorGUI.BeginDisabledGroup(true);
EditorGUI.indentLevel++;
foreach (var legacyPreset in _legacyPresets)
{
EditorGUILayout.ObjectField(legacyPreset, typeof(UIEffect), false);
}
EditorGUI.indentLevel--;
EditorGUI.EndDisabledGroup();
}
EditorGUILayout.TextArea(
"The prefab based presets system is obsolete.\n" +
"In the new preset system, UIEffectPreset assets are used.\n" +
"Click the button below to convert your legacy preset prefabs into UIEffectPreset assets.\n" +
"The UIEffectPreset asset will be saved in the same directory as the prefab, using the same name.\n" +
"You can load the new preset via the UIEffect.LoadPreset method.",
EditorStyles.miniLabel);
if (GUILayout.Button(EditorGUIUtility.TrTempContent("Convert All Legacy Presets in the Project")))
{
ConvertAllLegacyPresets();
_runtimePresets.ClearArray();
}
if (GUILayout.Button(EditorGUIUtility.TrTempContent("Delete All Legacy Presets in the Project")))
{
foreach (var legacyPreset in _legacyPresets)
{
AssetDatabase.DeleteAsset(AssetDatabase.GetAssetPath(legacyPreset));
}
_runtimePresets.ClearArray();
_legacyPresets = Array.Empty<UIEffect>();
}
EditorGUILayout.EndVertical();
}
private void ConvertAllLegacyPresets()
{
var length = _legacyPresets.Length;
var converted = new HashSet<string>(UIEffectProjectSettings.LoadEditorPresetsV2()
.Select(x => Path.ChangeExtension(AssetDatabase.GetAssetPath(x), ".prefab")));
for (var i = 0; i < length; i++)
{
var preset = _legacyPresets[i];
var path = AssetDatabase.GetAssetPath(preset);
if (converted.Contains(path)) continue;
EditorUtility.DisplayProgressBar("Convert To UIEffectPreset", path, (float)i / length);
var newPath = Path.ChangeExtension(path, ".asset");
newPath = AssetDatabase.GenerateUniqueAssetPath(newPath);
var newPreset = CreateInstance<UIEffectPreset>();
preset.SavePreset(newPreset, false);
newPreset.hideFlags = preset.hideFlags;
AssetDatabase.CreateAsset(newPreset, newPath);
var importer = AssetImporter.GetAtPath(path);
var newImporter = AssetImporter.GetAtPath(newPath);
newImporter.userData = importer.userData;
newImporter.SetAssetBundleNameAndVariant(importer.assetBundleName, importer.assetBundleVariant);
newImporter.SaveAndReimport();
// Remove the legacy preset from the project settings and add the new preset.
if (UIEffectProjectSettings.instance.m_RuntimePresets.Contains(preset))
{
var count = _runtimePresetsV2.arraySize;
_runtimePresetsV2.InsertArrayElementAtIndex(count);
_runtimePresetsV2.GetArrayElementAtIndex(count).objectReferenceValue = newPreset;
}
}
EditorUtility.ClearProgressBar();
}
}
}
@@ -0,0 +1,594 @@
using UnityEditor;
using UnityEngine;
using System;
using System.Reflection;
namespace Coffee.UIEffects.Editors
{
public abstract class UIEffectPropertyEditor : Editor
{
private static readonly PropertyInfo s_PiGradient = typeof(SerializedProperty)
.GetProperty("gradientValue", BindingFlags.Public | BindingFlags.NonPublic | BindingFlags.Instance);
private static readonly Func<SerializedProperty, Gradient> s_GetGradient =
(Func<SerializedProperty, Gradient>)Delegate.CreateDelegate(typeof(Func<SerializedProperty, Gradient>),
s_PiGradient.GetMethod);
private static readonly Action<SerializedProperty, Gradient> s_SetGradient =
(Action<SerializedProperty, Gradient>)Delegate.CreateDelegate(typeof(Action<SerializedProperty, Gradient>),
s_PiGradient.SetMethod);
private SerializedProperty _toneFilter;
private SerializedProperty _toneIntensity;
private SerializedProperty _colorFilter;
private SerializedProperty _color;
private SerializedProperty _colorIntensity;
private SerializedProperty _colorGlow;
private SerializedProperty _samplingFilter;
private SerializedProperty _samplingIntensity;
private SerializedProperty _samplingWidth;
private SerializedProperty _transitionFilter;
private SerializedProperty _transitionRate;
private SerializedProperty _transitionTex;
private SerializedProperty _transitionTexScale;
private SerializedProperty _transitionTexOffset;
private SerializedProperty _transitionTexSpeed;
private SerializedProperty _transitionReverse;
private SerializedProperty _transitionRotation;
private SerializedProperty _transitionKeepAspectRatio;
private SerializedProperty _transitionWidth;
private SerializedProperty _transitionSoftness;
private SerializedProperty _transitionRange;
private SerializedProperty _transitionColorFilter;
private SerializedProperty _transitionColor;
private SerializedProperty _transitionColorGlow;
private SerializedProperty _transitionPatternReverse;
private SerializedProperty _transitionAutoPlaySpeed;
private SerializedProperty _targetMode;
private SerializedProperty _targetColor;
private SerializedProperty _targetRange;
private SerializedProperty _targetSoftness;
private SerializedProperty _blendType;
private SerializedProperty _srcBlendMode;
private SerializedProperty _dstBlendMode;
private SerializedProperty _shadowMode;
private SerializedProperty _shadowDistance;
private SerializedProperty _shadowDistanceX;
private SerializedProperty _shadowDistanceY;
private SerializedProperty _shadowIteration;
private SerializedProperty _shadowFade;
private SerializedProperty _shadowMirrorScale;
private SerializedProperty _shadowBlurIntensity;
private SerializedProperty _shadowColorFilter;
private SerializedProperty _shadowColor;
private SerializedProperty _shadowColorGlow;
private SerializedProperty _gradationMode;
private SerializedProperty _gradationIntensity;
private SerializedProperty _gradationColorFilter;
private SerializedProperty _gradationColor1;
private SerializedProperty _gradationColor2;
private SerializedProperty _gradationColor3;
private SerializedProperty _gradationColor4;
private SerializedProperty _gradationGradient;
private SerializedProperty _gradationOffset;
private SerializedProperty _gradationScale;
private SerializedProperty _gradationRotation;
private SerializedProperty _edgeMode;
private SerializedProperty _edgeWidth;
private SerializedProperty _edgeColorFilter;
private SerializedProperty _edgeColor;
private SerializedProperty _edgeColorGlow;
private SerializedProperty _edgeShinyRate;
private SerializedProperty _edgeShinyWidth;
private SerializedProperty _edgeShinyAutoPlaySpeed;
private SerializedProperty _patternArea;
private SerializedProperty _detailFilter;
private SerializedProperty _detailIntensity;
private SerializedProperty _detailColor;
private SerializedProperty _detailThreshold;
private SerializedProperty _detailTex;
private SerializedProperty _detailTexScale;
private SerializedProperty _detailTexOffset;
private SerializedProperty _detailTexSpeed;
private SerializedProperty _flip;
private static GUIContent s_RotationLabel = new GUIContent("* Rotation");
private static GUIContent s_KeepAspectRatioLabel = new GUIContent("* Keep Aspect Ratio");
protected virtual void OnEnable()
{
_toneFilter = serializedObject.FindProperty("m_ToneFilter");
_toneIntensity = serializedObject.FindProperty("m_ToneIntensity");
_colorFilter = serializedObject.FindProperty("m_ColorFilter");
_color = serializedObject.FindProperty("m_Color");
_colorIntensity = serializedObject.FindProperty("m_ColorIntensity");
_colorGlow = serializedObject.FindProperty("m_ColorGlow");
_samplingFilter = serializedObject.FindProperty("m_SamplingFilter");
_samplingIntensity = serializedObject.FindProperty("m_SamplingIntensity");
_samplingWidth = serializedObject.FindProperty("m_SamplingWidth");
_transitionFilter = serializedObject.FindProperty("m_TransitionFilter");
_transitionRate = serializedObject.FindProperty("m_TransitionRate");
_transitionTex = serializedObject.FindProperty("m_TransitionTex");
_transitionTexScale = serializedObject.FindProperty("m_TransitionTexScale");
_transitionTexOffset = serializedObject.FindProperty("m_TransitionTexOffset");
_transitionTexSpeed = serializedObject.FindProperty("m_TransitionTexSpeed");
_transitionReverse = serializedObject.FindProperty("m_TransitionReverse");
_transitionRotation = serializedObject.FindProperty("m_TransitionRotation");
_transitionKeepAspectRatio = serializedObject.FindProperty("m_TransitionKeepAspectRatio");
_transitionWidth = serializedObject.FindProperty("m_TransitionWidth");
_transitionSoftness = serializedObject.FindProperty("m_TransitionSoftness");
_transitionRange = serializedObject.FindProperty("m_TransitionRange");
_transitionColorFilter = serializedObject.FindProperty("m_TransitionColorFilter");
_transitionColor = serializedObject.FindProperty("m_TransitionColor");
_transitionColorGlow = serializedObject.FindProperty("m_TransitionColorGlow");
_transitionPatternReverse = serializedObject.FindProperty("m_TransitionPatternReverse");
_transitionAutoPlaySpeed = serializedObject.FindProperty("m_TransitionAutoPlaySpeed");
s_RotationLabel.tooltip = _transitionRotation.tooltip;
s_KeepAspectRatioLabel.tooltip = _transitionKeepAspectRatio.tooltip;
_targetMode = serializedObject.FindProperty("m_TargetMode");
_targetColor = serializedObject.FindProperty("m_TargetColor");
_targetRange = serializedObject.FindProperty("m_TargetRange");
_targetSoftness = serializedObject.FindProperty("m_TargetSoftness");
_blendType = serializedObject.FindProperty("m_BlendType");
_srcBlendMode = serializedObject.FindProperty("m_SrcBlendMode");
_dstBlendMode = serializedObject.FindProperty("m_DstBlendMode");
_shadowMode = serializedObject.FindProperty("m_ShadowMode");
_shadowDistance = serializedObject.FindProperty("m_ShadowDistance");
_shadowDistanceX = _shadowDistance.FindPropertyRelative("x");
_shadowDistanceY = _shadowDistance.FindPropertyRelative("y");
_shadowIteration = serializedObject.FindProperty("m_ShadowIteration");
_shadowFade = serializedObject.FindProperty("m_ShadowFade");
_shadowMirrorScale = serializedObject.FindProperty("m_ShadowMirrorScale");
_shadowBlurIntensity = serializedObject.FindProperty("m_ShadowBlurIntensity");
_shadowColorFilter = serializedObject.FindProperty("m_ShadowColorFilter");
_shadowColor = serializedObject.FindProperty("m_ShadowColor");
_shadowColorGlow = serializedObject.FindProperty("m_ShadowColorGlow");
_edgeMode = serializedObject.FindProperty("m_EdgeMode");
_edgeWidth = serializedObject.FindProperty("m_EdgeWidth");
_edgeColorFilter = serializedObject.FindProperty("m_EdgeColorFilter");
_edgeColor = serializedObject.FindProperty("m_EdgeColor");
_edgeColorGlow = serializedObject.FindProperty("m_EdgeColorGlow");
_edgeShinyRate = serializedObject.FindProperty("m_EdgeShinyRate");
_edgeShinyWidth = serializedObject.FindProperty("m_EdgeShinyWidth");
_edgeShinyAutoPlaySpeed = serializedObject.FindProperty("m_EdgeShinyAutoPlaySpeed");
_patternArea = serializedObject.FindProperty("m_PatternArea");
_gradationMode = serializedObject.FindProperty("m_GradationMode");
_gradationIntensity = serializedObject.FindProperty("m_GradationIntensity");
_gradationColorFilter = serializedObject.FindProperty("m_GradationColorFilter");
_gradationColor1 = serializedObject.FindProperty("m_GradationColor1");
_gradationColor2 = serializedObject.FindProperty("m_GradationColor2");
_gradationColor3 = serializedObject.FindProperty("m_GradationColor3");
_gradationColor4 = serializedObject.FindProperty("m_GradationColor4");
_gradationGradient = serializedObject.FindProperty("m_GradationGradient");
_gradationOffset = serializedObject.FindProperty("m_GradationOffset");
_gradationScale = serializedObject.FindProperty("m_GradationScale");
_gradationRotation = serializedObject.FindProperty("m_GradationRotation");
_detailFilter = serializedObject.FindProperty("m_DetailFilter");
_detailIntensity = serializedObject.FindProperty("m_DetailIntensity");
_detailColor = serializedObject.FindProperty("m_DetailColor");
_detailThreshold = serializedObject.FindProperty("m_DetailThreshold");
_detailTex = serializedObject.FindProperty("m_DetailTex");
_detailTexScale = serializedObject.FindProperty("m_DetailTexScale");
_detailTexOffset = serializedObject.FindProperty("m_DetailTexOffset");
_detailTexSpeed = serializedObject.FindProperty("m_DetailTexSpeed");
_flip = serializedObject.FindProperty("m_Flip");
}
public override void OnInspectorGUI()
{
serializedObject.Update();
DrawProperties();
serializedObject.ApplyModifiedProperties();
}
public void DrawProperties()
{
// Tone filter
if (DrawHeaderPopup(_toneFilter))
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_toneIntensity);
EditorGUI.indentLevel--;
}
// Color filter
DrawSeparator();
var prevColorFilter = (ColorFilter)_colorFilter.intValue;
if (DrawHeaderPopup(_colorFilter))
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_colorIntensity);
DrawColor(_color, (ColorFilter)_colorFilter.intValue, prevColorFilter, false);
EditorGUILayout.PropertyField(_colorGlow);
EditorGUI.indentLevel--;
}
EditorGUI.EndChangeCheck();
// Sampling filter
DrawSeparator();
if (DrawHeaderPopup(_samplingFilter))
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_samplingIntensity);
if (_samplingFilter.intValue == (int)SamplingFilter.EdgeAlpha
|| _samplingFilter.intValue == (int)SamplingFilter.EdgeLuminance)
{
EditorGUILayout.PropertyField(_samplingWidth);
}
EditorGUI.indentLevel--;
}
// Transition filter
DrawSeparator();
if (DrawHeaderPopup(_transitionFilter))
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_transitionRate);
EditorGUILayout.PropertyField(_transitionTex);
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_transitionTexScale, EditorGUIUtility.TrTempContent("Scale"));
EditorGUILayout.PropertyField(_transitionTexOffset, EditorGUIUtility.TrTempContent("Offset"));
EditorGUILayout.PropertyField(_transitionTexSpeed, EditorGUIUtility.TrTempContent("Speed"));
if (_transitionTexSpeed.vector2Value != Vector2.zero)
{
EditorApplication.QueuePlayerLoopUpdate();
}
EditorGUILayout.PropertyField(_transitionRotation, s_RotationLabel);
EditorGUILayout.PropertyField(_transitionKeepAspectRatio, s_KeepAspectRatioLabel);
EditorGUILayout.PropertyField(_transitionReverse, EditorGUIUtility.TrTempContent("Reverse"));
EditorGUI.indentLevel--;
if (_transitionFilter.intValue == (int)TransitionFilter.Pattern)
{
EditorGUILayout.PropertyField(_transitionWidth, EditorGUIUtility.TrTempContent("Pattern Size"));
EditorGUILayout.PropertyField(_transitionRange, EditorGUIUtility.TrTempContent("Pattern Range"));
EditorGUILayout.PropertyField(_transitionPatternReverse,
EditorGUIUtility.TrTempContent("Pattern Reverse"));
DrawColor(_transitionColorFilter, _transitionColor, null);
}
else if (2 < _transitionFilter.intValue)
{
EditorGUILayout.PropertyField(_transitionWidth);
EditorGUILayout.PropertyField(_transitionSoftness);
DrawColor(_transitionColorFilter, _transitionColor, _transitionColorGlow);
}
EditorGUILayout.PropertyField(_transitionAutoPlaySpeed);
if (0 < _transitionFilter.intValue && !Mathf.Approximately(0, _transitionAutoPlaySpeed.floatValue))
{
EditorApplication.QueuePlayerLoopUpdate();
}
EditorGUI.indentLevel--;
}
// Target
DrawSeparator();
if (DrawHeaderPopup(_targetMode))
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_targetColor);
EditorGUILayout.PropertyField(_targetRange);
EditorGUILayout.PropertyField(_targetSoftness);
EditorGUI.indentLevel--;
}
// Blending
DrawSeparator();
if (!DrawHeaderPopup(_blendType))
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_srcBlendMode);
EditorGUILayout.PropertyField(_dstBlendMode);
EditorGUI.indentLevel--;
}
// Shadow
DrawSeparator();
var prevShadowMode = (ShadowMode)_shadowMode.intValue;
if (DrawHeaderPopup(_shadowMode))
{
EditorGUI.indentLevel++;
if ((ShadowMode)_shadowMode.intValue == ShadowMode.Mirror)
{
if (prevShadowMode != ShadowMode.Mirror)
{
_shadowDistanceX.floatValue = 0.5f;
_shadowDistanceY.floatValue = 0f;
}
EditorGUILayout.Slider(_shadowDistanceX, 0, 1, "Reflection");
EditorGUILayout.PropertyField(_shadowDistanceY, EditorGUIUtility.TrTempContent("Offset"));
EditorGUILayout.PropertyField(_shadowMirrorScale);
EditorGUILayout.PropertyField(_shadowFade);
}
else
{
if (prevShadowMode == ShadowMode.Mirror)
{
_shadowDistanceX.floatValue = 1f;
_shadowDistanceY.floatValue = -1f;
}
EditorGUILayout.PropertyField(_shadowDistance);
EditorGUILayout.PropertyField(_shadowIteration);
DrawColor(_shadowColorFilter, _shadowColor, _shadowColorGlow, false);
EditorGUILayout.PropertyField(_shadowFade);
}
// Shadow blur intensity
switch ((SamplingFilter)_samplingFilter.intValue)
{
case SamplingFilter.BlurFast:
case SamplingFilter.BlurMedium:
case SamplingFilter.BlurDetail:
EditorGUILayout.PropertyField(_shadowBlurIntensity);
break;
}
EditorGUI.indentLevel--;
}
// Gradient
DrawSeparator();
if (DrawHeaderPopup(_gradationMode))
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_gradationColorFilter);
switch ((GradationMode)_gradationMode.intValue)
{
case GradationMode.HorizontalGradient:
case GradationMode.VerticalGradient:
case GradationMode.AngleGradient:
DrawGradientField(_gradationGradient);
break;
case GradationMode.Diagonal:
DrawColorPickerField("Top", _gradationColor1, _gradationColor2);
DrawColorPickerField("Bottom", _gradationColor3, _gradationColor4);
break;
default:
DrawColorPickerField(EditorGUILayout.GetControlRect(), _gradationColor1, true);
var r = EditorGUILayout.GetControlRect();
r.width -= 24;
DrawColorPickerField(r, _gradationColor2, true);
r.x += r.width + 4;
r.width = 20;
SwapColorsButton(r, _gradationColor1, _gradationColor2);
break;
}
EditorGUILayout.PropertyField(_gradationIntensity);
EditorGUILayout.PropertyField(_gradationOffset);
EditorGUILayout.PropertyField(_gradationScale);
if ((GradationMode)_gradationMode.intValue == GradationMode.Angle
|| (GradationMode)_gradationMode.intValue == GradationMode.AngleGradient)
{
EditorGUILayout.PropertyField(_gradationRotation);
}
EditorGUILayout.PropertyField(_transitionKeepAspectRatio, s_KeepAspectRatioLabel);
EditorGUI.indentLevel--;
}
// Edge Mode
DrawSeparator();
if (DrawHeaderPopup(_edgeMode))
{
EditorGUILayout.PropertyField(_edgeWidth);
DrawColor(_edgeColorFilter, _edgeColor, _edgeColorGlow);
if ((EdgeMode)_edgeMode.intValue == EdgeMode.Shiny)
{
EditorGUILayout.PropertyField(_edgeShinyRate);
EditorGUILayout.PropertyField(_edgeShinyWidth);
EditorGUILayout.PropertyField(_edgeShinyAutoPlaySpeed);
if (!Mathf.Approximately(0, _edgeShinyAutoPlaySpeed.floatValue))
{
EditorApplication.QueuePlayerLoopUpdate();
}
}
if (_transitionFilter.intValue == (int)TransitionFilter.Pattern)
{
EditorGUILayout.PropertyField(_patternArea);
}
}
// Detail filter
DrawSeparator();
if (DrawHeaderPopup(_detailFilter))
{
EditorGUI.indentLevel++;
if ((DetailFilter)_detailFilter.intValue == DetailFilter.Masking)
{
EditorGUILayout.PropertyField(_detailThreshold);
}
else
{
EditorGUILayout.PropertyField(_detailIntensity);
DrawColorPickerField(EditorGUILayout.GetControlRect(), _detailColor, true);
}
EditorGUILayout.PropertyField(_detailTex);
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_detailTexScale, EditorGUIUtility.TrTempContent("Scale"));
EditorGUILayout.PropertyField(_detailTexOffset, EditorGUIUtility.TrTempContent("Offset"));
EditorGUILayout.PropertyField(_detailTexSpeed, EditorGUIUtility.TrTempContent("Speed"));
if (_detailTexSpeed.vector2Value != Vector2.zero)
{
EditorApplication.QueuePlayerLoopUpdate();
}
EditorGUILayout.PropertyField(_transitionRotation, s_RotationLabel);
EditorGUILayout.PropertyField(_transitionKeepAspectRatio, s_KeepAspectRatioLabel);
EditorGUI.indentLevel--;
EditorGUI.indentLevel--;
}
// Flip
DrawSeparator();
DrawHeaderPopup(_flip);
}
private static void DrawColorPickerField(string label, SerializedProperty color1, SerializedProperty color2)
{
var labelWidth = EditorGUIUtility.labelWidth;
var r = EditorGUILayout.GetControlRect();
r.width -= 24;
EditorGUI.PrefixLabel(new Rect(r.x, r.y, labelWidth, r.height), EditorGUIUtility.TrTempContent(label));
var indentLevel = EditorGUI.indentLevel;
EditorGUI.indentLevel = 0;
var rPos = new Rect(r.x + labelWidth, r.y, (r.width - labelWidth) / 2, r.height);
DrawColorPickerField(rPos, GUIContent.none, color1, true);
rPos.x += rPos.width;
DrawColorPickerField(rPos, GUIContent.none, color2, true);
// Swap colors button
SwapColorsButton(new Rect(r.x + r.width + 4, r.y, 20, 20), color1, color2);
EditorGUI.indentLevel = indentLevel;
}
private static void DrawColorPickerField(Rect rect, SerializedProperty color, bool showAlpha)
{
var label = EditorGUIUtility.TrTempContent(color.displayName);
label.tooltip = color.tooltip;
DrawColorPickerField(rect, label, color, showAlpha);
}
private static void DrawColorPickerField(Rect rect, GUIContent label, SerializedProperty color, bool showAlpha)
{
var hdr = UIEffectProjectSettings.useHdrColorPicker;
EditorGUI.showMixedValue = color.hasMultipleDifferentValues;
EditorGUI.BeginChangeCheck();
var colorValue = EditorGUI.ColorField(rect, label, color.colorValue, true, showAlpha, hdr);
if (EditorGUI.EndChangeCheck())
{
color.colorValue = colorValue;
}
}
private static void DrawGradientField(SerializedProperty gradient)
{
var r = EditorGUILayout.GetControlRect();
var label = EditorGUIUtility.TrTempContent(gradient.displayName);
label.tooltip = gradient.tooltip;
var hdr = UIEffectProjectSettings.useHdrColorPicker;
EditorGUI.showMixedValue = gradient.hasMultipleDifferentValues;
EditorGUI.BeginChangeCheck();
var gradientValue = EditorGUI.GradientField(r, label, s_GetGradient(gradient), hdr);
if (EditorGUI.EndChangeCheck())
{
s_SetGradient(gradient, gradientValue);
}
}
private static void DrawColor(SerializedProperty color, ColorFilter filter, ColorFilter prevFilter,
bool showAlpha = true)
{
if (filter == ColorFilter.None) return;
if (filter == ColorFilter.HsvModifier)
{
if (prevFilter != ColorFilter.HsvModifier)
{
color.colorValue = Color.black;
}
EditorGUILayout.Slider(color.FindPropertyRelative("r"), -0.5f, 0.5f, "Hue");
EditorGUILayout.Slider(color.FindPropertyRelative("g"), -1f, 1f, "Saturation");
EditorGUILayout.Slider(color.FindPropertyRelative("b"), -1f, 1f, "Value");
EditorGUILayout.Slider(color.FindPropertyRelative("a"), 0, 1, "Alpha");
}
else if (filter == ColorFilter.Contrast)
{
if (prevFilter != ColorFilter.Contrast)
{
color.colorValue = Color.black;
}
EditorGUILayout.Slider(color.FindPropertyRelative("r"), -1f, 1f, "Contrast");
EditorGUILayout.Slider(color.FindPropertyRelative("g"), -1f, 1f, "Brightness");
EditorGUILayout.Slider(color.FindPropertyRelative("a"), 0, 1, "Alpha");
}
else
{
if (prevFilter == ColorFilter.HsvModifier || prevFilter == ColorFilter.Contrast)
{
color.colorValue = Color.white;
}
DrawColorPickerField(EditorGUILayout.GetControlRect(), color, showAlpha);
}
}
private static void DrawColor(SerializedProperty filter, SerializedProperty color, SerializedProperty glow,
bool showAlpha = true)
{
var prevFilter = (ColorFilter)filter.intValue;
EditorGUILayout.PropertyField(filter);
if (filter.intValue == (int)ColorFilter.None) return;
EditorGUI.indentLevel++;
DrawColor(color, (ColorFilter)filter.intValue, prevFilter, showAlpha);
if (glow != null)
{
EditorGUILayout.PropertyField(glow);
}
EditorGUI.indentLevel--;
}
private static void SwapColorsButton(Rect rect, SerializedProperty color1, SerializedProperty color2)
{
if (GUI.Button(rect, EditorGUIUtility.IconContent("preaudioloopoff"), "iconbutton"))
{
(color1.colorValue, color2.colorValue) = (color2.colorValue, color1.colorValue);
}
}
private static bool DrawHeaderPopup(SerializedProperty sp)
{
var r = EditorGUILayout.GetControlRect();
var pos = EditorGUI.PrefixLabel(r, EditorGUIUtility.TrTempContent(sp.displayName), EditorStyles.boldLabel);
EditorGUI.PropertyField(pos, sp, GUIContent.none);
return 0 < sp.intValue;
}
protected static void DrawSeparator()
{
EditorGUILayout.Space(4);
GUILayout.Label(GUIContent.none, "sv_iconselector_sep", GUILayout.ExpandWidth(true));
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 2b54493685c0d4cf49bbc33b1492bed5
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
+28 -10
View File
@@ -11,6 +11,7 @@ namespace Coffee.UIEffects.Editors
public class UIEffectReplicaEditor : Editor
{
private SerializedProperty _target;
private SerializedProperty _preset;
private SerializedProperty _useTargetTransform;
private SerializedProperty _samplingScale;
private SerializedProperty _allowToModifyMeshShape;
@@ -20,6 +21,7 @@ namespace Coffee.UIEffects.Editors
private void OnEnable()
{
_target = serializedObject.FindProperty("m_Target");
_preset = serializedObject.FindProperty("m_Preset");
_useTargetTransform = serializedObject.FindProperty("m_UseTargetTransform");
_samplingScale = serializedObject.FindProperty("m_SamplingScale");
_allowToModifyMeshShape = serializedObject.FindProperty("m_AllowToModifyMeshShape");
@@ -31,27 +33,42 @@ namespace Coffee.UIEffects.Editors
serializedObject.Update();
var r = EditorGUILayout.GetControlRect();
r.width -= 60;
EditorGUI.PropertyField(r, _target);
r.width -= 120;
if (_preset.objectReferenceValue)
{
EditorGUI.PropertyField(r, _preset);
}
else
{
EditorGUI.PropertyField(r, _target);
}
// Preset button.
r.x += r.width;
r.width = 60;
if (GUI.Button(r, EditorGUIUtility.TrTempContent("Preset"), "MiniPopup"))
{
UIEffectEditor.DropDownPreset(r, x => !x.builtin, p =>
UIEffectEditor.DropDownPreset(r, null, p =>
{
_target.objectReferenceValue = p;
_target.serializedObject.ApplyModifiedProperties();
_target.objectReferenceValue = null;
_preset.objectReferenceValue = p;
_preset.serializedObject.ApplyModifiedProperties();
});
}
// Clear button.
r.x += r.width;
r.width = 60;
if (GUI.Button(r, EditorGUIUtility.TrTempContent("Clear")))
{
_target.objectReferenceValue = null;
_preset.objectReferenceValue = null;
}
// Preset mode warning.
if (_target.objectReferenceValue is UIEffect targetEffect && !targetEffect.gameObject.scene.IsValid())
{
r = EditorGUILayout.GetControlRect();
r.width -= EditorGUIUtility.labelWidth;
r.x += EditorGUIUtility.labelWidth;
EditorGUI.HelpBox(r, "The target effect is not in the scene. (Preset mode)", MessageType.Warning);
}
@@ -63,12 +80,13 @@ namespace Coffee.UIEffects.Editors
EditorGUILayout.PropertyField(_samplingScale);
EditorGUILayout.PropertyField(_allowToModifyMeshShape);
if (_target.objectReferenceValue)
var parent = _target.objectReferenceValue ?? _preset.objectReferenceValue;
if (parent)
{
EditorGUI.BeginDisabledGroup(true);
CreateCachedEditor(_target.objectReferenceValue, null, ref _uiEffectEditor);
CreateCachedEditor(parent, null, ref _uiEffectEditor);
EditorGUILayout.BeginVertical(EditorStyles.helpBox);
(_uiEffectEditor as UIEffectEditor)?.DrawProperties();
(_uiEffectEditor as UIEffectPropertyEditor)?.DrawProperties();
EditorGUILayout.EndVertical();
EditorGUI.EndDisabledGroup();
}
+34 -15
View File
@@ -48,6 +48,7 @@ Combine various filters, such as grayscale, blur, and dissolve, to decorate your
- [Gradation Mode](#gradation-mode)
- [Edge Mode](#edge-mode)
- [Detail Filter](#detail-filter)
- [Flip](#flip)
- [Others](#others)
- [Component: UIEffectTweener](#component-uieffecttweener)
- [Component: UIEffectReplica](#component-uieffectreplica)
@@ -200,7 +201,10 @@ If upgrading from UIEffect v4 to v5, note the following breaking changes:
3. Adjust the effect filters and parameters in the inspector.
![](https://github.com/mob-sakai/mob-sakai/releases/download/docs/1744308178360.gif)
4. Enjoy!
4. From the top menu, you can load/append preset.
![](https://github.com/mob-sakai/mob-sakai/releases/download/docs/1744800851739.gif)
5. Enjoy!
<br><br>
@@ -354,11 +358,12 @@ The `UIEffect` component applies visual effects to UI elements, allowing various
#### Detail Filter
![](https://github.com/mob-sakai/mob-sakai/releases/download/docs/uieffect5.7.0-inspector-detail.png)
![](https://github.com/mob-sakai/mob-sakai/releases/download/docs/1744762332942.png)
- **Detail Filter**: `None`, `Masking`, `Multiply`, `Additive`, `Replace`, `MuliplyAdditive`
![](https://github.com/mob-sakai/mob-sakai/releases/download/docs/uieffect5.7.0-sample-detail.png)
- **Detail Filter**: `None`, `Masking`, `Multiply`, `Additive`, `Subtractive`, `Replace`, `MuliplyAdditive`
![](https://github.com/mob-sakai/mob-sakai/releases/download/docs/1744826180386.png)
- **Detail Intensity**: 0.0 (no effect) - 1.0 (full effect).
- **Detail Color**: The color of the detail.
- **Detail Threshold** (`Masking` only): The minimum and maximum alpha values used for masking. The larger the gap
between these values, the stronger the softness effect.
- **Detail Tex**: The texture used for the transition filter.
@@ -368,15 +373,11 @@ The `UIEffect` component applies visual effects to UI elements, allowing various
<br>
#### Others
#### Flip
![](https://github.com/mob-sakai/mob-sakai/releases/download/docs/uieffect5.7.0-inspector-others.png)
![](https://github.com/mob-sakai/mob-sakai/releases/download/docs/1744762521061.png)
- **Sampling Scale**: The referencing scale during sampling.
- Larger values are suitable for high-resolution textures.
- **Allow To Modify Mesh Shape**: If enabled, the mesh shape can be modified.
- **Custom Root**: Use the custom transform for some effects.
- **Flip**:
- **Flip**: Combine the following flags.
- `Nothing`
- `Horizontal`
- `Vertical`
@@ -384,6 +385,17 @@ The `UIEffect` component applies visual effects to UI elements, allowing various
- `Shadow`: Flip with the shadow.
![](https://github.com/mob-sakai/mob-sakai/releases/download/docs/uieffect5.7.0-sample-flip.png)
<br>
#### Others
![](https://github.com/mob-sakai/mob-sakai/releases/download/docs/1744762623263.png)
- **Sampling Scale**: The referencing scale during sampling.
- Larger values are suitable for high-resolution textures.
- **Allow To Modify Mesh Shape**: If enabled, the mesh shape can be modified.
- **Custom Root**: Use the custom transform for some effects.
> [!TIP]
> `Transition Filter`, `Gradation Filter`, and `Detail Filter` usually refer to their own `RectTransform` when applying effects.
> For example, if the mesh shape exceeds the `RectTransform` boundaries, the effect may not be applied correctly.
@@ -510,7 +522,7 @@ To use UIEffect with ShaderGraph, you need to import additional resources.
You can create and use presets for `UIEffect` components.
- Click the `Load` button to apply an editor preset.
> Click the `Append` button to load only non-default settings from the editor preset.
- Click the `Append` button to load only non-default settings from the editor preset.
- Click the `Save As New` button to save the current settings as an editor preset.
- In the [Project Settings](#project-settings), you can register saved editor presets as runtime presets.
- Runtime presets can be loaded using the `UIEffect.LoadPreset(presetName)` method.
@@ -548,16 +560,23 @@ UIEffectProjectSettings.shaderVariantCollection.WarmUp();
### Project Settings
![](https://github.com/mob-sakai/mob-sakai/releases/download/docs/1744305055425.png)
![](https://github.com/mob-sakai/mob-sakai/releases/download/docs/1744799623192.png)
You can adjust the project-wide settings for UIEffect. (`Edit > Project Settings > UI > UIEffect`)
#### Settings
- **Transform Sensitivity**: `Low`, `Medium`, `High`
- Set the sensitivity of the transformation when `Use Target Transform` is enabled in `UIEffectReplica` component.
- **Runtime Presets**: A list of presets that can be loaded at runtime. Load them using `UIEffect.LoadPreset(presetName)` method.
> [!IMPORTANT]
> - The legacy prefab-based preset system is deprecated as of v5.8.0.
> - If your project contains legacy presets, you can convert them to the new system.
> - **Convert All Legacy Presets**: Creates new presets based on the legacy ones.
> If the legacy presets are used as runtime presets, they will be replaced with the new ones.
> You can load the new preset via the `UIEffect.LoadPreset` method.
> - **Delete All Legacy Presets**: Deletes all legacy presets. If any legacy presets are assigned to `UIEffectReplica.target`, those targets will also be removed.
> ![](https://github.com/mob-sakai/mob-sakai/releases/download/docs/1744792792701.png)
#### Editor
- **Use HDR Color Picker**: If enabled, the HDR color picker will be used in the inspector.
+1
View File
@@ -125,6 +125,7 @@ namespace Coffee.UIEffects
Masking = 1,
Multiply = 2,
Additive = 3,
Subtractive = 6,
Replace = 4,
MultiplyAdditive = 5
}
@@ -271,7 +271,8 @@ namespace Coffee.UIEffectInternal
private readonly ReorderableList _rlOptionalShaders;
private readonly ReorderableList _rlUnregisteredVariants;
private Editor _editor;
private bool _expand;
private bool _expandOptionalShaders;
private bool _expandUnregisteredVariants;
public ShaderVariantRegistryEditor(SerializedProperty property, string optionName, Action onFindOptions)
{
@@ -281,11 +282,11 @@ namespace Coffee.UIEffectInternal
_errorOnUnregisteredVariant = property.FindPropertyRelative("m_ErrorOnUnregisteredVariant");
_asset = property.FindPropertyRelative("m_Asset");
_rlOptionalShaders = new ReorderableList(so, optionalShaders, false, true, true, true);
_rlOptionalShaders = new ReorderableList(so, optionalShaders, true, true, true, true);
_rlOptionalShaders.drawHeaderCallback = rect =>
{
var rLabel = new Rect(rect.x, rect.y, rect.width - 80, rect.height);
EditorGUI.LabelField(rLabel,
_expandOptionalShaders = EditorGUI.Foldout(rLabel, _expandOptionalShaders,
EditorGUIUtility.TrTextContent($"Optional Shaders {optionName}",
"Specify optional shaders explicitly."));
@@ -319,7 +320,7 @@ namespace Coffee.UIEffectInternal
}
var rArrow = new Rect(r.x, r.y + h + 4, 20, h);
EditorGUI.LabelField(rArrow, "->");
EditorGUI.LabelField(rArrow, GUIContent.none, "ArrowNavigationRight");
var rValue = new Rect(r.x + 20, r.y + h + 4, r.width - 20, h);
if (GUI.Button(rValue, value.stringValue, EditorStyles.popup))
@@ -376,8 +377,8 @@ namespace Coffee.UIEffectInternal
public void Draw()
{
_rlOptionalShaders.DoLayoutList();
_expand = DrawRegisteredShaderVariants(_expand, _asset, ref _editor);
DrawOptionalShaders(ref _expandOptionalShaders, _rlOptionalShaders);
DrawRegisteredShaderVariants(ref _expandUnregisteredVariants, _asset, ref _editor);
if (0 < _rlUnregisteredVariants.serializedProperty.arraySize)
{
EditorGUILayout.Space(4);
@@ -406,20 +407,40 @@ namespace Coffee.UIEffectInternal
EditorUtility.SetDirty(collection);
}
private static bool DrawRegisteredShaderVariants(bool expand, SerializedProperty property, ref Editor editor)
private static void DrawOptionalShaders(ref bool expand, ReorderableList list)
{
if (expand)
{
list.DoLayoutList();
}
else
{
var r = EditorGUILayout.GetControlRect(false, 20);
var rBg = new Rect(r.x - 3, r.y, r.width + 6, r.height);
EditorGUI.LabelField(rBg, GUIContent.none, "RL Header");
r.x += 3;
r.width -= 3;
r.y += 0;
list.drawHeaderCallback.Invoke(r);
}
}
private static void DrawRegisteredShaderVariants(ref bool expand, SerializedProperty property,
ref Editor editor)
{
var collection = property.objectReferenceValue as ShaderVariantCollection;
if (collection == null) return expand;
if (collection == null) return;
EditorGUILayout.Space();
var r = EditorGUILayout.GetControlRect(false, 20);
var rBg = new Rect(r.x - 3, r.y, r.width + 6, r.height);
EditorGUI.LabelField(rBg, GUIContent.none, "RL Header");
var rLabel = new Rect(r.x + 5, r.y, 200, r.height);
var rLabel = new Rect(r.x + 3, r.y, 200, r.height);
expand = EditorGUI.Foldout(rLabel, expand, "Registered Shader Variants");
var rButton = new Rect(r.x + r.width - 82, r.y + 1, 80, r.height - 4);
var rButton = new Rect(r.x + r.width - 62, r.y + 1, 60, r.height - 4);
if (GUI.Button(rButton, "Clear All", EditorStyles.miniButton))
{
collection.Clear();
@@ -440,8 +461,6 @@ namespace Coffee.UIEffectInternal
EditorGUILayout.EndVertical();
editor.serializedObject.ApplyModifiedProperties();
}
return expand;
}
private static void ShowShaderDropdown(SerializedProperty property)
File diff suppressed because it is too large Load Diff
+2 -8
View File
@@ -62,12 +62,6 @@ namespace Coffee.UIEffects
public virtual RectTransform transitionRoot => transform as RectTransform;
public virtual Flip flip
{
get => 0;
set { }
}
protected override void OnEnable()
{
_onBeforeCanvasRebuild ??= OnBeforeCanvasRebuild;
@@ -115,7 +109,7 @@ namespace Coffee.UIEffects
{
if (!_material || !graphic || context == null) return;
context.UpdateViewMatrix(GetCurrentMaterial(), transitionRoot, graphic.canvas.rootCanvas, flip);
context.UpdateViewMatrix(GetCurrentMaterial(), transitionRoot, graphic.canvas.rootCanvas);
}
public void ModifyMesh(Mesh mesh)
@@ -129,7 +123,7 @@ namespace Coffee.UIEffects
_canModifyMesh = CanModifyMesh();
if (_canModifyMesh)
{
context.ModifyMesh(graphic, transitionRoot, vh, canModifyShape, flip);
context.ModifyMesh(graphic, transitionRoot, vh, canModifyShape);
}
}
+311 -246
View File
@@ -15,7 +15,6 @@ namespace Coffee.UIEffects
private static readonly int s_SrcBlend = Shader.PropertyToID("_SrcBlend");
private static readonly int s_DstBlend = Shader.PropertyToID("_DstBlend");
private static readonly int s_ToneIntensity = Shader.PropertyToID("_ToneIntensity");
private static readonly int s_ToneParams = Shader.PropertyToID("_ToneParams");
private static readonly int s_ColorFilter = Shader.PropertyToID("_ColorFilter");
private static readonly int s_ColorValue = Shader.PropertyToID("_ColorValue");
private static readonly int s_ColorIntensity = Shader.PropertyToID("_ColorIntensity");
@@ -53,6 +52,7 @@ namespace Coffee.UIEffects
private static readonly int s_PatternArea = Shader.PropertyToID("_PatternArea");
private static readonly int s_DetailIntensity = Shader.PropertyToID("_DetailIntensity");
private static readonly int s_DetailThreshold = Shader.PropertyToID("_DetailThreshold");
private static readonly int s_DetailColor = Shader.PropertyToID("_DetailColor");
private static readonly int s_DetailTex = Shader.PropertyToID("_DetailTex");
private static readonly int s_DetailTex_ST = Shader.PropertyToID("_DetailTex_ST");
private static readonly int s_DetailTex_Speed = Shader.PropertyToID("_DetailTex_Speed");
@@ -66,6 +66,8 @@ namespace Coffee.UIEffects
private static readonly int s_GradationTex_ST = Shader.PropertyToID("_GradationTex_ST");
private static readonly int s_RootViewMatrix = Shader.PropertyToID("_RootViewMatrix");
private static readonly int s_GradViewMatrix = Shader.PropertyToID("_GradViewMatrix");
private static readonly int s_MirrorRootViewMatrix = Shader.PropertyToID("_MirrorRootViewMatrix");
private static readonly int s_MirrorGradViewMatrix = Shader.PropertyToID("_MirrorGradViewMatrix");
private static readonly int s_CanvasToWorldMatrix = Shader.PropertyToID("_CanvasToWorldMatrix");
private static readonly string[] s_ToneKeywords =
@@ -130,7 +132,8 @@ namespace Coffee.UIEffects
"DETAIL_MULTIPLY",
"DETAIL_ADDITIVE",
"DETAIL_REPLACE",
"DETAIL_MULTIPLY_ADDITIVE"
"DETAIL_MULTIPLY_ADDITIVE",
"DETAIL_SUBTRACTIVE"
};
private static readonly string[] s_GradationKeywords =
@@ -156,190 +159,239 @@ namespace Coffee.UIEffects
};
public static Func<UIVertex, Rect, UIVertex> onModifyVertex;
public ToneFilter toneFilter = ToneFilter.None;
public float toneIntensity = 1;
public Vector4 toneParams = new Vector4(0, 0, 0, 0);
public ToneFilter m_ToneFilter;
public float m_ToneIntensity;
public ColorFilter colorFilter = ColorFilter.None;
public float colorIntensity = 1;
public Color color = Color.white;
public bool colorGlow;
public ColorFilter m_ColorFilter;
public float m_ColorIntensity;
public Color m_Color;
public bool m_ColorGlow;
public SamplingFilter samplingFilter = SamplingFilter.None;
public float samplingIntensity = 0.5f;
public float samplingWidth;
public SamplingFilter m_SamplingFilter;
public float m_SamplingIntensity;
public float m_SamplingWidth;
public TransitionFilter transitionFilter = TransitionFilter.None;
public float transitionRate = 0.5f;
public bool transitionReverse;
public Texture transitionTex;
public Vector2 transitionTexScale = new Vector2(1, 1);
public Vector2 transitionTexOffset = new Vector2(0, 0);
public Vector2 transitionTexSpeed = new Vector2(0, 0);
public float transitionRotation = 0;
public bool transitionKeepAspectRatio = true;
public float transitionWidth = 0.2f;
public float transitionSoftness = 0.2f;
public MinMax01 transitionRange = new MinMax01(0, 1);
public ColorFilter transitionColorFilter = ColorFilter.MultiplyAdditive;
public Color transitionColor = new Color(0f, 0.5f, 1.0f, 1.0f);
public bool transitionColorGlow;
public bool transitionPatternReverse;
public float transitionAutoPlaySpeed;
public TransitionFilter m_TransitionFilter;
public float m_TransitionRate;
public bool m_TransitionReverse;
public Texture m_TransitionTex;
public Vector2 m_TransitionTexScale;
public Vector2 m_TransitionTexOffset;
public Vector2 m_TransitionTexSpeed;
public float m_TransitionRotation;
public bool m_TransitionKeepAspectRatio;
public float m_TransitionWidth;
public float m_TransitionSoftness;
public MinMax01 m_TransitionRange;
public ColorFilter m_TransitionColorFilter;
public Color m_TransitionColor;
public bool m_TransitionColorGlow;
public bool m_TransitionPatternReverse;
public float m_TransitionAutoPlaySpeed;
public TargetMode targetMode = TargetMode.None;
public Color targetColor = Color.white;
public float targetRange = 1;
public float targetSoftness = 0.5f;
public TargetMode m_TargetMode;
public Color m_TargetColor;
public float m_TargetRange;
public float m_TargetSoftness;
public BlendMode srcBlendMode = BlendMode.One;
public BlendMode dstBlendMode = BlendMode.OneMinusSrcAlpha;
public BlendMode m_SrcBlendMode;
public BlendMode m_DstBlendMode;
public ShadowMode shadowMode = ShadowMode.None;
public Vector2 shadowDistance = new Vector2(1f, -1f);
public int shadowIteration = 1;
public float shadowFade = 0.9f;
public float shadowMirrorScale = 0.5f;
public float shadowBlurIntensity;
public ColorFilter shadowColorFilter;
public Color shadowColor;
public bool shadowColorGlow;
public ShadowMode m_ShadowMode;
public Vector2 m_ShadowDistance;
public int m_ShadowIteration;
public float m_ShadowFade;
public float m_ShadowMirrorScale;
public float m_ShadowBlurIntensity;
public ColorFilter m_ShadowColorFilter;
public Color m_ShadowColor;
public bool m_ShadowColorGlow;
public EdgeMode edgeMode;
public float edgeShinyRate;
public float edgeWidth;
public ColorFilter edgeColorFilter;
public Color edgeColor;
public bool edgeColorGlow;
public float edgeShinyWidth;
public float edgeShinyAutoPlaySpeed;
public PatternArea patternArea;
public EdgeMode m_EdgeMode;
public float m_EdgeShinyRate;
public float m_EdgeWidth;
public ColorFilter m_EdgeColorFilter;
public Color m_EdgeColor;
public bool m_EdgeColorGlow;
public float m_EdgeShinyWidth;
public float m_EdgeShinyAutoPlaySpeed;
public PatternArea m_PatternArea;
public GradationMode gradationMode;
public float gradationIntensity;
public GradationColorFilter gradationColorFilter;
public Color gradationColor1;
public Color gradationColor2;
public Color gradationColor3;
public Color gradationColor4;
public Texture2D gradationTex;
public float gradationOffset;
public float gradationScale;
public float gradationRotation;
private List<float> _keyTimes;
public GradationMode m_GradationMode;
public float m_GradationIntensity;
public GradationColorFilter m_GradationColorFilter;
public Color m_GradationColor1;
public Color m_GradationColor2;
public Color m_GradationColor3;
public Color m_GradationColor4;
public Gradient m_GradationGradient;
public float m_GradationOffset;
public float m_GradationScale;
public float m_GradationRotation;
public DetailFilter detailFilter;
public float detailIntensity;
public MinMax01 detailThreshold;
public Texture detailTex;
public Vector2 detailTexScale = new Vector2(1, 1);
public Vector2 detailTexOffset = new Vector2(0, 0);
public Vector2 detailTexSpeed = new Vector2(0, 0);
public DetailFilter m_DetailFilter;
public float m_DetailIntensity;
public MinMax01 m_DetailThreshold;
public Color m_DetailColor;
public Texture m_DetailTex;
public Vector2 m_DetailTexScale;
public Vector2 m_DetailTexOffset;
public Vector2 m_DetailTexSpeed;
public bool willModifyMaterial => toneFilter != ToneFilter.None
|| colorFilter != ColorFilter.None
|| samplingFilter != SamplingFilter.None
|| transitionFilter != TransitionFilter.None
|| srcBlendMode != BlendMode.One
|| dstBlendMode != BlendMode.OneMinusSrcAlpha
|| shadowMode != ShadowMode.None
|| edgeMode != EdgeMode.None
|| detailFilter != DetailFilter.None
|| gradationMode != GradationMode.None;
public Flip m_Flip;
public bool willModifyMaterial => m_ToneFilter != ToneFilter.None
|| m_ColorFilter != ColorFilter.None
|| m_SamplingFilter != SamplingFilter.None
|| m_TransitionFilter != TransitionFilter.None
|| m_SrcBlendMode != BlendMode.One
|| m_DstBlendMode != BlendMode.OneMinusSrcAlpha
|| m_ShadowMode != ShadowMode.None
|| m_EdgeMode != EdgeMode.None
|| m_DetailFilter != DetailFilter.None
|| m_GradationMode != GradationMode.None;
public bool willModifyVertex => willModifyMaterial;
private Texture2D _gradationRampTex;
private bool _isGradientDirty = true;
private static readonly Color32[] s_Colors = new Color32[256];
private static readonly InternalObjectPool<Texture2D> s_TexturePool = new InternalObjectPool<Texture2D>(
() =>
{
var texture = new Texture2D(s_Colors.Length, 1, TextureFormat.RGBA32, false, false)
{
name = "GradationRamp",
hideFlags = HideFlags.DontSave,
wrapMode = TextureWrapMode.Repeat,
anisoLevel = 0
};
return texture;
},
texture => texture,
_ => { });
private Texture2D gradationRampTex
{
get
{
if (m_GradationGradient == null) return null;
if (!_gradationRampTex) _gradationRampTex = s_TexturePool.Rent();
if (!_isGradientDirty) return _gradationRampTex;
_isGradientDirty = false;
var w = s_Colors.Length;
for (var i = 0; i < w; i++)
{
s_Colors[i] = m_GradationGradient.Evaluate((float)i / (w - 1));
}
_gradationRampTex.filterMode = m_GradationGradient.mode == GradientMode.Blend
? FilterMode.Bilinear
: FilterMode.Point;
_gradationRampTex.SetPixels32(s_Colors);
_gradationRampTex.Apply();
return _gradationRampTex;
}
}
public void Reset()
{
InternalListPool<float>.Return(ref _keyTimes);
_isGradientDirty = true;
s_TexturePool.Return(ref _gradationRampTex);
CopyFrom(s_DefaultContext);
}
private void CopyFrom(UIEffectContext preset)
private void CopyFrom(UIEffectContext src)
{
toneFilter = preset.toneFilter;
toneIntensity = preset.toneIntensity;
toneParams = preset.toneParams;
var dst = this;
dst.m_ToneFilter = src.m_ToneFilter;
dst.m_ToneIntensity = src.m_ToneIntensity;
colorFilter = preset.colorFilter;
color = preset.color;
colorIntensity = preset.colorIntensity;
colorGlow = preset.colorGlow;
dst.m_ColorFilter = src.m_ColorFilter;
dst.m_Color = src.m_Color;
dst.m_ColorIntensity = src.m_ColorIntensity;
dst.m_ColorGlow = src.m_ColorGlow;
samplingFilter = preset.samplingFilter;
samplingIntensity = preset.samplingIntensity;
samplingWidth = preset.samplingWidth;
dst.m_SamplingFilter = src.m_SamplingFilter;
dst.m_SamplingIntensity = src.m_SamplingIntensity;
dst.m_SamplingWidth = src.m_SamplingWidth;
transitionFilter = preset.transitionFilter;
transitionRate = preset.transitionRate;
transitionReverse = preset.transitionReverse;
transitionTex = preset.transitionTex;
transitionTexScale = preset.transitionTexScale;
transitionTexOffset = preset.transitionTexOffset;
transitionTexSpeed = preset.transitionTexSpeed;
transitionKeepAspectRatio = preset.transitionKeepAspectRatio;
transitionRotation = preset.transitionRotation;
transitionWidth = preset.transitionWidth;
transitionSoftness = preset.transitionSoftness;
transitionRange = preset.transitionRange;
transitionColor = preset.transitionColor;
transitionColorFilter = preset.transitionColorFilter;
transitionColorGlow = preset.transitionColorGlow;
transitionPatternReverse = preset.transitionPatternReverse;
transitionAutoPlaySpeed = preset.transitionAutoPlaySpeed;
dst.m_TransitionFilter = src.m_TransitionFilter;
dst.m_TransitionRate = src.m_TransitionRate;
dst.m_TransitionReverse = src.m_TransitionReverse;
dst.m_TransitionTex = src.m_TransitionTex;
dst.m_TransitionTexScale = src.m_TransitionTexScale;
dst.m_TransitionTexOffset = src.m_TransitionTexOffset;
dst.m_TransitionTexSpeed = src.m_TransitionTexSpeed;
dst.m_TransitionKeepAspectRatio = src.m_TransitionKeepAspectRatio;
dst.m_TransitionRotation = src.m_TransitionRotation;
dst.m_TransitionWidth = src.m_TransitionWidth;
dst.m_TransitionSoftness = src.m_TransitionSoftness;
dst.m_TransitionRange = src.m_TransitionRange;
dst.m_TransitionColor = src.m_TransitionColor;
dst.m_TransitionColorFilter = src.m_TransitionColorFilter;
dst.m_TransitionColorGlow = src.m_TransitionColorGlow;
dst.m_TransitionPatternReverse = src.m_TransitionPatternReverse;
dst.m_TransitionAutoPlaySpeed = src.m_TransitionAutoPlaySpeed;
targetMode = preset.targetMode;
targetColor = preset.targetColor;
targetRange = preset.targetRange;
targetSoftness = preset.targetSoftness;
dst.m_TargetMode = src.m_TargetMode;
dst.m_TargetColor = src.m_TargetColor;
dst.m_TargetRange = src.m_TargetRange;
dst.m_TargetSoftness = src.m_TargetSoftness;
srcBlendMode = preset.srcBlendMode;
dstBlendMode = preset.dstBlendMode;
dst.m_SrcBlendMode = src.m_SrcBlendMode;
dst.m_DstBlendMode = src.m_DstBlendMode;
shadowMode = preset.shadowMode;
shadowDistance = preset.shadowDistance;
shadowIteration = preset.shadowIteration;
shadowFade = preset.shadowFade;
shadowMirrorScale = preset.shadowMirrorScale;
shadowBlurIntensity = preset.shadowBlurIntensity;
shadowColorFilter = preset.shadowColorFilter;
shadowColor = preset.shadowColor;
shadowColorGlow = preset.shadowColorGlow;
dst.m_ShadowMode = src.m_ShadowMode;
dst.m_ShadowDistance = src.m_ShadowDistance;
dst.m_ShadowIteration = src.m_ShadowIteration;
dst.m_ShadowFade = src.m_ShadowFade;
dst.m_ShadowMirrorScale = src.m_ShadowMirrorScale;
dst.m_ShadowBlurIntensity = src.m_ShadowBlurIntensity;
dst.m_ShadowColorFilter = src.m_ShadowColorFilter;
dst.m_ShadowColor = src.m_ShadowColor;
dst.m_ShadowColorGlow = src.m_ShadowColorGlow;
edgeMode = preset.edgeMode;
edgeShinyRate = preset.edgeShinyRate;
edgeWidth = preset.edgeWidth;
edgeColorFilter = preset.edgeColorFilter;
edgeColor = preset.edgeColor;
edgeColorGlow = preset.edgeColorGlow;
edgeShinyAutoPlaySpeed = preset.edgeShinyAutoPlaySpeed;
edgeShinyWidth = preset.edgeShinyWidth;
patternArea = preset.patternArea;
dst.m_EdgeMode = src.m_EdgeMode;
dst.m_EdgeShinyRate = src.m_EdgeShinyRate;
dst.m_EdgeWidth = src.m_EdgeWidth;
dst.m_EdgeColorFilter = src.m_EdgeColorFilter;
dst.m_EdgeColor = src.m_EdgeColor;
dst.m_EdgeColorGlow = src.m_EdgeColorGlow;
dst.m_EdgeShinyAutoPlaySpeed = src.m_EdgeShinyAutoPlaySpeed;
dst.m_EdgeShinyWidth = src.m_EdgeShinyWidth;
dst.m_PatternArea = src.m_PatternArea;
gradationMode = preset.gradationMode;
gradationIntensity = preset.gradationIntensity;
gradationColorFilter = preset.gradationColorFilter;
gradationColor1 = preset.gradationColor1;
gradationColor2 = preset.gradationColor2;
gradationColor3 = preset.gradationColor3;
gradationColor4 = preset.gradationColor4;
gradationTex = preset.gradationTex;
gradationScale = preset.gradationScale;
gradationOffset = preset.gradationOffset;
gradationRotation = preset.gradationRotation;
dst.m_GradationMode = src.m_GradationMode;
dst.m_GradationIntensity = src.m_GradationIntensity;
dst.m_GradationColorFilter = src.m_GradationColorFilter;
dst.m_GradationColor1 = src.m_GradationColor1;
dst.m_GradationColor2 = src.m_GradationColor2;
dst.m_GradationColor3 = src.m_GradationColor3;
dst.m_GradationColor4 = src.m_GradationColor4;
dst.m_GradationGradient = src.m_GradationGradient;
dst.m_GradationScale = src.m_GradationScale;
dst.m_GradationOffset = src.m_GradationOffset;
dst.m_GradationRotation = src.m_GradationRotation;
detailFilter = preset.detailFilter;
detailIntensity = preset.detailIntensity;
detailThreshold = preset.detailThreshold;
detailTex = preset.detailTex;
detailTexScale = preset.detailTexScale;
detailTexOffset = preset.detailTexOffset;
detailTexSpeed = preset.detailTexSpeed;
dst.m_DetailFilter = src.m_DetailFilter;
dst.m_DetailIntensity = src.m_DetailIntensity;
dst.m_DetailColor = src.m_DetailColor;
dst.m_DetailThreshold = src.m_DetailThreshold;
dst.m_DetailTex = src.m_DetailTex;
dst.m_DetailTexScale = src.m_DetailTexScale;
dst.m_DetailTexOffset = src.m_DetailTexOffset;
dst.m_DetailTexSpeed = src.m_DetailTexSpeed;
dst.m_Flip = src.m_Flip;
}
public void SetGradationDirty()
{
InternalListPool<float>.Return(ref _keyTimes);
_isGradientDirty = true;
}
public void ApplyToMaterial(Material material, float actualSamplingScale = 1f)
@@ -348,93 +400,93 @@ namespace Coffee.UIEffects
Profiler.BeginSample("(UIE)[UIEffect] GetModifiedMaterial");
material.SetInt(s_SrcBlend, (int)srcBlendMode);
material.SetInt(s_DstBlend, (int)dstBlendMode);
material.SetInt(s_SrcBlend, (int)m_SrcBlendMode);
material.SetInt(s_DstBlend, (int)m_DstBlendMode);
material.SetFloat(s_ToneIntensity, Mathf.Clamp01(toneIntensity));
material.SetVector(s_ToneParams, toneParams);
material.SetFloat(s_ToneIntensity, Mathf.Clamp01(m_ToneIntensity));
material.SetInt(s_ColorFilter, (int)colorFilter);
material.SetColor(s_ColorValue, color);
material.SetFloat(s_ColorIntensity, Mathf.Clamp01(colorIntensity));
material.SetInt(s_ColorGlow, colorGlow ? 1 : 0);
material.SetInt(s_ColorFilter, (int)m_ColorFilter);
material.SetColor(s_ColorValue, m_Color);
material.SetFloat(s_ColorIntensity, Mathf.Clamp01(m_ColorIntensity));
material.SetInt(s_ColorGlow, m_ColorGlow ? 1 : 0);
material.SetFloat(s_SamplingIntensity, Mathf.Clamp01(samplingIntensity));
material.SetFloat(s_SamplingWidth, samplingWidth);
material.SetFloat(s_SamplingIntensity, Mathf.Clamp01(m_SamplingIntensity));
material.SetFloat(s_SamplingWidth, m_SamplingWidth);
material.SetFloat(s_SamplingScale, actualSamplingScale);
material.SetFloat(s_TransitionRate, Mathf.Clamp01(transitionRate));
material.SetInt(s_TransitionReverse, transitionReverse ? 1 : 0);
material.SetTexture(s_TransitionTex, transitionFilter != 0 ? transitionTex : null);
material.SetFloat(s_TransitionRate, Mathf.Clamp01(m_TransitionRate));
material.SetInt(s_TransitionReverse, m_TransitionReverse ? 1 : 0);
material.SetTexture(s_TransitionTex, m_TransitionFilter != 0 ? m_TransitionTex : null);
material.SetVector(s_TransitionTex_ST,
new Vector4(transitionTexScale.x, transitionTexScale.y,
transitionTexOffset.x, transitionTexOffset.y));
material.SetVector(s_TransitionTex_Speed, transitionTexSpeed);
material.SetFloat(s_TransitionWidth, Mathf.Clamp01(transitionWidth));
material.SetFloat(s_TransitionSoftness, Mathf.Clamp01(transitionSoftness));
material.SetVector(s_TransitionRange, new Vector2(transitionRange.min, transitionRange.max));
material.SetInt(s_TransitionColorFilter, (int)transitionColorFilter);
material.SetColor(s_TransitionColor, transitionColor);
material.SetInt(s_TransitionColorGlow, transitionColorGlow ? 1 : 0);
material.SetInt(s_TransitionPatternReverse, transitionPatternReverse ? 1 : 0);
material.SetFloat(s_TransitionAutoPlaySpeed, transitionAutoPlaySpeed);
new Vector4(m_TransitionTexScale.x, m_TransitionTexScale.y,
m_TransitionTexOffset.x, m_TransitionTexOffset.y));
material.SetVector(s_TransitionTex_Speed, m_TransitionTexSpeed);
material.SetFloat(s_TransitionWidth, Mathf.Clamp01(m_TransitionWidth));
material.SetFloat(s_TransitionSoftness, Mathf.Clamp01(m_TransitionSoftness));
material.SetVector(s_TransitionRange, new Vector2(m_TransitionRange.min, m_TransitionRange.max));
material.SetInt(s_TransitionColorFilter, (int)m_TransitionColorFilter);
material.SetColor(s_TransitionColor, m_TransitionColor);
material.SetInt(s_TransitionColorGlow, m_TransitionColorGlow ? 1 : 0);
material.SetInt(s_TransitionPatternReverse, m_TransitionPatternReverse ? 1 : 0);
material.SetFloat(s_TransitionAutoPlaySpeed, m_TransitionAutoPlaySpeed);
material.SetColor(s_TargetColor, targetColor);
material.SetFloat(s_TargetRange, Mathf.Clamp01(targetRange));
material.SetFloat(s_TargetSoftness, Mathf.Clamp01(targetSoftness));
material.SetColor(s_TargetColor, m_TargetColor);
material.SetFloat(s_TargetRange, Mathf.Clamp01(m_TargetRange));
material.SetFloat(s_TargetSoftness, Mathf.Clamp01(m_TargetSoftness));
switch (samplingFilter)
switch (m_SamplingFilter)
{
case SamplingFilter.BlurFast:
case SamplingFilter.BlurMedium:
case SamplingFilter.BlurDetail:
material.SetFloat(s_ShadowBlurIntensity, Mathf.Clamp01(shadowBlurIntensity));
material.SetFloat(s_ShadowBlurIntensity, Mathf.Clamp01(m_ShadowBlurIntensity));
break;
default:
material.SetFloat(s_ShadowBlurIntensity, Mathf.Clamp01(samplingIntensity));
material.SetFloat(s_ShadowBlurIntensity, Mathf.Clamp01(m_SamplingIntensity));
break;
}
material.SetInt(s_ShadowColorFilter, (int)shadowColorFilter);
material.SetColor(s_ShadowColor, shadowColor);
material.SetInt(s_ShadowColorGlow, shadowColorGlow ? 1 : 0);
material.SetInt(s_ShadowColorFilter, (int)m_ShadowColorFilter);
material.SetColor(s_ShadowColor, m_ShadowColor);
material.SetInt(s_ShadowColorGlow, m_ShadowColorGlow ? 1 : 0);
material.SetFloat(s_EdgeWidth, Mathf.Clamp01(edgeWidth));
material.SetInt(s_EdgeColorFilter, (int)edgeColorFilter);
material.SetColor(s_EdgeColor, edgeColor);
material.SetInt(s_EdgeColorGlow, edgeColorGlow ? 1 : 0);
material.SetFloat(s_EdgeShinyRate, Mathf.Clamp01(edgeShinyRate));
material.SetFloat(s_EdgeShinyWidth, Mathf.Clamp01(edgeShinyWidth));
material.SetFloat(s_EdgeShinyAutoPlaySpeed, edgeShinyAutoPlaySpeed);
material.SetInt(s_PatternArea, edgeMode != EdgeMode.None ? (int)patternArea : 0);
material.SetFloat(s_EdgeWidth, Mathf.Clamp01(m_EdgeWidth));
material.SetInt(s_EdgeColorFilter, (int)m_EdgeColorFilter);
material.SetColor(s_EdgeColor, m_EdgeColor);
material.SetInt(s_EdgeColorGlow, m_EdgeColorGlow ? 1 : 0);
material.SetFloat(s_EdgeShinyRate, Mathf.Clamp01(m_EdgeShinyRate));
material.SetFloat(s_EdgeShinyWidth, Mathf.Clamp01(m_EdgeShinyWidth));
material.SetFloat(s_EdgeShinyAutoPlaySpeed, m_EdgeShinyAutoPlaySpeed);
material.SetInt(s_PatternArea, m_EdgeMode != EdgeMode.None ? (int)m_PatternArea : 0);
material.SetTexture(s_GradationTex, gradationMode != 0 ? gradationTex : null);
material.SetTexture(s_GradationTex, m_GradationMode != 0 ? gradationRampTex : null);
material.SetVector(s_GradationTex_ST, GetGradationScaleAndOffset());
material.SetFloat(s_GradationIntensity, gradationIntensity);
material.SetInt(s_GradationColorFilter, (int)gradationColorFilter);
material.SetColor(s_GradationColor1, gradationColor1);
material.SetColor(s_GradationColor2, gradationColor2);
material.SetColor(s_GradationColor3, gradationColor3);
material.SetColor(s_GradationColor4, gradationColor4);
material.SetFloat(s_GradationIntensity, m_GradationIntensity);
material.SetInt(s_GradationColorFilter, (int)m_GradationColorFilter);
material.SetColor(s_GradationColor1, m_GradationColor1);
material.SetColor(s_GradationColor2, m_GradationColor2);
material.SetColor(s_GradationColor3, m_GradationColor3);
material.SetColor(s_GradationColor4, m_GradationColor4);
material.SetFloat(s_DetailIntensity, Mathf.Clamp01(detailIntensity));
material.SetVector(s_DetailThreshold, new Vector2(detailThreshold.min, detailThreshold.max));
material.SetTexture(s_DetailTex, detailFilter != 0 ? detailTex : null);
material.SetFloat(s_DetailIntensity, Mathf.Clamp01(m_DetailIntensity));
material.SetColor(s_DetailColor, m_DetailColor);
material.SetVector(s_DetailThreshold, new Vector2(m_DetailThreshold.min, m_DetailThreshold.max));
material.SetTexture(s_DetailTex, m_DetailFilter != 0 ? m_DetailTex : null);
material.SetVector(s_DetailTex_ST,
new Vector4(detailTexScale.x, detailTexScale.y,
detailTexOffset.x, detailTexOffset.y));
material.SetVector(s_DetailTex_Speed, detailTexSpeed);
new Vector4(m_DetailTexScale.x, m_DetailTexScale.y,
m_DetailTexOffset.x, m_DetailTexOffset.y));
material.SetVector(s_DetailTex_Speed, m_DetailTexSpeed);
SetKeyword(material, s_ToneKeywords, (int)toneFilter);
SetKeyword(material, s_ColorKeywords, colorFilter != 0 || shadowMode != 0 ? 1 : 0);
SetKeyword(material, s_SamplingKeywords, (int)samplingFilter);
SetKeyword(material, s_TransitionKeywords, (int)transitionFilter);
SetKeyword(material, s_EdgeKeywords, (int)edgeMode);
SetKeyword(material, s_DetailKeywords, (int)detailFilter);
SetKeyword(material, s_TargetKeywords, (int)targetMode);
SetKeyword(material, s_ToneKeywords, (int)m_ToneFilter);
SetKeyword(material, s_ColorKeywords, m_ColorFilter != 0 || m_ShadowMode != 0 ? 1 : 0);
SetKeyword(material, s_SamplingKeywords, (int)m_SamplingFilter);
SetKeyword(material, s_TransitionKeywords, (int)m_TransitionFilter);
SetKeyword(material, s_EdgeKeywords, (int)m_EdgeMode);
SetKeyword(material, s_DetailKeywords, (int)m_DetailFilter);
SetKeyword(material, s_TargetKeywords, (int)m_TargetMode);
switch (gradationMode)
switch (m_GradationMode)
{
case GradationMode.None:
SetKeyword(material, s_GradationKeywords, 0);
@@ -466,41 +518,55 @@ namespace Coffee.UIEffects
public void SetEnablePreview(bool enable, Material material)
{
if (!material) return;
material.SetVector(s_TransitionTex_Speed, enable ? (Vector4)transitionTexSpeed : Vector4.zero);
material.SetVector(s_DetailTex_Speed, enable ? (Vector4)detailTexSpeed : Vector4.zero);
material.SetFloat(s_TransitionAutoPlaySpeed, enable ? transitionAutoPlaySpeed : 0);
material.SetFloat(s_EdgeShinyAutoPlaySpeed, enable ? edgeShinyAutoPlaySpeed : 0);
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);
material.SetFloat(s_EdgeShinyAutoPlaySpeed, enable ? m_EdgeShinyAutoPlaySpeed : 0);
}
public void UpdateViewMatrix(Material material, RectTransform transitionRoot, Canvas canvas, Flip flip)
public void UpdateViewMatrix(Material material, RectTransform transitionRoot, Canvas canvas)
{
if (!material) return;
var size = transitionRoot.rect.size;
var scale = new Vector3(1f / size.x, 1f / size.y, 1f);
if (transitionKeepAspectRatio && !Mathf.Approximately(scale.x, scale.y))
if (m_TransitionKeepAspectRatio && !Mathf.Approximately(scale.x, scale.y))
{
scale.x = scale.y = Mathf.Min(scale.x, scale.y);
}
if (0 != (flip & Flip.Effect))
if (0 != (m_Flip & Flip.Effect))
{
scale.x = 0 != (flip & Flip.Horizontal) ? -scale.x : scale.x;
scale.y = 0 != (flip & Flip.Vertical) ? -scale.y : scale.y;
scale.x = 0 != (m_Flip & Flip.Horizontal) ? -scale.x : scale.x;
scale.y = 0 != (m_Flip & Flip.Vertical) ? -scale.y : scale.y;
}
var pivot = new Vector2(0.5f, 0.5f);
var offset = (transitionRoot.pivot - pivot) * size;
var w2LMat = Matrix4x4.Translate(offset) * transitionRoot.worldToLocalMatrix;
var rootRotation = Quaternion.Euler(0, 0, transitionRotation);
var rootScale = 1f / GetMultiplier(transitionRotation);
var rootRotation = Quaternion.Euler(0, 0, m_TransitionRotation);
var rootScale = 1f / GetMultiplier(m_TransitionRotation);
material.SetMatrix(s_RootViewMatrix, Matrix4x4.TRS(pivot, rootRotation, scale * rootScale) * w2LMat);
var gradRotation = Quaternion.Euler(0, 0, GetGradationRotation());
var gradScale = 1f / GetMultiplier(GetGradationRotation());
material.SetMatrix(s_GradViewMatrix, Matrix4x4.TRS(pivot, gradRotation, scale * gradScale) * w2LMat);
if (m_ShadowMode == ShadowMode.Mirror)
{
var mirrorInv = 1f / m_ShadowMirrorScale;
var mirrorOffset = new Vector3(0, size.y / 2 * (mirrorInv + 1) - m_ShadowDistance.y * mirrorInv, 0);
var mirrorScale = new Vector3(1, mirrorInv, 1);
var udScale = new Vector3(scale.x, -scale.y, scale.z);
material.SetMatrix(s_MirrorRootViewMatrix,
Matrix4x4.TRS(pivot, rootRotation, udScale * rootScale)
* Matrix4x4.TRS(mirrorOffset, Quaternion.identity, mirrorScale) * w2LMat);
material.SetMatrix(s_MirrorGradViewMatrix,
Matrix4x4.TRS(pivot, gradRotation, udScale * gradScale)
* Matrix4x4.TRS(mirrorOffset, Quaternion.identity, mirrorScale) * w2LMat);
}
if (canvas.renderMode == RenderMode.ScreenSpaceOverlay || !canvas.worldCamera)
{
material.SetMatrix(s_CanvasToWorldMatrix, canvas.transform.localToWorldMatrix);
@@ -513,26 +579,26 @@ namespace Coffee.UIEffects
private Vector4 GetGradationScaleAndOffset()
{
var gScale = 1 / gradationScale;
switch (gradationMode)
var gScale = 1 / m_GradationScale;
switch (m_GradationMode)
{
case GradationMode.HorizontalGradient:
case GradationMode.VerticalGradient:
case GradationMode.AngleGradient:
return new Vector4(gScale, 1, -0.5f * (gScale + 1) - gradationOffset, 0);
return new Vector4(gScale, 1, -0.5f * (gScale + 1) - m_GradationOffset, 0);
case GradationMode.RadialFast:
case GradationMode.RadialDetail:
{
return new Vector4(gScale, 1, gradationOffset, 0);
return new Vector4(gScale, 1, m_GradationOffset, 0);
}
default:
return new Vector4(gScale, 1, gradationOffset * (gScale + 1) / 2 - gScale * 0.5f + 0.5f, 0);
return new Vector4(gScale, 1, m_GradationOffset * (gScale + 1) / 2 - gScale * 0.5f + 0.5f, 0);
}
}
private float GetGradationRotation()
{
switch (gradationMode)
switch (m_GradationMode)
{
case GradationMode.DiagonalToLeftBottom:
return 135;
@@ -544,7 +610,7 @@ namespace Coffee.UIEffects
return -90;
case GradationMode.Angle:
case GradationMode.AngleGradient:
return gradationRotation;
return m_GradationRotation;
default:
return 0;
}
@@ -573,11 +639,10 @@ namespace Coffee.UIEffects
}
}
public void ModifyMesh(Graphic graphic, RectTransform transitionRoot, VertexHelper vh,
bool canModifyShape, Flip flip)
public void ModifyMesh(Graphic graphic, RectTransform transitionRoot, VertexHelper vh, bool canModifyShape)
{
// Apply flip (without effect).
ApplyFlipWithoutEffect(vh, flip);
ApplyFlipWithoutEffect(vh, m_Flip);
var count = vh.currentIndexCount;
if (!willModifyVertex || count == 0) return;
@@ -616,10 +681,10 @@ namespace Coffee.UIEffects
}
// Apply flip (with effect).
ApplyFlipWithEffect(verts, flip);
ApplyFlipWithEffect(verts, m_Flip);
// Apply shadow.
ApplyShadow(verts, transitionRoot, flip);
ApplyShadow(verts, transitionRoot, m_Flip);
vh.Clear();
vh.AddUIVertexTriangleStream(verts);
@@ -627,7 +692,7 @@ namespace Coffee.UIEffects
private void ApplyShadow(List<UIVertex> verts, RectTransform transitionRoot, Flip flip)
{
var distance = shadowDistance;
var distance = m_ShadowDistance;
if (distance == Vector2.zero) return;
if ((flip & Flip.Shadow) != 0)
@@ -636,17 +701,17 @@ namespace Coffee.UIEffects
distance.y = (flip & Flip.Vertical) != 0 ? -distance.y : distance.y;
}
switch (shadowMode)
switch (m_ShadowMode)
{
case ShadowMode.Shadow:
case ShadowMode.Shadow3:
case ShadowMode.Outline:
case ShadowMode.Outline8:
ShadowUtil.DoShadow(verts, s_ShadowVectors[(int)shadowMode], distance, shadowIteration,
shadowFade);
ShadowUtil.DoShadow(verts, s_ShadowVectors[(int)m_ShadowMode], distance, m_ShadowIteration,
m_ShadowFade);
break;
case ShadowMode.Mirror:
ShadowUtil.DoMirror(verts, distance, shadowMirrorScale, shadowFade, transitionRoot);
ShadowUtil.DoMirror(verts, distance, m_ShadowMirrorScale, m_ShadowFade, transitionRoot);
break;
}
}
@@ -678,7 +743,7 @@ namespace Coffee.UIEffects
if (!canModifyShape) return Vector4.zero;
var expandSize = Vector4.zero;
switch (samplingFilter)
switch (m_SamplingFilter)
{
case SamplingFilter.BlurFast:
expandSize += Vector4.one * 10;
@@ -695,7 +760,7 @@ namespace Coffee.UIEffects
break;
}
switch (transitionFilter)
switch (m_TransitionFilter)
{
case TransitionFilter.Melt:
expandSize.y += 40;
+178
View File
@@ -0,0 +1,178 @@
using Coffee.UIEffectInternal;
using UnityEngine;
using UnityEngine.Rendering;
namespace Coffee.UIEffects
{
[CreateAssetMenu]
[ExecuteAlways]
public class UIEffectPreset : ScriptableObject
{
public ToneFilter m_ToneFilter = ToneFilter.None;
[Range(0, 1)] public float m_ToneIntensity = 1;
public ColorFilter m_ColorFilter = ColorFilter.None;
[Range(0, 1)] public float m_ColorIntensity = 1;
public Color m_Color = Color.white;
public bool m_ColorGlow = false;
public SamplingFilter m_SamplingFilter = SamplingFilter.None;
[Range(0, 1)] public float m_SamplingIntensity = 0.5f;
[Range(0.5f, 10f)] public float m_SamplingWidth = 1;
public TransitionFilter m_TransitionFilter = TransitionFilter.None;
[Range(0, 1)] public float m_TransitionRate = 0.5f;
public bool m_TransitionReverse;
public Texture m_TransitionTex;
public Vector2 m_TransitionTexScale = new Vector2(1, 1);
public Vector2 m_TransitionTexOffset = new Vector2(0, 0);
public Vector2 m_TransitionTexSpeed = new Vector2(0, 0);
[Range(0, 360)] public float m_TransitionRotation = 0;
public bool m_TransitionKeepAspectRatio = true;
[Range(0, 1)] public float m_TransitionWidth = 0.2f;
[Range(0, 1)] public float m_TransitionSoftness = 0.2f;
public MinMax01 m_TransitionRange = new MinMax01(0, 1);
public ColorFilter m_TransitionColorFilter = ColorFilter.MultiplyAdditive;
public Color m_TransitionColor = new Color(0f, 0.5f, 1.0f, 1.0f);
public bool m_TransitionColorGlow = false;
public bool m_TransitionPatternReverse = false;
[Range(-5, 5)] public float m_TransitionAutoPlaySpeed = 0f;
public TargetMode m_TargetMode = TargetMode.None;
public Color m_TargetColor = Color.white;
[Range(0, 1)] public float m_TargetRange = 0.1f;
[Range(0, 1)] public float m_TargetSoftness = 0.5f;
public BlendType m_BlendType = BlendType.AlphaBlend;
public BlendMode m_SrcBlendMode = BlendMode.One;
public BlendMode m_DstBlendMode = BlendMode.OneMinusSrcAlpha;
public ShadowMode m_ShadowMode = ShadowMode.None;
public Vector2 m_ShadowDistance = new Vector2(1f, -1f);
[Range(1, 5)] public int m_ShadowIteration = 1;
[Range(0, 1)] public float m_ShadowFade = 0.9f;
[Range(0, 2)] public float m_ShadowMirrorScale = 0.5f;
[Range(0, 1)] public float m_ShadowBlurIntensity = 1;
public ColorFilter m_ShadowColorFilter = ColorFilter.Replace;
public Color m_ShadowColor = Color.white;
public bool m_ShadowColorGlow = false;
public GradationMode m_GradationMode = GradationMode.None;
[Range(0, 1)] public float m_GradationIntensity = 1;
public GradationColorFilter m_GradationColorFilter = GradationColorFilter.Multiply;
public Color m_GradationColor1 = Color.white;
public Color m_GradationColor2 = Color.white;
public Color m_GradationColor3 = Color.white;
public Color m_GradationColor4 = Color.white;
public Gradient m_GradationGradient = new Gradient();
[Range(-1, 1)] public float m_GradationOffset = 0;
[PowerRange(0.01f, 10, 10)] public float m_GradationScale = 1;
[Range(0, 360)] public float m_GradationRotation = 0;
public EdgeMode m_EdgeMode = EdgeMode.None;
[Range(0, 1)] public float m_EdgeWidth = 0.5f;
public ColorFilter m_EdgeColorFilter = ColorFilter.Replace;
public Color m_EdgeColor = Color.white;
public bool m_EdgeColorGlow = false;
[Range(0, 1)] public float m_EdgeShinyRate = 0.5f;
[Range(0, 1)] public float m_EdgeShinyWidth = 0.5f;
[Range(-5, 5)] public float m_EdgeShinyAutoPlaySpeed = 1f;
public PatternArea m_PatternArea = PatternArea.Inner;
public DetailFilter m_DetailFilter = DetailFilter.None;
[Range(0, 1)] public float m_DetailIntensity = 1;
public Color m_DetailColor = Color.white;
public MinMax01 m_DetailThreshold = new MinMax01(0, 1);
public Texture m_DetailTex;
public Vector2 m_DetailTexScale = new Vector2(1, 1);
public Vector2 m_DetailTexOffset = new Vector2(0, 0);
public Vector2 m_DetailTexSpeed = new Vector2(0, 0);
public Flip m_Flip = 0;
public void UpdateContext(UIEffectContext dst)
{
var src = this;
dst.m_ToneFilter = src.m_ToneFilter;
dst.m_ToneIntensity = src.m_ToneIntensity;
dst.m_ColorFilter = src.m_ColorFilter;
dst.m_Color = src.m_Color;
dst.m_ColorIntensity = src.m_ColorIntensity;
dst.m_ColorGlow = src.m_ColorGlow;
dst.m_SamplingFilter = src.m_SamplingFilter;
dst.m_SamplingIntensity = src.m_SamplingIntensity;
dst.m_SamplingWidth = src.m_SamplingWidth;
dst.m_TransitionFilter = src.m_TransitionFilter;
dst.m_TransitionRate = src.m_TransitionRate;
dst.m_TransitionReverse = src.m_TransitionReverse;
dst.m_TransitionTex = src.m_TransitionTex;
dst.m_TransitionTexScale = src.m_TransitionTexScale;
dst.m_TransitionTexOffset = src.m_TransitionTexOffset;
dst.m_TransitionTexSpeed = src.m_TransitionTexSpeed;
dst.m_TransitionRotation = src.m_TransitionRotation;
dst.m_TransitionKeepAspectRatio = src.m_TransitionKeepAspectRatio;
dst.m_TransitionWidth = src.m_TransitionWidth;
dst.m_TransitionSoftness = src.m_TransitionSoftness;
dst.m_TransitionRange = src.m_TransitionRange;
dst.m_TransitionColorFilter = src.m_TransitionColorFilter;
dst.m_TransitionColor = src.m_TransitionColor;
dst.m_TransitionColorGlow = src.m_TransitionColorGlow;
dst.m_TransitionPatternReverse = src.m_TransitionPatternReverse;
dst.m_TransitionAutoPlaySpeed = src.m_TransitionAutoPlaySpeed;
dst.m_TargetMode = src.m_TargetMode;
dst.m_TargetColor = src.m_TargetColor;
dst.m_TargetRange = src.m_TargetRange;
dst.m_TargetSoftness = src.m_TargetSoftness;
dst.m_SrcBlendMode = src.m_SrcBlendMode;
dst.m_DstBlendMode = src.m_DstBlendMode;
dst.m_ShadowMode = src.m_ShadowMode;
dst.m_ShadowDistance = src.m_ShadowDistance;
dst.m_ShadowIteration = src.m_ShadowIteration;
dst.m_ShadowFade = src.m_ShadowFade;
dst.m_ShadowMirrorScale = src.m_ShadowMirrorScale;
dst.m_ShadowBlurIntensity = src.m_ShadowBlurIntensity;
dst.m_ShadowColorFilter = src.m_ShadowColorFilter;
dst.m_ShadowColor = src.m_ShadowColor;
dst.m_ShadowColorGlow = src.m_ShadowColorGlow;
dst.m_EdgeMode = src.m_EdgeMode;
dst.m_EdgeShinyRate = src.m_EdgeShinyRate;
dst.m_EdgeWidth = src.m_EdgeWidth;
dst.m_EdgeColorFilter = src.m_EdgeColorFilter;
dst.m_EdgeColor = src.m_EdgeColor;
dst.m_EdgeColorGlow = src.m_EdgeColorGlow;
dst.m_EdgeShinyWidth = src.m_EdgeShinyWidth;
dst.m_EdgeShinyAutoPlaySpeed = src.m_EdgeShinyAutoPlaySpeed;
dst.m_PatternArea = src.m_PatternArea;
dst.m_GradationMode = src.m_GradationMode;
dst.m_GradationIntensity = src.m_GradationIntensity;
dst.m_GradationColorFilter = src.m_GradationColorFilter;
dst.m_GradationColor1 = src.m_GradationColor1;
dst.m_GradationColor2 = src.m_GradationColor2;
dst.m_GradationColor3 = src.m_GradationColor3;
dst.m_GradationColor4 = src.m_GradationColor4;
dst.m_GradationGradient = src.m_GradationGradient;
dst.m_GradationOffset = src.m_GradationOffset;
dst.m_GradationScale = src.m_GradationScale;
dst.m_GradationRotation = src.m_GradationRotation;
dst.m_DetailFilter = src.m_DetailFilter;
dst.m_DetailIntensity = src.m_DetailIntensity;
dst.m_DetailColor = src.m_DetailColor;
dst.m_DetailThreshold = src.m_DetailThreshold;
dst.m_DetailTex = src.m_DetailTex;
dst.m_DetailTexScale = src.m_DetailTexScale;
dst.m_DetailTexOffset = src.m_DetailTexOffset;
dst.m_DetailTexSpeed = src.m_DetailTexSpeed;
dst.m_Flip = src.m_Flip;
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: c1b6988bc8fdf48b4896110606a86b61
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {fileID: 2800000, guid: 5b93acc4527c740459bbfbd3404191be, type: 3}
userData:
assetBundleName:
assetBundleVariant:
+51 -28
View File
@@ -1,3 +1,4 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
@@ -6,19 +7,18 @@ using Coffee.UIEffectInternal;
using UnityEditor;
using UnityEngine;
using UnityEngine.Rendering;
using Object = UnityEngine.Object;
namespace Coffee.UIEffects
{
public class UIEffectProjectSettings : PreloadedProjectSettings<UIEffectProjectSettings>
{
[Tooltip(
"The sensitivity of the transformation when `Use Target Transform` is enabled in the `UIEffectReplica` component.")]
[Header("Setting")]
[SerializeField]
private TransformSensitivity m_TransformSensitivity = TransformSensitivity.Medium;
internal List<UIEffect> m_RuntimePresets = new List<UIEffect>();
[SerializeField]
internal List<UIEffect> m_RuntimePresets = new List<UIEffect>();
internal List<UIEffectPreset> m_RuntimePresetsV2 = new List<UIEffectPreset>();
[Header("Editor")]
[Tooltip("Use HDR color pickers on color fields.")]
@@ -36,29 +36,24 @@ namespace Coffee.UIEffects
public static ShaderVariantCollection shaderVariantCollection => shaderRegistry.shaderVariantCollection;
public static TransformSensitivity transformSensitivity
{
get => instance.m_TransformSensitivity;
set => instance.m_TransformSensitivity = value;
}
public static bool useHdrColorPicker
{
get => instance.m_UseHDRColorPicker;
set => instance.m_UseHDRColorPicker = value;
}
public static void RegisterRuntimePreset(UIEffect effect)
public static void RegisterRuntimePreset(UIEffectPreset preset)
{
// Already registered.
if (!effect || LoadRuntimePreset(effect.name)) return;
if (!preset || instance.m_RuntimePresetsV2.Contains(preset)) return;
instance.m_RuntimePresets.Add(effect);
instance.m_RuntimePresetsV2.Add(preset);
#if UNITY_EDITOR
EditorUtility.SetDirty(instance);
#endif
}
[Obsolete("LoadRuntimePreset is obsolete. Use LoadPreset instead.", false)]
public static UIEffect LoadRuntimePreset(string presetName)
{
for (var i = 0; i < instance.m_RuntimePresets.Count; i++)
@@ -73,6 +68,21 @@ namespace Coffee.UIEffects
return null;
}
public static Object LoadPreset(string presetName)
{
for (var i = 0; i < instance.m_RuntimePresetsV2.Count; i++)
{
var preset = instance.m_RuntimePresetsV2[i];
if (preset && preset.name == presetName)
{
return preset;
}
}
#pragma warning disable CS0618
return LoadRuntimePreset(presetName);
#pragma warning restore CS0618
}
#if UNITY_EDITOR
private const string k_PresetDir = "UIEffectPresets";
private const string k_PresetSaveDir = "Assets/ProjectSettings/" + k_PresetDir;
@@ -83,10 +93,10 @@ namespace Coffee.UIEffects
{
#if UNITY_2023_2_OR_NEWER
const string tmpSupport = "TextMeshPro Support (Unity 6)";
const string version = "v5.7.0 (Unity 6)";
const string version = "v5.8.0 (Unity 6)";
#else
const string tmpSupport = "TextMeshPro Support";
const string version = "v5.7.0";
const string version = "v5.8.0";
#endif
ShaderSampleImporter.RegisterShaderSamples(new[]
{
@@ -101,8 +111,8 @@ namespace Coffee.UIEffects
("Hidden/TextMeshPro/Mobile/Distance Field (UIEffect)", tmpSupport, version),
// ShaderGraph Support
("Shader Graphs/UISample (UIEffect)", "ShaderGraph Support (Unity 6 BuiltIn)", "v5.7.0"),
("Shader Graphs/UISampleURP (UIEffect)", "ShaderGraph Support (Unity 6 URP)", "v5.7.0")
("Shader Graphs/UISample (UIEffect)", "ShaderGraph Support (Unity 6 BuiltIn)", "v5.8.0"),
("Shader Graphs/UISampleURP (UIEffect)", "ShaderGraph Support (Unity 6 URP)", "v5.8.0")
});
ShaderSampleImporter.RegisterShaderAliases(new[]
{
@@ -223,11 +233,26 @@ namespace Coffee.UIEffects
.ToArray();
return AssetDatabase.FindAssets("t:prefab", dirs)
.Select(AssetDatabase.GUIDToAssetPath)
.OrderBy(x => AssetImporter.GetAtPath(x).userData)
.Select(AssetDatabase.LoadAssetAtPath<UIEffect>)
.Where(x => x)
.ToArray();
}
internal static UIEffectPreset[] LoadEditorPresetsV2()
{
var dirs = AssetDatabase.FindAssets(k_PresetDir + " t:folder")
.Select(AssetDatabase.GUIDToAssetPath)
.Where(x => Path.GetFileName(x) == k_PresetDir)
.OrderBy(x => x.StartsWith("Packages/com.coffee.ui-effect/"))
.ToArray();
return AssetDatabase.FindAssets("t:UIEffectPreset", dirs)
.Select(AssetDatabase.GUIDToAssetPath)
.OrderBy(x => AssetImporter.GetAtPath(x).userData)
.Select(AssetDatabase.LoadAssetAtPath<UIEffectPreset>)
.ToArray();
}
internal static void SaveAsNewPreset(UIEffect effect)
{
if (!Directory.Exists(k_PresetSaveDir))
@@ -235,18 +260,16 @@ namespace Coffee.UIEffects
Directory.CreateDirectory(k_PresetSaveDir);
}
var prefabPath = EditorUtility.SaveFilePanel("Save Preset", k_PresetSaveDir, effect.name, "prefab");
if (string.IsNullOrEmpty(prefabPath)) return;
var path = EditorUtility.SaveFilePanel("Save Preset", k_PresetSaveDir, effect.name, "asset");
if (string.IsNullOrEmpty(path)) return;
var prefab = new GameObject();
prefab.SetActive(false);
path = FileUtil.GetProjectRelativePath(path);
path = AssetDatabase.GenerateUniqueAssetPath(path);
var preset = prefab.AddComponent<UIEffect>();
preset.LoadPreset(effect);
var prefabAsset = PrefabUtility.SaveAsPrefabAsset(prefab, prefabPath);
EditorGUIUtility.PingObject(prefabAsset);
DestroyImmediate(prefab);
var preset = CreateInstance<UIEffectPreset>();
effect.SavePreset(preset, false);
AssetDatabase.CreateAsset(preset, path);
EditorGUIUtility.PingObject(preset);
}
[SettingsProvider]
@@ -255,7 +278,7 @@ namespace Coffee.UIEffects
return new PreloadedProjectSettingsProvider("Project/UI/UI Effect");
}
internal static (string path, bool builtin) GetPresetPath(UIEffect preset)
internal static (string path, bool builtin) GetPresetPath(Object preset)
{
var assetPath = AssetDatabase.GetAssetPath(preset);
var builtin = assetPath.StartsWith("Packages/com.coffee.ui-effect/");
+76 -16
View File
@@ -1,12 +1,14 @@
using Coffee.UIEffectInternal;
using System.Linq;
using Coffee.UIEffectInternal;
using UnityEngine;
namespace Coffee.UIEffects
{
[Icon("Packages/com.coffee.ui-effect/Editor/UIEffectIconIcon.png")]
public class UIEffectReplica : UIEffectBase
public class UIEffectReplica : UIEffectBase, ISerializationCallbackReceiver
{
[SerializeField] private UIEffect m_Target;
[SerializeField] private UIEffectPreset m_Preset;
[SerializeField] private bool m_UseTargetTransform = true;
[PowerRange(0.01f, 100, 10f)]
@@ -28,12 +30,26 @@ namespace Coffee.UIEffects
{
if (m_Target == value) return;
m_Target = value;
m_Preset = null;
RefreshTarget(m_Target);
SetVerticesDirty();
SetMaterialDirty();
}
}
public UIEffectPreset preset
{
get => m_Preset;
set
{
if (m_Preset == value) return;
m_Preset = value;
RefreshTarget(null);
SetVerticesDirty();
SetMaterialDirty();
}
}
public bool useTargetTransform
{
get => m_UseTargetTransform;
@@ -79,8 +95,6 @@ namespace Coffee.UIEffects
}
}
public override Flip flip => target ? target.flip : 0;
public override float actualSamplingScale => Mathf.Clamp(m_SamplingScale, 0.01f, 100);
public override bool canModifyShape => m_AllowToModifyMeshShape;
@@ -91,10 +105,13 @@ namespace Coffee.UIEffects
{
get
{
if (!target) return null;
if (!isTargetInScene) return base.context;
// Following the preset/preset-target.
if (preset || (target && !isTargetInScene)) return base.context;
return target.isActiveAndEnabled ? target.context : null;
// Following the instantiated target.
return target && target.isActiveAndEnabled && isTargetInScene
? target.context
: null;
}
}
@@ -108,7 +125,11 @@ namespace Coffee.UIEffects
protected override void OnEnable()
{
RefreshTarget(target);
if (!preset)
{
RefreshTarget(target);
}
base.OnEnable();
}
@@ -133,8 +154,16 @@ namespace Coffee.UIEffects
internal override void SetEnablePreviewIfSelected(GameObject[] selection)
{
if (!isTargetInScene) return;
target.SetEnablePreviewIfSelected(selection);
// Following the instantiated target.
if (isTargetInScene)
{
target.SetEnablePreviewIfSelected(selection);
}
// Following the preset/preset-target.
else if (context != null)
{
context.SetEnablePreview(selection.Contains(gameObject), effectMaterial);
}
}
#endif
@@ -160,20 +189,34 @@ namespace Coffee.UIEffects
}
}
internal override void UpdateContext(UIEffectContext c)
internal override void UpdateContext(UIEffectContext dst)
{
if (target && !isTargetInScene)
// Following the preset.
if (preset)
{
target.UpdateContext(c);
preset.UpdateContext(dst);
}
// Following the preset-target.
else if (target && !isTargetInScene)
{
target.UpdateContext(dst);
}
}
public override void ApplyContextToMaterial(Material material)
{
if (!isActiveAndEnabled || !target) return;
if (isTargetInScene && !target.isActiveAndEnabled) return;
if (!isActiveAndEnabled && !preset && !target) return;
base.ApplyContextToMaterial(material);
// Following the preset/preset-target.
if (preset || (target && !isTargetInScene))
{
base.ApplyContextToMaterial(material);
}
// Following the instantiated target.
else if (isTargetInScene && target.isActiveAndEnabled)
{
base.ApplyContextToMaterial(material);
}
}
public override void SetRate(float rate, UIEffectTweener.CullingMask mask)
@@ -186,5 +229,22 @@ namespace Coffee.UIEffects
return target.IsRaycastLocationValid(sp, eventCamera);
}
public void OnBeforeSerialize()
{
}
public void OnAfterDeserialize()
{
if (m_Preset)
{
m_Target = null;
}
else if (m_Target)
{
m_Preset = null;
}
}
}
}
@@ -80,10 +80,10 @@ namespace Coffee.UIEffects
private static readonly Func<UIVertex, UIVertex, UIVertex, float, UIVertex> s_OnLerpVertex =
null;
private static readonly Func<UIVertex, UIVertex> s_OnMarkAsShadow =
vt =>
private static readonly Func<UIVertex, float, UIVertex> s_OnMarkAsShadow =
(vt, s) =>
{
vt.uv1.x -= 2;
vt.uv1.x -= s;
return vt;
};
+11 -9
View File
@@ -6,7 +6,7 @@ namespace Coffee.UIEffects
{
public static class ShadowUtil
{
public static Func<UIVertex, UIVertex> onMarkAsShadow;
public static Func<UIVertex, float, UIVertex> onMarkAsShadow;
public static void DoShadow(List<UIVertex> verts, Vector2[] vectors, Vector2 distance, int iteration,
float fade)
@@ -30,14 +30,7 @@ namespace Coffee.UIEffects
{
if (onMarkAsShadow != null)
{
verts[i] = onMarkAsShadow(verts[i]);
}
else
{
var vt = verts[i];
vt.uv0.z -= 8;
vt.uv0.w -= 8;
verts[i] = vt;
verts[i] = onMarkAsShadow(verts[i], 2);
}
}
}
@@ -54,6 +47,15 @@ namespace Coffee.UIEffects
var offset = distance.y - (scale + 1) * pivot * height;
var range = new Vector2(rect2.yMin, rect2.yMax);
ApplyMirror(verts, count, rate, range, scale, offset, fade);
// Mark as shadow vertices.
for (var i = 0; i < verts.Count - count; i++)
{
if (onMarkAsShadow != null)
{
verts[i] = onMarkAsShadow(verts[i], 4);
}
}
}
private static void ApplyMirror(List<UIVertex> verts, int count, float rate, Vector2 range, float scale,
+4 -5
View File
@@ -91,10 +91,10 @@ namespace Coffee.UIEffects
};
#endif
private static readonly Func<UIVertex, UIVertex> s_OnMarkAsShadow =
vt =>
private static readonly Func<UIVertex, float, UIVertex> s_OnMarkAsShadow =
(vt, s) =>
{
vt.uv2.x -= 2;
vt.uv2.x -= s;
return vt;
};
@@ -254,14 +254,13 @@ namespace Coffee.UIEffects
replica.target = pEffect;
replica.useTargetTransform = true;
replica.customRoot = null;
replica.flip = pEffect.flip;
}
else if (effect is UIEffectReplica pReplica && pReplica.isActiveAndEnabled)
{
replica.target = pReplica.target;
replica.preset = pReplica.preset;
replica.useTargetTransform = pReplica.useTargetTransform;
replica.customRoot = pReplica.customRoot;
replica.flip = pReplica.flip;
}
else
{
@@ -31,6 +31,7 @@ SpriteAtlas:
m_CrunchedCompression: 0
m_AllowsAlphaSplitting: 0
m_Overridden: 0
m_IgnorePlatformSupport: 0
m_AndroidETC2FallbackOverride: 0
m_ForceMaximumCompressionQuality_BC6H_BC7: 1
packingSettings:
@@ -48,6 +49,14 @@ SpriteAtlas:
bindAsDefault: 1
isAtlasV2: 0
cachedData: {fileID: 0}
packedSpriteRenderDataKeys:
- 2ee815c0807434e9091770d1c6cdc70b: 21300000
- 098475820cf634867a339bb9af940722: 21300000
- 03b5a015427324a419a5ddbd5d5a6551: 21300000
- e822d767ed19641dcaf9831e1c8a742a: 21300000
- 9617fea85692e4f5fb65fb2ddd4496ce: 21300000
- 1851730bef7524e58b285a364983e21e: 21300000
- be1fa55f69843fb4aaf4d0ff56004fba: 21300000
m_MasterAtlas: {fileID: 0}
m_PackedSprites:
- {fileID: 21300000, guid: 2ee815c0807434e9091770d1c6cdc70b, type: 3}
@@ -9951,6 +9951,517 @@ MonoBehaviour:
m_ChildScaleWidth: 0
m_ChildScaleHeight: 0
m_ReverseArrangement: 0
--- !u!1001 &906901609
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 2003383601}
m_Modifications:
- target: {fileID: 603320123414190803, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_Text
value: 'Detail
Subtractive'
objectReference: {fileID: 0}
- target: {fileID: 2374886929518706459, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_Name
value: Detail Subtractive
objectReference: {fileID: 0}
- target: {fileID: 2381434932886513042, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3775897659628443270, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 3775897659628443270, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 3775897659628443270, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_RootOrder
value: 58
objectReference: {fileID: 0}
- target: {fileID: 3775897659628443270, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_AnchorMax.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3775897659628443270, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3775897659628443270, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3775897659628443270, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3775897659628443270, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3775897659628443270, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3775897659628443270, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3775897659628443270, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3775897659628443270, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3775897659628443270, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3775897659628443270, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 3775897659628443270, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 3775897659628443270, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 3775897659628443270, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3775897659628443270, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_AnchoredPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3775897659628443270, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3775897659628443270, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3775897659628443270, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 5537784035359440648, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_Enabled
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6611560657749526626, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_Color.b
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 6611560657749526626, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_Color.g
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6611560657749526626, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_Color.r
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 6611560657749526626, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_BlendType
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6611560657749526626, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_ShadowFade
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6611560657749526626, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_ShadowMode
value: 5
objectReference: {fileID: 0}
- target: {fileID: 6611560657749526626, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_ColorFilter
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6611560657749526626, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_TargetRange
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6611560657749526626, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_DstBlendMode
value: 10
objectReference: {fileID: 0}
- target: {fileID: 6611560657749526626, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_SrcBlendMode
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6611560657749526626, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_TransitionTex
value:
objectReference: {fileID: 0}
- target: {fileID: 6611560657749526626, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_SamplingFilter
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6611560657749526626, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_TransitionRate
value: 0.107
objectReference: {fileID: 0}
- target: {fileID: 6611560657749526626, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_TransitionWidth
value: 0.4
objectReference: {fileID: 0}
- target: {fileID: 6611560657749526626, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_ShadowDistance.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 6611560657749526626, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_ShadowDistance.y
value: 8.73
objectReference: {fileID: 0}
- target: {fileID: 6611560657749526626, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_TransitionFilter
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6611560657749526626, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_SamplingIntensity
value: 1
objectReference: {fileID: 0}
- target: {fileID: 6611560657749526626, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_TransitionColor.b
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6611560657749526626, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_TransitionColor.g
value: 0.7372549
objectReference: {fileID: 0}
- target: {fileID: 6611560657749526626, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_TransitionColor.r
value: 2.9960785
objectReference: {fileID: 0}
- target: {fileID: 6611560657749526626, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_TransitionSoftness
value: 0.3
objectReference: {fileID: 0}
- target: {fileID: 6611560657749526626, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_ShadowEffectOnOrigin
value: 0
objectReference: {fileID: 0}
- target: {fileID: 6611560657749526626, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_TransitionTexScale.x
value: 1.5
objectReference: {fileID: 0}
- target: {fileID: 6611560657749526626, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_TransitionTexScale.y
value: 6
objectReference: {fileID: 0}
- target: {fileID: 6611560657749526626, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_TransitionColorFilter
value: 4
objectReference: {fileID: 0}
- target: {fileID: 6611560657749526626, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_TransitionTexOffset.x
value: -0.8
objectReference: {fileID: 0}
- target: {fileID: 6611560657749526626, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_TransitionTexOffset.y
value: -2.5
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_EdgeMode
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_DetailTex
value:
objectReference: {fileID: 2800000, guid: 03b5a015427324a419a5ddbd5d5a6551, type: 3}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_EdgeWidth
value: 0.11
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_ShadowFade
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_ShadowMode
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_EdgeColor.b
value: 2.550262
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_EdgeColor.g
value: 0.95722604
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_EdgeColor.r
value: 3.8289042
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_DetailFilter
value: 6
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationMode
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_EdgeShinyWidth
value: 0.2
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_EdgeColorFilter
value: 6
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_ShadowDistance.x
value: 0.587
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_ShadowDistance.y
value: 9.45
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationColor1.b
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationColor1.g
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationColor1.r
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationColor2.b
value: 0.15300035
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationColor2.g
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationColor2.r
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_ShadowMirrorScale
value: 0.516
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_EdgeShinyAutoPlaySpeed
value: 0.3333
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationGradient.ctime1
value: 9830
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationGradient.ctime2
value: 18724
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationGradient.ctime3
value: 28720
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationGradient.ctime4
value: 38165
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationGradient.ctime5
value: 46838
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationGradient.ctime6
value: 56173
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationGradient.ctime7
value: 65535
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationGradient.key0.b
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationGradient.key0.g
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationGradient.key1.b
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationGradient.key1.g
value: 0.8571428
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationGradient.key2.g
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationGradient.key2.r
value: 0.2857144
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationGradient.key3.b
value: 0.57142854
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationGradient.key3.g
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationGradient.key4.b
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationGradient.key4.g
value: 0.5714288
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationGradient.key5.b
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationGradient.key5.r
value: 0.28571415
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationGradient.key6.b
value: 0.8571429
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationGradient.key6.r
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationGradient.key7.r
value: 1
objectReference: {fileID: 0}
- target: {fileID: 8169916092684545235, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
propertyPath: m_GradationGradient.m_NumColorKeys
value: 8
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects: []
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 46022f153b5d448aea4b360e3af68565, type: 3}
--- !u!224 &906901610 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 3775897659628443270, guid: 46022f153b5d448aea4b360e3af68565,
type: 3}
m_PrefabInstance: {fileID: 906901609}
m_PrefabAsset: {fileID: 0}
--- !u!1 &938790788
GameObject:
m_ObjectHideFlags: 0
@@ -20543,8 +21054,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 631.50006, y: 0}
m_SizeDelta: {x: 1263.0001, y: 0}
m_AnchoredPosition: {x: 631.5, y: 0}
m_SizeDelta: {x: 1263, y: 0}
m_Pivot: {x: 0.5, y: 1}
--- !u!114 &1801898971
MonoBehaviour:
@@ -22324,7 +22835,7 @@ MonoBehaviour:
m_HandleRect: {fileID: 1947276361}
m_Direction: 2
m_Value: 1
m_Size: 0.36909872
m_Size: 0.4507114
m_NumberOfSteps: 0
m_OnValueChanged:
m_PersistentCalls:
@@ -22537,6 +23048,7 @@ RectTransform:
- {fileID: 1851422495}
- {fileID: 1920790156}
- {fileID: 519027396}
- {fileID: 906901610}
- {fileID: 1671506947}
- {fileID: 806721016}
- {fileID: 394021670}
@@ -22548,8 +23060,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 631.50006, y: -10}
m_SizeDelta: {x: 1263.0001, y: 0}
m_AnchoredPosition: {x: 631.5, y: -10}
m_SizeDelta: {x: 1263, y: 0}
m_Pivot: {x: 0.5, y: 1}
--- !u!114 &2003383602
MonoBehaviour:
@@ -295,7 +295,6 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_ToneFilter: 0
m_ToneIntensity: 1
m_ToneParams: {x: 0, y: 0, z: 0, w: 0}
m_ColorFilter: 0
m_ColorIntensity: 0.344
m_Color: {r: 0, g: 1.7098039, b: 4, a: 1}
@@ -340,6 +339,8 @@ MonoBehaviour:
m_ShadowColor: {r: 1, g: 1, b: 1, a: 1}
m_ShadowColorGlow: 0
m_GradationMode: 0
m_GradationIntensity: 1
m_GradationColorFilter: 1
m_GradationColor1: {r: 1, g: 1, b: 1, a: 1}
m_GradationColor2: {r: 1, g: 1, b: 1, a: 1}
m_GradationColor3: {r: 1, g: 1, b: 1, a: 1}
@@ -382,11 +383,23 @@ MonoBehaviour:
m_EdgeWidth: 0.5
m_EdgeColorFilter: 4
m_EdgeColor: {r: 1, g: 1, b: 1, a: 1}
m_EdgeColorGlow: 0
m_EdgeShinyRate: 0.5
m_EdgeShinyWidth: 0.5
m_EdgeShinyAutoPlaySpeed: 1
m_PatternArea: 1
m_DetailFilter: 0
m_DetailIntensity: 1
m_DetailThreshold:
m_Min: 0
m_Max: 1
m_DetailColor: {r: 1, g: 1, b: 1, a: 1}
m_DetailTex: {fileID: 0}
m_DetailTexScale: {x: 1, y: 1}
m_DetailTexOffset: {x: 0, y: 0}
m_DetailTexSpeed: {x: 0, y: 0}
m_CustomRoot: {fileID: 0}
m_Flip: 0
--- !u!1 &973375176
GameObject:
m_ObjectHideFlags: 0
@@ -592,7 +605,7 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 189, y: -165}
m_AnchoredPosition: {x: 189, y: -117}
m_SizeDelta: {x: 415.4, y: 111.41}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &1421004028
@@ -609,7 +622,6 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_ToneFilter: 0
m_ToneIntensity: 1
m_ToneParams: {x: 0, y: 0, z: 0, w: 0}
m_ColorFilter: 0
m_ColorIntensity: 1
m_Color: {r: 0.7454045, g: 0.18447503, b: 0.000303527, a: 1}
@@ -654,6 +666,8 @@ MonoBehaviour:
m_ShadowColor: {r: 1, g: 1, b: 1, a: 1}
m_ShadowColorGlow: 0
m_GradationMode: 0
m_GradationIntensity: 1
m_GradationColorFilter: 1
m_GradationColor1: {r: 1, g: 1, b: 1, a: 1}
m_GradationColor2: {r: 1, g: 1, b: 1, a: 1}
m_GradationColor3: {r: 1, g: 1, b: 1, a: 1}
@@ -696,11 +710,23 @@ MonoBehaviour:
m_EdgeWidth: 0.5
m_EdgeColorFilter: 4
m_EdgeColor: {r: 1, g: 1, b: 1, a: 1}
m_EdgeColorGlow: 0
m_EdgeShinyRate: 0.5
m_EdgeShinyWidth: 0.5
m_EdgeShinyAutoPlaySpeed: 1
m_PatternArea: 1
m_DetailFilter: 0
m_DetailIntensity: 1
m_DetailThreshold:
m_Min: 0
m_Max: 1
m_DetailColor: {r: 1, g: 1, b: 1, a: 1}
m_DetailTex: {fileID: 0}
m_DetailTexScale: {x: 1, y: 1}
m_DetailTexOffset: {x: 0, y: 0}
m_DetailTexSpeed: {x: 0, y: 0}
m_CustomRoot: {fileID: 0}
m_Flip: 0
--- !u!114 &1421004029
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -853,7 +879,6 @@ MonoBehaviour:
m_EditorClassIdentifier:
m_ToneFilter: 1
m_ToneIntensity: 0.75
m_ToneParams: {x: 0, y: 0, z: 0, w: 0}
m_ColorFilter: 6
m_ColorIntensity: 0.6
m_Color: {r: 0.16862746, g: 0, b: 0.12038653, a: 1}
@@ -898,6 +923,8 @@ MonoBehaviour:
m_ShadowColor: {r: 1, g: 1, b: 1, a: 1}
m_ShadowColorGlow: 0
m_GradationMode: 0
m_GradationIntensity: 1
m_GradationColorFilter: 1
m_GradationColor1: {r: 1, g: 1, b: 1, a: 1}
m_GradationColor2: {r: 1, g: 1, b: 1, a: 1}
m_GradationColor3: {r: 1, g: 1, b: 1, a: 1}
@@ -940,11 +967,23 @@ MonoBehaviour:
m_EdgeWidth: 0.5
m_EdgeColorFilter: 4
m_EdgeColor: {r: 1, g: 1, b: 1, a: 1}
m_EdgeColorGlow: 0
m_EdgeShinyRate: 0.5
m_EdgeShinyWidth: 0.5
m_EdgeShinyAutoPlaySpeed: 1
m_PatternArea: 1
m_DetailFilter: 0
m_DetailIntensity: 1
m_DetailThreshold:
m_Min: 0
m_Max: 1
m_DetailColor: {r: 1, g: 1, b: 1, a: 1}
m_DetailTex: {fileID: 0}
m_DetailTexScale: {x: 1, y: 1}
m_DetailTexOffset: {x: 0, y: 0}
m_DetailTexSpeed: {x: 0, y: 0}
m_CustomRoot: {fileID: 0}
m_Flip: 0
--- !u!114 &1567169364
MonoBehaviour:
m_ObjectHideFlags: 0
@@ -60,7 +60,7 @@ half4 frag_override(PackedVaryings packedInput) : SV_TARGET
// ==== SOFTMASKABLE END ====
#if defined(_ALPHATEST_ON) || defined(_BUILTIN_ALPHATEST_ON)
clip(color.a - surfaceDescription.Alpha);
clip(color.a - surfaceDescription.AlphaClipThreshold);
#endif
#if UNITY_UI_ALPHACLIP
@@ -26,6 +26,12 @@
},
{
"m_Id": "867db961355a4c1ea898b69d9e6549b0"
},
{
"m_Id": "a76cdcf36ae243e5a5ea033c7d40d34f"
},
{
"m_Id": "23e0b7c820e7452ab73c3bec44cf0e48"
}
],
"m_GroupDatas": [],
@@ -92,6 +98,12 @@
},
{
"m_Id": "d326ef5f90af4c7996e7e0c915e57983"
},
{
"m_Id": "a76cdcf36ae243e5a5ea033c7d40d34f"
},
{
"m_Id": "23e0b7c820e7452ab73c3bec44cf0e48"
}
]
},
@@ -168,6 +180,85 @@
"m_CustomEditorGUI": ""
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "23e0b7c820e7452ab73c3bec44cf0e48",
"m_Group": {
"m_Id": ""
},
"m_Name": "SurfaceDescription.AlphaClipThreshold",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "3c6f2af22741431faed8a2606630029a"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "SurfaceDescription.AlphaClipThreshold"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Vector1MaterialSlot",
"m_ObjectId": "3c6f2af22741431faed8a2606630029a",
"m_Id": 0,
"m_DisplayName": "Alpha Clip Threshold",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "AlphaClipThreshold",
"m_StageCapability": 2,
"m_Value": 0.009999999776482582,
"m_DefaultValue": 0.5,
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot",
"m_ObjectId": "5891f1777feb46cdbd85b489f87bfc69",
"m_Id": 0,
"m_DisplayName": "Emission",
"m_SlotType": 0,
"m_Hidden": false,
"m_ShaderOutputName": "Emission",
"m_StageCapability": 2,
"m_Value": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_DefaultValue": {
"x": 0.0,
"y": 0.0,
"z": 0.0
},
"m_Labels": [],
"m_ColorMode": 1,
"m_DefaultColor": {
"r": 0.0,
"g": 0.0,
"b": 0.0,
"a": 1.0
}
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.Texture2DMaterialSlot",
@@ -402,6 +493,40 @@
"m_Labels": []
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.BlockNode",
"m_ObjectId": "a76cdcf36ae243e5a5ea033c7d40d34f",
"m_Group": {
"m_Id": ""
},
"m_Name": "SurfaceDescription.Emission",
"m_DrawState": {
"m_Expanded": true,
"m_Position": {
"serializedVersion": "2",
"x": 0.0,
"y": 0.0,
"width": 0.0,
"height": 0.0
}
},
"m_Slots": [
{
"m_Id": "5891f1777feb46cdbd85b489f87bfc69"
}
],
"synonyms": [],
"m_Precision": 0,
"m_PreviewExpanded": true,
"m_DismissedVersion": 0,
"m_PreviewMode": 0,
"m_CustomColors": {
"m_SerializableColors": []
},
"m_SerializedDescriptor": "SurfaceDescription.Emission"
}
{
"m_SGVersion": 0,
"m_Type": "UnityEditor.ShaderGraph.ColorRGBMaterialSlot",
@@ -4,7 +4,7 @@ ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData: v5.7.0
userData: v5.8.0
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
@@ -4,7 +4,7 @@ ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData: v5.7.0
userData: v5.8.0
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 625f186215c104763be7675aa2d941aa, type: 3}
@@ -63,7 +63,7 @@ SubShader {
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN
#pragma shader_feature_local_fragment _ EDGE_PLAIN EDGE_SHINY
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_SUBTRACTIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_RADIAL GRADATION_COLOR2 GRADATION_COLOR4
#pragma shader_feature_fragment _ UIEFFECT_EDITOR
@@ -4,6 +4,6 @@ ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData: v5.7.0 (Unity 6)
userData: v5.8.0 (Unity 6)
assetBundleName:
assetBundleVariant:
@@ -62,7 +62,7 @@ SubShader{
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN
#pragma shader_feature_local_fragment _ EDGE_PLAIN EDGE_SHINY
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_SUBTRACTIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_RADIAL GRADATION_COLOR2 GRADATION_COLOR4
#pragma shader_feature_fragment _ UIEFFECT_EDITOR
@@ -4,6 +4,6 @@ ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData: v5.7.0 (Unity 6)
userData: v5.8.0 (Unity 6)
assetBundleName:
assetBundleVariant:
@@ -132,7 +132,7 @@ SubShader {
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN
#pragma shader_feature_local_fragment _ EDGE_PLAIN EDGE_SHINY
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_SUBTRACTIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_RADIAL GRADATION_COLOR2 GRADATION_COLOR4
#pragma shader_feature_fragment _ UIEFFECT_EDITOR
@@ -4,6 +4,6 @@ ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData: v5.7.0 (Unity 6)
userData: v5.8.0 (Unity 6)
assetBundleName:
assetBundleVariant:
@@ -133,7 +133,7 @@ SubShader {
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN
#pragma shader_feature_local_fragment _ EDGE_PLAIN EDGE_SHINY
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_SUBTRACTIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_RADIAL GRADATION_COLOR2 GRADATION_COLOR4
#pragma shader_feature_fragment _ UIEFFECT_EDITOR
@@ -4,6 +4,6 @@ ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData: v5.7.0 (Unity 6)
userData: v5.8.0 (Unity 6)
assetBundleName:
assetBundleVariant:
@@ -94,7 +94,7 @@ SubShader {
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN
#pragma shader_feature_local_fragment _ EDGE_PLAIN EDGE_SHINY
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_SUBTRACTIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_RADIAL GRADATION_COLOR2 GRADATION_COLOR4
#pragma shader_feature_fragment _ UIEFFECT_EDITOR
@@ -4,6 +4,6 @@ ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData: v5.7.0 (Unity 6)
userData: v5.8.0 (Unity 6)
assetBundleName:
assetBundleVariant:
@@ -97,7 +97,7 @@ SubShader {
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN
#pragma shader_feature_local_fragment _ EDGE_PLAIN EDGE_SHINY
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_SUBTRACTIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_RADIAL GRADATION_COLOR2 GRADATION_COLOR4
#pragma shader_feature_fragment _ UIEFFECT_EDITOR
@@ -4,6 +4,6 @@ ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData: v5.7.0 (Unity 6)
userData: v5.8.0 (Unity 6)
assetBundleName:
assetBundleVariant:
@@ -95,7 +95,7 @@ SubShader {
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN
#pragma shader_feature_local_fragment _ EDGE_PLAIN EDGE_SHINY
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_SUBTRACTIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_RADIAL GRADATION_COLOR2 GRADATION_COLOR4
#pragma shader_feature_fragment _ UIEFFECT_EDITOR
@@ -4,6 +4,6 @@ ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData: v5.7.0 (Unity 6)
userData: v5.8.0 (Unity 6)
assetBundleName:
assetBundleVariant:
@@ -132,7 +132,7 @@ SubShader {
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN
#pragma shader_feature_local_fragment _ EDGE_PLAIN EDGE_SHINY
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_SUBTRACTIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_RADIAL GRADATION_COLOR2 GRADATION_COLOR4
#pragma shader_feature_fragment _ UIEFFECT_EDITOR
@@ -4,6 +4,6 @@ ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData: v5.7.0 (Unity 6)
userData: v5.8.0 (Unity 6)
assetBundleName:
assetBundleVariant:
@@ -63,7 +63,7 @@ SubShader {
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN
#pragma shader_feature_local_fragment _ EDGE_PLAIN EDGE_SHINY
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_SUBTRACTIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_RADIAL GRADATION_COLOR2 GRADATION_COLOR4
#pragma shader_feature_fragment _ UIEFFECT_EDITOR
@@ -4,6 +4,6 @@ ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData: v5.7.0
userData: v5.8.0
assetBundleName:
assetBundleVariant:
@@ -62,7 +62,7 @@ SubShader{
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN
#pragma shader_feature_local_fragment _ EDGE_PLAIN EDGE_SHINY
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_SUBTRACTIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_RADIAL GRADATION_COLOR2 GRADATION_COLOR4
#pragma shader_feature_fragment _ UIEFFECT_EDITOR
@@ -4,6 +4,6 @@ ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData: v5.7.0
userData: v5.8.0
assetBundleName:
assetBundleVariant:
@@ -132,7 +132,7 @@ SubShader {
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN
#pragma shader_feature_local_fragment _ EDGE_PLAIN EDGE_SHINY
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_SUBTRACTIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_RADIAL GRADATION_COLOR2 GRADATION_COLOR4
#pragma shader_feature_fragment _ UIEFFECT_EDITOR
@@ -4,6 +4,6 @@ ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData: v5.7.0
userData: v5.8.0
assetBundleName:
assetBundleVariant:
@@ -132,7 +132,7 @@ SubShader {
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN
#pragma shader_feature_local_fragment _ EDGE_PLAIN EDGE_SHINY
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_SUBTRACTIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_RADIAL GRADATION_COLOR2 GRADATION_COLOR4
#pragma shader_feature_fragment _ UIEFFECT_EDITOR
@@ -4,6 +4,6 @@ ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData: v5.7.0
userData: v5.8.0
assetBundleName:
assetBundleVariant:
@@ -94,7 +94,7 @@ SubShader {
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN
#pragma shader_feature_local_fragment _ EDGE_PLAIN EDGE_SHINY
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_SUBTRACTIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_RADIAL GRADATION_COLOR2 GRADATION_COLOR4
#pragma shader_feature_fragment _ UIEFFECT_EDITOR
@@ -4,6 +4,6 @@ ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData: v5.7.0
userData: v5.8.0
assetBundleName:
assetBundleVariant:
@@ -97,7 +97,7 @@ SubShader {
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN
#pragma shader_feature_local_fragment _ EDGE_PLAIN EDGE_SHINY
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_SUBTRACTIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_RADIAL GRADATION_COLOR2 GRADATION_COLOR4
#pragma shader_feature_fragment _ UIEFFECT_EDITOR
@@ -4,6 +4,6 @@ ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData: v5.7.0
userData: v5.8.0
assetBundleName:
assetBundleVariant:
@@ -94,7 +94,7 @@ SubShader {
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN
#pragma shader_feature_local_fragment _ EDGE_PLAIN EDGE_SHINY
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_SUBTRACTIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_RADIAL GRADATION_COLOR2 GRADATION_COLOR4
#pragma shader_feature_fragment _ UIEFFECT_EDITOR
@@ -4,6 +4,6 @@ ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData: v5.7.0
userData: v5.8.0
assetBundleName:
assetBundleVariant:
@@ -132,7 +132,7 @@ SubShader {
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN
#pragma shader_feature_local_fragment _ EDGE_PLAIN EDGE_SHINY
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_SUBTRACTIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_RADIAL GRADATION_COLOR2 GRADATION_COLOR4
#pragma shader_feature_fragment _ UIEFFECT_EDITOR
@@ -4,6 +4,6 @@ ShaderImporter:
externalObjects: {}
defaultTextures: []
nonModifiableTextures: []
userData: v5.7.0
userData: v5.8.0
assetBundleName:
assetBundleVariant:
@@ -19,7 +19,30 @@ namespace Coffee.UIEffects
var go = legacy.gameObject;
var legacyContext = legacy.context;
command.context.ConvertTo<UIEffect>();
go.GetComponent<UIEffect>().CopyFrom(legacyContext);
var effect = go.GetComponent<UIEffect>();
effect.toneFilter = legacyContext.m_ToneFilter;
effect.toneIntensity = legacyContext.m_ToneIntensity;
effect.colorFilter = legacyContext.m_ColorFilter;
effect.color = legacyContext.m_Color;
effect.colorIntensity = legacyContext.m_ColorIntensity;
effect.samplingFilter = legacyContext.m_SamplingFilter;
effect.samplingIntensity = legacyContext.m_SamplingIntensity;
effect.transitionFilter = legacyContext.m_TransitionFilter;
effect.transitionRate = legacyContext.m_TransitionRate;
effect.transitionReverse = legacyContext.m_TransitionReverse;
effect.transitionTexture = legacyContext.m_TransitionTex;
effect.transitionRotation = legacyContext.m_TransitionRotation;
effect.transitionKeepAspectRatio = legacyContext.m_TransitionKeepAspectRatio;
effect.transitionWidth = legacyContext.m_TransitionWidth;
effect.transitionSoftness = legacyContext.m_TransitionSoftness;
effect.transitionColorFilter = legacyContext.m_TransitionColorFilter;
effect.transitionColor = legacyContext.m_TransitionColor;
Misc.SetDirty(effect);
}
}
@@ -28,11 +51,11 @@ namespace Coffee.UIEffects
{
var presets = new[]
{
"3b09ad143990c4c8795c6e93760e132a",
"4f70ff0f1e25b4388b9bcb38d619f7bf"
"460881a8263ce454799a8c689c28d8c9",
"b919bc84de9254bcf8f614d392db83bb"
}
.Select(AssetDatabase.GUIDToAssetPath)
.Select(AssetDatabase.LoadAssetAtPath<UIEffect>);
.Select(AssetDatabase.LoadAssetAtPath<UIEffectPreset>);
foreach (var preset in presets)
{
UIEffectProjectSettings.RegisterRuntimePreset(preset);
@@ -213,24 +213,29 @@ namespace Coffee.UIEffects
internal override void UpdateContext(UIEffectContext c)
{
c.transitionFilter = TransitionFilter.Dissolve;
c.transitionRate = m_EffectFactor;
c.transitionTex = m_TransitionTexture;
c.transitionKeepAspectRatio = m_KeepAspectRatio;
c.transitionReverse = m_Reverse;
c.transitionWidth = m_Width / 2;
c.transitionSoftness = m_Softness / 3;
c.transitionColor = m_Color;
c.transitionColorFilter = m_ColorMode.Convert();
c.m_TransitionFilter = TransitionFilter.Dissolve;
c.m_TransitionRate = m_EffectFactor;
c.m_TransitionTex = m_TransitionTexture;
c.m_TransitionKeepAspectRatio = m_KeepAspectRatio;
c.m_TransitionReverse = m_Reverse;
c.m_TransitionWidth = m_Width / 2;
c.m_TransitionSoftness = m_Softness / 3;
c.m_TransitionColor = m_Color;
c.m_TransitionColorFilter = m_ColorMode.Convert();
}
private void LoadDefaultTransitionTextureIfNeeded()
{
if (m_TransitionTexture) return;
var preset = UIEffectProjectSettings.LoadRuntimePreset("Legacy-UIDissolve");
if (!preset) return;
m_TransitionTexture = preset.transitionTexture;
var preset = UIEffectProjectSettings.LoadPreset("Legacy-UIDissolve");
if (preset is UIEffect presetV1)
{
m_TransitionTexture = presetV1.transitionTexture;
}
else if (preset is UIEffectPreset presetV2)
{
m_TransitionTexture = presetV2.m_TransitionTex;
}
}
public override void SetRate(float rate, UIEffectTweener.CullingMask mask)
@@ -183,21 +183,21 @@ namespace Coffee.UIEffects
internal override void UpdateContext(UIEffectContext c)
{
(c.toneFilter, c.samplingFilter) = (m_EffectMode, m_BlurMode).Convert();
if (context.samplingFilter == SamplingFilter.Pixelation)
(c.m_ToneFilter, c.m_SamplingFilter) = (m_EffectMode, m_BlurMode).Convert();
if (context.m_SamplingFilter == SamplingFilter.Pixelation)
{
c.toneIntensity = 0;
c.samplingIntensity = m_EffectFactor;
c.m_ToneIntensity = 0;
c.m_SamplingIntensity = m_EffectFactor;
}
else
{
c.toneIntensity = m_EffectFactor;
c.samplingIntensity = m_BlurFactor;
c.m_ToneIntensity = m_EffectFactor;
c.m_SamplingIntensity = m_BlurFactor;
}
c.colorFilter = m_ColorMode.Convert();
c.colorIntensity = m_ColorFactor;
c.color = m_Color;
c.m_ColorFilter = m_ColorMode.Convert();
c.m_ColorIntensity = m_ColorFactor;
c.m_Color = m_Color;
}
public override void SetRate(float rate, UIEffectTweener.CullingMask mask)
@@ -132,12 +132,12 @@ namespace Coffee.UIEffects
internal override void UpdateContext(UIEffectContext c)
{
c.colorFilter = ColorFilter.HsvModifier;
c.colorIntensity = 1;
c.color = new Color(m_Hue, m_Saturation, m_Value, 1);
c.targetMode = TargetMode.Hue;
c.targetColor = m_TargetColor;
c.targetRange = m_Range;
c.m_ColorFilter = ColorFilter.HsvModifier;
c.m_ColorIntensity = 1;
c.m_Color = new Color(m_Hue, m_Saturation, m_Value, 1);
c.m_TargetMode = TargetMode.Hue;
c.m_TargetColor = m_TargetColor;
c.m_TargetRange = m_Range;
}
}
}
@@ -168,14 +168,14 @@ namespace Coffee.UIEffects
internal override void UpdateContext(UIEffectContext c)
{
c.transitionFilter = TransitionFilter.Shiny;
c.transitionRate = m_EffectFactor;
c.transitionTex = m_TransitionTexture;
c.transitionWidth = m_Width * 2;
c.transitionRotation = m_Rotation;
c.transitionSoftness = m_Softness / 2;
c.transitionColorFilter = 0.5f < m_Gloss ? ColorFilter.MultiplyAdditive : ColorFilter.Additive;
c.transitionColor = new Color(1, 1, 1, m_Brightness);
c.m_TransitionFilter = TransitionFilter.Shiny;
c.m_TransitionRate = m_EffectFactor;
c.m_TransitionTex = m_TransitionTexture;
c.m_TransitionWidth = m_Width * 2;
c.m_TransitionRotation = m_Rotation;
c.m_TransitionSoftness = m_Softness / 2;
c.m_TransitionColorFilter = 0.5f < m_Gloss ? ColorFilter.MultiplyAdditive : ColorFilter.Additive;
c.m_TransitionColor = new Color(1, 1, 1, m_Brightness);
}
public override void SetRate(float rate, UIEffectTweener.CullingMask mask)
@@ -208,9 +208,15 @@ namespace Coffee.UIEffects
private void LoadDefaultTransitionTextureIfNeeded()
{
if (m_TransitionTexture) return;
var preset = UIEffectProjectSettings.LoadRuntimePreset("Legacy-UIShiny");
if (!preset) return;
m_TransitionTexture = preset.transitionTexture;
var preset = UIEffectProjectSettings.LoadPreset("Legacy-UIShiny");
if (preset is UIEffect presetV1)
{
m_TransitionTexture = presetV1.transitionTexture;
}
else if (preset is UIEffectPreset presetV2)
{
m_TransitionTexture = presetV2.m_TransitionTex;
}
}
}
}
@@ -239,23 +239,28 @@ namespace Coffee.UIEffects
internal override void UpdateContext(UIEffectContext c)
{
c.transitionFilter = m_EffectMode.Convert();
c.transitionRate = m_EffectFactor;
c.transitionTex = m_TransitionTexture;
c.transitionKeepAspectRatio = m_KeepAspectRatio;
c.transitionWidth = m_DissolveWidth / 2;
c.transitionSoftness = m_DissolveSoftness / 3;
c.transitionColor = m_DissolveColor;
c.transitionColorFilter = ColorFilter.MultiplyAdditive;
c.m_TransitionFilter = m_EffectMode.Convert();
c.m_TransitionRate = m_EffectFactor;
c.m_TransitionTex = m_TransitionTexture;
c.m_TransitionKeepAspectRatio = m_KeepAspectRatio;
c.m_TransitionWidth = m_DissolveWidth / 2;
c.m_TransitionSoftness = m_DissolveSoftness / 3;
c.m_TransitionColor = m_DissolveColor;
c.m_TransitionColorFilter = ColorFilter.MultiplyAdditive;
}
private void LoadDefaultTransitionTextureIfNeeded()
{
if (m_TransitionTexture) return;
var preset = UIEffectProjectSettings.LoadRuntimePreset("Legacy-UIDissolve");
if (!preset) return;
m_TransitionTexture = preset.transitionTexture;
var preset = UIEffectProjectSettings.LoadPreset("Legacy-UIDissolve");
if (preset is UIEffect presetV1)
{
m_TransitionTexture = presetV1.transitionTexture;
}
else if (preset is UIEffectPreset presetV2)
{
m_TransitionTexture = presetV2.m_TransitionTex;
}
}
}
}
@@ -0,0 +1,118 @@
%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: c1b6988bc8fdf48b4896110606a86b61, type: 3}
m_Name: Legacy-UIDissolve
m_EditorClassIdentifier:
m_ToneFilter: 0
m_ToneIntensity: 1
m_ColorFilter: 0
m_ColorIntensity: 1
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_ColorGlow: 0
m_SamplingFilter: 0
m_SamplingIntensity: 0.5
m_SamplingWidth: 1
m_TransitionFilter: 3
m_TransitionRate: 0.5
m_TransitionReverse: 0
m_TransitionTex: {fileID: 2800000, guid: 4ec2a5e3826e94129b91638b3d8f1b72, type: 3}
m_TransitionTexScale: {x: 1, y: 1}
m_TransitionTexOffset: {x: 0, y: 0}
m_TransitionTexSpeed: {x: 0, y: 0}
m_TransitionRotation: 0
m_TransitionKeepAspectRatio: 1
m_TransitionWidth: 0.15
m_TransitionSoftness: 0.4
m_TransitionRange:
m_Min: 0
m_Max: 1
m_TransitionColorFilter: 6
m_TransitionColor: {r: 0, g: 0.5, b: 1, a: 1}
m_TransitionColorGlow: 0
m_TransitionPatternReverse: 0
m_TransitionAutoPlaySpeed: 0
m_TargetMode: 0
m_TargetColor: {r: 1, g: 1, b: 1, a: 1}
m_TargetRange: 1
m_TargetSoftness: 0.5
m_BlendType: 1
m_SrcBlendMode: 1
m_DstBlendMode: 10
m_ShadowMode: 0
m_ShadowDistance: {x: 1, y: -1}
m_ShadowIteration: 1
m_ShadowFade: 0.9
m_ShadowMirrorScale: 0.5
m_ShadowBlurIntensity: 1
m_ShadowColorFilter: 4
m_ShadowColor: {r: 1, g: 1, b: 1, a: 1}
m_ShadowColorGlow: 0
m_GradationMode: 0
m_GradationIntensity: 1
m_GradationColorFilter: 1
m_GradationColor1: {r: 1, g: 1, b: 1, a: 1}
m_GradationColor2: {r: 1, g: 1, b: 1, a: 1}
m_GradationColor3: {r: 1, g: 1, b: 1, a: 1}
m_GradationColor4: {r: 1, g: 1, b: 1, a: 1}
m_GradationGradient:
serializedVersion: 2
key0: {r: 1, g: 1, b: 1, a: 1}
key1: {r: 1, g: 1, b: 1, a: 1}
key2: {r: 0, g: 0, b: 0, a: 0}
key3: {r: 0, g: 0, b: 0, a: 0}
key4: {r: 0, g: 0, b: 0, a: 0}
key5: {r: 0, g: 0, b: 0, a: 0}
key6: {r: 0, g: 0, b: 0, a: 0}
key7: {r: 0, g: 0, b: 0, a: 0}
ctime0: 0
ctime1: 65535
ctime2: 0
ctime3: 0
ctime4: 0
ctime5: 0
ctime6: 0
ctime7: 0
atime0: 0
atime1: 65535
atime2: 0
atime3: 0
atime4: 0
atime5: 0
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 2
m_NumAlphaKeys: 2
m_GradationOffset: 0
m_GradationScale: 1
m_GradationRotation: 0
m_EdgeMode: 0
m_EdgeWidth: 0.5
m_EdgeColorFilter: 4
m_EdgeColor: {r: 1, g: 1, b: 1, a: 1}
m_EdgeColorGlow: 0
m_EdgeShinyRate: 0.5
m_EdgeShinyWidth: 0.5
m_EdgeShinyAutoPlaySpeed: 1
m_PatternArea: 1
m_DetailFilter: 0
m_DetailIntensity: 1
m_DetailColor: {r: 1, g: 1, b: 1, a: 1}
m_DetailThreshold:
m_Min: 0
m_Max: 1
m_DetailTex: {fileID: 0}
m_DetailTexScale: {x: 1, y: 1}
m_DetailTexOffset: {x: 0, y: 0}
m_DetailTexSpeed: {x: 0, y: 0}
m_Flip: 0
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 460881a8263ce454799a8c689c28d8c9
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -1,79 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &7749463962637935726
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5764462257046744452}
- component: {fileID: 1645081683573595507}
m_Layer: 0
m_Name: Legacy-UIDissolve
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &5764462257046744452
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7749463962637935726}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1645081683573595507
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7749463962637935726}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 938fce054c42f40a3969e27a88d9bdd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ToneFilter: 0
m_ToneIntensity: 1
m_ToneParams: {x: 0, y: 0, z: 0, w: 0}
m_ColorFilter: 0
m_ColorIntensity: 1
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_SamplingFilter: 0
m_SamplingIntensity: 0.5
m_TransitionFilter: 3
m_TransitionRate: 0.5
m_TransitionReverse: 0
m_TransitionTex: {fileID: 2800000, guid: 4ec2a5e3826e94129b91638b3d8f1b72, type: 3}
m_TransitionTexScale: {x: 1, y: 1}
m_TransitionTexOffset: {x: 0, y: 0}
m_TransitionRotation: 0
m_TransitionKeepAspectRatio: 1
m_TransitionWidth: 0.15
m_TransitionSoftness: 0.4
m_TransitionColorFilter: 6
m_TransitionColor: {r: 0, g: 0.5, b: 1, a: 1}
m_TargetMode: 0
m_TargetColor: {r: 1, g: 1, b: 1, a: 1}
m_TargetRange: 1
m_TargetSoftness: 0.5
m_BlendType: 1
m_SrcBlendMode: 1
m_DstBlendMode: 10
m_ShadowMode: 0
m_ShadowDistance: {x: 1, y: -1}
m_ShadowIteration: 1
m_ShadowFade: 0.9
m_ShadowEffectOnOrigin: 0
m_ShadowMirrorScale: 0.5
@@ -0,0 +1,118 @@
%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: c1b6988bc8fdf48b4896110606a86b61, type: 3}
m_Name: Legacy-UIShiny
m_EditorClassIdentifier:
m_ToneFilter: 0
m_ToneIntensity: 1
m_ColorFilter: 0
m_ColorIntensity: 1
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_ColorGlow: 0
m_SamplingFilter: 0
m_SamplingIntensity: 0.5
m_SamplingWidth: 1
m_TransitionFilter: 4
m_TransitionRate: 0.5
m_TransitionReverse: 0
m_TransitionTex: {fileID: 2800000, guid: 297e4244884ca46788412fdf92bbdb8b, type: 3}
m_TransitionTexScale: {x: 1, y: 1}
m_TransitionTexOffset: {x: 0, y: 0}
m_TransitionTexSpeed: {x: 0, y: 0}
m_TransitionRotation: 0
m_TransitionKeepAspectRatio: 1
m_TransitionWidth: 0.25
m_TransitionSoftness: 0.5
m_TransitionRange:
m_Min: 0
m_Max: 1
m_TransitionColorFilter: 6
m_TransitionColor: {r: 0, g: 1, b: 1, a: 1}
m_TransitionColorGlow: 0
m_TransitionPatternReverse: 0
m_TransitionAutoPlaySpeed: 0
m_TargetMode: 0
m_TargetColor: {r: 1, g: 1, b: 1, a: 1}
m_TargetRange: 1
m_TargetSoftness: 0.5
m_BlendType: 1
m_SrcBlendMode: 1
m_DstBlendMode: 10
m_ShadowMode: 0
m_ShadowDistance: {x: 1, y: -1}
m_ShadowIteration: 1
m_ShadowFade: 0.9
m_ShadowMirrorScale: 0.5
m_ShadowBlurIntensity: 1
m_ShadowColorFilter: 4
m_ShadowColor: {r: 1, g: 1, b: 1, a: 1}
m_ShadowColorGlow: 0
m_GradationMode: 0
m_GradationIntensity: 1
m_GradationColorFilter: 1
m_GradationColor1: {r: 1, g: 1, b: 1, a: 1}
m_GradationColor2: {r: 1, g: 1, b: 1, a: 1}
m_GradationColor3: {r: 1, g: 1, b: 1, a: 1}
m_GradationColor4: {r: 1, g: 1, b: 1, a: 1}
m_GradationGradient:
serializedVersion: 2
key0: {r: 1, g: 1, b: 1, a: 1}
key1: {r: 1, g: 1, b: 1, a: 1}
key2: {r: 0, g: 0, b: 0, a: 0}
key3: {r: 0, g: 0, b: 0, a: 0}
key4: {r: 0, g: 0, b: 0, a: 0}
key5: {r: 0, g: 0, b: 0, a: 0}
key6: {r: 0, g: 0, b: 0, a: 0}
key7: {r: 0, g: 0, b: 0, a: 0}
ctime0: 0
ctime1: 65535
ctime2: 0
ctime3: 0
ctime4: 0
ctime5: 0
ctime6: 0
ctime7: 0
atime0: 0
atime1: 65535
atime2: 0
atime3: 0
atime4: 0
atime5: 0
atime6: 0
atime7: 0
m_Mode: 0
m_ColorSpace: -1
m_NumColorKeys: 2
m_NumAlphaKeys: 2
m_GradationOffset: 0
m_GradationScale: 1
m_GradationRotation: 0
m_EdgeMode: 0
m_EdgeWidth: 0.5
m_EdgeColorFilter: 4
m_EdgeColor: {r: 1, g: 1, b: 1, a: 1}
m_EdgeColorGlow: 0
m_EdgeShinyRate: 0.5
m_EdgeShinyWidth: 0.5
m_EdgeShinyAutoPlaySpeed: 1
m_PatternArea: 1
m_DetailFilter: 0
m_DetailIntensity: 1
m_DetailColor: {r: 1, g: 1, b: 1, a: 1}
m_DetailThreshold:
m_Min: 0
m_Max: 1
m_DetailTex: {fileID: 0}
m_DetailTexScale: {x: 1, y: 1}
m_DetailTexOffset: {x: 0, y: 0}
m_DetailTexSpeed: {x: 0, y: 0}
m_Flip: 0
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: b919bc84de9254bcf8f614d392db83bb
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:
@@ -1,79 +0,0 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!1 &7749463962637935726
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 5764462257046744452}
- component: {fileID: 1645081683573595507}
m_Layer: 0
m_Name: Legacy-UIShiny
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!4 &5764462257046744452
Transform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7749463962637935726}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 1, y: 1, z: 1}
m_ConstrainProportionsScale: 0
m_Children: []
m_Father: {fileID: 0}
m_RootOrder: 0
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
--- !u!114 &1645081683573595507
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 7749463962637935726}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 938fce054c42f40a3969e27a88d9bdd8, type: 3}
m_Name:
m_EditorClassIdentifier:
m_ToneFilter: 0
m_ToneIntensity: 1
m_ToneParams: {x: 0, y: 0, z: 0, w: 0}
m_ColorFilter: 0
m_ColorIntensity: 1
m_Color: {r: 1, g: 1, b: 1, a: 1}
m_SamplingFilter: 0
m_SamplingIntensity: 0.5
m_TransitionFilter: 4
m_TransitionRate: 0.5
m_TransitionReverse: 0
m_TransitionTex: {fileID: 2800000, guid: 297e4244884ca46788412fdf92bbdb8b, type: 3}
m_TransitionTexScale: {x: 1, y: 1}
m_TransitionTexOffset: {x: 0, y: 0}
m_TransitionRotation: 0
m_TransitionKeepAspectRatio: 1
m_TransitionWidth: 0.25
m_TransitionSoftness: 0.5
m_TransitionColorFilter: 6
m_TransitionColor: {r: 0, g: 1, b: 1, a: 1}
m_TargetMode: 0
m_TargetColor: {r: 1, g: 1, b: 1, a: 1}
m_TargetRange: 1
m_TargetSoftness: 0.5
m_BlendType: 1
m_SrcBlendMode: 1
m_DstBlendMode: 10
m_ShadowMode: 0
m_ShadowDistance: {x: 1, y: -1}
m_ShadowIteration: 1
m_ShadowFade: 0.9
m_ShadowEffectOnOrigin: 0
m_ShadowMirrorScale: 0.5
+34 -16
View File
@@ -49,6 +49,7 @@ uniform const int _EdgeColorGlow;
uniform const int _PatternArea;
uniform const float _DetailIntensity;
uniform const float2 _DetailThreshold;
uniform const half4 _DetailColor;
uniform const sampler2D _DetailTex;
uniform const float4 _DetailTex_ST;
uniform const float2 _DetailTex_Speed;
@@ -62,6 +63,8 @@ uniform const sampler2D _GradationTex;
uniform const float4 _GradationTex_ST;
uniform const matrix _RootViewMatrix;
uniform const matrix _GradViewMatrix;
uniform const matrix _MirrorRootViewMatrix;
uniform const matrix _MirrorGradViewMatrix;
uniform const matrix _CanvasToWorldMatrix;
// For performance reasons, limit the sampling of blur in TextMeshPro.
@@ -81,7 +84,7 @@ uniform const matrix _CanvasToWorldMatrix;
#define TRANSITION_NONE (!TRANSITION_FADE && !TRANSITION_CUTOFF && !TRANSITION_DISSOLVE && !TRANSITION_SHINY && !TRANSITION_MASK && !TRANSITION_MELT && !TRANSITION_BURN && !TRANSITION_PATTERN)
#define TARGET_NONE (!TARGET_HUE && !TARGET_LUMINANCE)
#define EDGE_NONE (!EDGE_PLAIN && !EDGE_SHINY)
#define DETAIL_NONE (!DETAIL_MASKING && !DETAIL_MULTIPLY && !DETAIL_ADDITIVE && !DETAIL_REPLACE && !DETAIL_MULTIPLY_ADDITIVE)
#define DETAIL_NONE (!DETAIL_MASKING && !DETAIL_MULTIPLY && !DETAIL_ADDITIVE && !DETAIL_SUBTRACTIVE && !DETAIL_REPLACE && !DETAIL_MULTIPLY_ADDITIVE)
#define GRADATION_NONE (!GRADATION_GRADIENT && !GRADATION_RADIAL && !GRADATION_COLOR2 && !GRADATION_COLOR4)
#if TONE_NONE && !COLOR_FILTER && SAMPLING_NONE && TRANSITION_NONE && TARGET_NONE && EDGE_NONE && DETAIL_NONE && GRADATION_NONE
@@ -418,7 +421,7 @@ half4 apply_edge_color_filter(const half4 inColor, const half4 factor, const flo
return color;
}
half4 apply_sampling_filter(float2 uv, const float4 uvMask, const float2 uvLocal, const float isShadow)
half4 apply_sampling_filter(float2 uv, const float4 uvMask, const float isShadow)
{
#if SAMPLING_BLUR_FAST || SAMPLING_BLUR_MEDIUM || SAMPLING_BLUR_DETAIL
{
@@ -623,34 +626,40 @@ half4 apply_detail_filter(half4 color, float2 uvLocal)
{
const half4 inColor = color;
const float2 uv = uvLocal * _DetailTex_ST.xy + _DetailTex_ST.zw + _Time.y * _DetailTex_Speed;
const half4 detail = tex2D(_DetailTex, uv);
half4 detail = tex2D(_DetailTex, uv);
#if DETAIL_MASKING // Detail.Masking
{
color *= inv_lerp(_DetailThreshold.x, _DetailThreshold.y, detail.a);
color.a *= inv_lerp(_DetailThreshold.x, _DetailThreshold.y, detail.a);
}
#elif DETAIL_MULTIPLY // Detail.Multiply
{
detail *= _DetailColor;
color.rgb *= detail.rgb;
color = lerp(inColor, color * detail.a, _DetailIntensity);
color = lerp(inColor, color, _DetailIntensity * detail.a);
}
#elif DETAIL_ADDITIVE // Detail.Additive
{
color.rgb += detail.rgb * detail.a * color.a;
color = lerp(inColor, color, _DetailIntensity);
detail *= _DetailColor;
color.rgb += detail.rgb * color.a;
color = lerp(inColor, color, _DetailIntensity * detail.a);
}
#elif DETAIL_SUBTRACTIVE // Detail.Subtractive
{
detail *= _DetailColor;
color.rgb -= detail.rgb * color.a;
color = lerp(inColor, color, _DetailIntensity * detail.a);
}
#elif DETAIL_REPLACE // Detail.Replace
{
detail *= _DetailColor;
color.rgb = detail.rgb * color.a;
color = lerp(inColor, color, _DetailIntensity * detail.a);
}
#elif DETAIL_MULTIPLY_ADDITIVE // Detail.MultiplyAdditive
{
color.rgb *= (1 + detail.rgb * detail.a);
color = lerp(inColor, color, _DetailIntensity);
detail *= _DetailColor;
color.rgb *= (1 + detail.rgb);
color = lerp(inColor, color, _DetailIntensity * detail.a);
}
#else
{
@@ -712,7 +721,7 @@ half4 uieffect_internal(float2 uv, float4 uvMask, const float2 uvLocal, const fl
const half alpha = transition_alpha(uvLocal);
const float edgeFactor = edge(uv, uvMask, _EdgeWidth);
uv += move_transition_filter(uvMask, alpha);
half4 color = apply_sampling_filter(uv, uvMask, uvLocal, isShadow);
half4 color = apply_sampling_filter(uv, uvMask, isShadow);
color = apply_gradation_filter(color, uvGrad);
color = apply_tone_filter(color);
color = apply_transition_filter(color, alpha, uvLocal, edgeFactor);
@@ -753,8 +762,17 @@ half4 uieffect(half4 origin, float2 uv, float4 uvMask, float4 wpos)
wpos = mul(_CanvasToWorldMatrix, wpos);
#endif
const half rate = get_target_rate(origin.rgb);
const float2 uvLocal = saturate(mul(_RootViewMatrix, wpos)).xy;
const float2 uvGrad = mul(_GradViewMatrix, wpos).xy;
float2 uvLocal = saturate(mul(_RootViewMatrix, wpos)).xy;
float2 uvGrad = mul(_GradViewMatrix, wpos).xy;
// Mirror
if (uvMask.x < -3)
{
uvLocal = saturate(mul(_MirrorRootViewMatrix, wpos)).xy;
uvGrad = saturate(mul(_MirrorGradViewMatrix, wpos)).xy;
uvMask.x += 4;
}
const float isShadow = uvMask.x < 0 ? 1 : 0;
uvMask.x += isShadow * 2;
+1 -1
View File
@@ -64,7 +64,7 @@ Shader "Hidden/UI/Default (UIEffect)"
#pragma shader_feature_local_fragment _ SAMPLING_BLUR_FAST SAMPLING_BLUR_MEDIUM SAMPLING_BLUR_DETAIL SAMPLING_PIXELATION SAMPLING_RGB_SHIFT SAMPLING_EDGE_LUMINANCE SAMPLING_EDGE_ALPHA
#pragma shader_feature_local_fragment _ TRANSITION_FADE TRANSITION_CUTOFF TRANSITION_DISSOLVE TRANSITION_SHINY TRANSITION_MASK TRANSITION_MELT TRANSITION_BURN TRANSITION_PATTERN
#pragma shader_feature_local_fragment _ EDGE_PLAIN EDGE_SHINY
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ DETAIL_MASKING DETAIL_MULTIPLY DETAIL_ADDITIVE DETAIL_SUBTRACTIVE DETAIL_REPLACE DETAIL_MULTIPLY_ADDITIVE
#pragma shader_feature_local_fragment _ TARGET_HUE TARGET_LUMINANCE
#pragma shader_feature_local_fragment _ GRADATION_GRADIENT GRADATION_RADIAL GRADATION_COLOR2 GRADATION_COLOR4
#pragma shader_feature_fragment _ UIEFFECT_EDITOR
@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: b19508fbd1be2438ca2ef3a530387510
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 44f847fb4512b4779b9277b708ddef3d
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 3d41dfc0e9363403f97624a14e7c5aba
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 616569e685a7e4729a0c1990fe362667
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 5a7cb3ac5cdd24bb8be3a2a3e5160bb3
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: f4b900840411b47be98e05ba2b7fc5ab
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: dc0a59eee31f94e22b95ebdf6197fb32
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: db4c77171a8114189bf96f1370f06722
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 5293807e259cd405b9ebf390b64d863c
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 5faed0c2a09bc44248b7a3a618d6e342
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,7 +0,0 @@
fileFormatVersion: 2
guid: 0c0ac1ee27ff44bd6b2172d0a6ed3679
PrefabImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

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