Compare commits

...

34 Commits

Author SHA1 Message Date
mob-sakai 7ed4146b2e release v3.2.0 2019-07-17 02:05:34 +09:00
mob-sakai 06ec169183 update documents for v3.2.0 2019-07-17 02:05:33 +09:00
mob-sakai 47898e2233 fix demo scene path 2019-07-17 01:58:38 +09:00
mob-sakai b84de47aa3 fix #165; UIShiny effect remain on screen after calling Stop() 2019-07-17 01:46:09 +09:00
mob-sakai 555baa5c4a close #166; Add demo for Unity 2018+ and TMPro 1.2+ 2019-07-17 00:27:19 +09:00
mob-sakai 4bcfb7bc11 Add demo 2019-07-16 22:55:50 +09:00
mob-sakai 977f513276 Remove unused directory 2019-07-16 22:55:40 +09:00
mob-sakai 90478b7eba fix #183; UIDissolve's "Reverse Play" option works only in OnEnable 2019-07-13 21:23:22 +09:00
mob-sakai 27515f18d3 Fix dissolve shader for CanvasGroup.Alpha 2019-07-13 21:13:38 +09:00
Takashi Sakai 79534a8c00 Merge pull request #176 from Oskiii/bugfix/fix-error-during-tmpro-spriteasset-check
Add a null check to TMPro sprite asset material checking
2019-07-05 08:51:39 +09:00
Oskari Liukku 84ac701d44 Add a null check to TMPro sprite asset material checking 2019-07-04 19:21:07 +03:00
mob-sakai 29532e0a8d fix #163; Material caching is not working properly 2019-06-30 23:12:06 +09:00
mob-sakai 0c43f44236 close #161; UICapturedImage: Immediate capturing option is removed as it does not work on many platforms 2019-06-30 23:12:06 +09:00
Takashi Sakai cde5b6b0e8 Update FUNDING.yml 2019-06-24 15:49:28 +09:00
Takashi Sakai 17a54f558f Create FUNDING.yml 2019-06-24 15:44:47 +09:00
mob-sakai 0e7b2be220 Refactor shaders 2019-03-12 20:56:32 +09:00
mob-sakai 5410478497 Refactor shaders 2019-03-12 20:51:45 +09:00
mob-sakai e6f648e1b4 Refactor shaders 2019-03-12 15:56:31 +09:00
mob-sakai 669188d866 release v3.1.0 2019-03-10 23:13:28 +09:00
mob-sakai 9fdcf5be6d update documents for v3.1.0 2019-03-10 23:13:28 +09:00
Takashi Sakai bf87aebc47 Merge pull request #153 from antpaw/reverse-animation-dissolve
add reverse animation option to UIDissolve
2019-03-10 21:25:14 +09:00
Takashi Sakai 24a3cbbf90 Merge branch 'develop' into reverse-animation-dissolve 2019-03-10 21:24:51 +09:00
mob-sakai 4ceb771176 Change a symbol for TextMeshPro to TMP_PRESENT 2019-03-10 21:19:48 +09:00
Anton Pawlik 3589a45b46 add reverse animation option to UIDissolve 2019-03-10 12:45:06 +01:00
mob-sakai 8d92abae45 Update readme 2019-03-10 20:39:16 +09:00
mob-sakai 1e9997cf0a Fix additional channels 2019-03-06 21:13:11 +09:00
mob-sakai b380a8cbbb Support TMPro underlay 2019-03-06 21:12:14 +09:00
mob-sakai 7d1d918c29 Move files 2019-03-05 14:16:10 +09:00
mob-sakai af2cc4aca7 Support TMPro 2019-02-28 11:14:10 +09:00
mob-sakai 64d7aab46a Move demo 2019-02-28 11:14:09 +09:00
mob-sakai 8c2eebf719 Support TMPro 2019-02-28 11:14:10 +09:00
mob-sakai 36a36b8d2b pkgtest 2019-02-24 09:16:08 +09:00
mob-sakai 7fcfab6b6f test prj 2019-02-24 09:16:08 +09:00
mob-sakai e5f0be5085 Add package test project 2019-02-24 09:16:08 +09:00
151 changed files with 14088 additions and 2843 deletions
+12
View File
@@ -0,0 +1,12 @@
# These are supported funding model platforms
github: # [mob-sakai]
patreon: mob_sakai
open_collective: # Replace with a single Open Collective username
ko_fi: # Replace with a single Ko-fi username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
liberapay: # Replace with a single Liberapay username
issuehunt: # Replace with a single IssueHunt username
otechie: # Replace with a single Otechie username
custom: # Replace with a single custom sponsorship URL
-1
View File
@@ -33,7 +33,6 @@ sysinfo.txt
# Packages
*.unitypackage
build.app
unity.log
@@ -1,5 +1,45 @@
# Changelog
## [v3.2.0](https://github.com/mob-sakai/UIEffect/tree/v3.2.0) (2019-07-17)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v3.1.0...v3.2.0)
**Breaking changes:**
- UICapturedImage: Immediate capturing option is removed as it does not work on many platforms [\#161](https://github.com/mob-sakai/UIEffect/issues/161)
**Implemented enhancements:**
- Add demo for Unity 2018+ and TMPro 1.2+ [\#166](https://github.com/mob-sakai/UIEffect/issues/166)
**Fixed bugs:**
- UIDissolve's "Reverse Play" option works only in OnEnable [\#183](https://github.com/mob-sakai/UIEffect/issues/183)
- CanvasGroup.alpha does not affect [\#180](https://github.com/mob-sakai/UIEffect/issues/180)
- UIShiny effect remain on screen after calling Stop\(\) [\#165](https://github.com/mob-sakai/UIEffect/issues/165)
- Material caching is not working properly [\#163](https://github.com/mob-sakai/UIEffect/issues/163)
- Add a null check to TMPro sprite asset material checking [\#176](https://github.com/mob-sakai/UIEffect/pull/176) ([Oskiii](https://github.com/Oskiii))
## [v3.1.0](https://github.com/mob-sakai/UIEffect/tree/v3.1.0) (2019-03-10)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v3.0.4...v3.1.0)
## Support TextMeshPro!
* All components are supported
* Advanced blur is supported for Unity 2017.1+
![](https://user-images.githubusercontent.com/12690315/53533025-8495d800-3b3c-11e9-9e94-320f3ec7ad74.png)
For details to use, see [Usage with TextMeshPro](https://github.com/mob-sakai/UIEffect#usage-with-textmeshpro)
**NOTE: Unity 5.x will not be supported in the near future**
**Implemented enhancements:**
- Support TextMeshPro [\#137](https://github.com/mob-sakai/UIEffect/issues/137)
- add reverse animation option to UIDissolve [\#153](https://github.com/mob-sakai/UIEffect/pull/153) ([antpaw](https://github.com/antpaw))
## [v3.0.4](https://github.com/mob-sakai/UIEffect/tree/v3.0.4) (2019-02-15)
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v3.0.3...v3.0.4)
@@ -41,19 +81,19 @@
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v2.8.3...v3.0.0)
### New architecture: easier, faster and more beautiful.
* Simple & easy-to-use
* 20% faster
* High precision parameter
### Immediate capturing (UIEffectCapturedImage option)
* Capture the previous frame immediately without any camera.
* You no longer have to wait one frame to capture!
* *NOTE: LWRP, WebGL and Unity 5.x for iOS/Mac are not supported.*
### Advanced blur (UIEffect option)
* Remove common artifacts in the blur effect for uGUI.
![](https://user-images.githubusercontent.com/12690315/42547121-80134788-84fb-11e8-97a0-048bba9634ea.png)
### New architecture: easier, faster and more beautiful.
* Simple & easy-to-use
* 20% faster
* High precision parameter
### Immediate capturing (UIEffectCapturedImage option)
* Capture the previous frame immediately without any camera.
* You no longer have to wait one frame to capture!
* *NOTE: LWRP, WebGL and Unity 5.x for iOS/Mac are not supported.*
### Advanced blur (UIEffect option)
* Remove common artifacts in the blur effect for uGUI.
![](https://user-images.githubusercontent.com/12690315/42547121-80134788-84fb-11e8-97a0-048bba9634ea.png)
* It is effective for small padding size atlases, including dynamic fonts!
**Breaking changes:**
@@ -114,10 +154,10 @@
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v2.7.1...v2.8.0)
* Create a screen transition!
![8 -08-2018 19-29-38](https://user-images.githubusercontent.com/12690315/43832265-dbdecc98-9b41-11e8-8ab5-9f49420a6a16.gif)
* Some updates make UIEffectCapturedImage easier to use!
* Create a screen transition!
![8 -08-2018 19-29-38](https://user-images.githubusercontent.com/12690315/43832265-dbdecc98-9b41-11e8-8ab5-9f49420a6a16.gif)
* Some updates make UIEffectCapturedImage easier to use!
**Implemented enhancements:**
@@ -143,10 +183,10 @@
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v2.6.2...v2.7.0)
UIHsvModifier: Modify hue, saturation, and value as you like!
![](https://user-images.githubusercontent.com/12690315/43200006-d6e2bf54-904e-11e8-9f22-0c0f9ce5912f.gif)
* Note: `Hue` mode in UIEffect component will be obsolete in the near future. Please use UIHsvModifier component instead.
UIHsvModifier: Modify hue, saturation, and value as you like!
![](https://user-images.githubusercontent.com/12690315/43200006-d6e2bf54-904e-11e8-9f22-0c0f9ce5912f.gif)
* Note: `Hue` mode in UIEffect component will be obsolete in the near future. Please use UIHsvModifier component instead.
* Note: `Cutoff` and `Mono` mode in UIEffect component will be obsolete in the near future. Please use UITransitionEffect component instead.
**Implemented enhancements:**
@@ -181,13 +221,13 @@ UIHsvModifier: Modify hue, saturation, and value as you like!
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v2.5.2...v2.6.0)
Blurring effect has been improved about 6 times faster!
![](https://user-images.githubusercontent.com/12690315/41393724-08420b1e-6fe2-11e8-8741-721789c2d029.png)
You can change noise texture for dissolve effect from inspector or script!
![](https://user-images.githubusercontent.com/12690315/41397570-99bda636-6fef-11e8-827b-932d7a8e74c1.gif)
Blurring effect has been improved about 6 times faster!
![](https://user-images.githubusercontent.com/12690315/41393724-08420b1e-6fe2-11e8-8741-721789c2d029.png)
You can change noise texture for dissolve effect from inspector or script!
![](https://user-images.githubusercontent.com/12690315/41397570-99bda636-6fef-11e8-827b-932d7a8e74c1.gif)
**Implemented enhancements:**
@@ -222,11 +262,11 @@ You can change noise texture for dissolve effect from inspector or script!
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v2.4.1...v2.5.0)
Shiny effect has been update!
![v2.5.0](https://user-images.githubusercontent.com/12690315/40654533-8877c99c-6379-11e8-8ae7-b91995fc230b.gif)
* NOTE: `UIEffect.shadow***` will be obsolete in the near future. Please use `UIShadow` component instead.
Shiny effect has been update!
![v2.5.0](https://user-images.githubusercontent.com/12690315/40654533-8877c99c-6379-11e8-8ae7-b91995fc230b.gif)
* NOTE: `UIEffect.shadow***` will be obsolete in the near future. Please use `UIShadow` component instead.
* NOTE: `UIEffect.custom***` will be obsolete in the near future. Please use `UICustomEffect` component (experimental) instead.
**Implemented enhancements:**
@@ -259,9 +299,9 @@ Shiny effect has been update!
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v2.3.2...v2.4.0)
UIDissolve has been updated!
![v2.4.0](https://user-images.githubusercontent.com/12690315/40294019-a0bfb8aa-5d0e-11e8-8451-873502db6a99.gif)
UIDissolve has been updated!
![v2.4.0](https://user-images.githubusercontent.com/12690315/40294019-a0bfb8aa-5d0e-11e8-8451-873502db6a99.gif)
![editor](https://user-images.githubusercontent.com/12690315/40294212-9e1b1ce2-5d0f-11e8-88ce-78a8c0523dc2.png)
**Implemented enhancements:**
@@ -288,13 +328,13 @@ UIDissolve has been updated!
[Full Changelog](https://github.com/mob-sakai/UIEffect/compare/v2.2.0...v2.3.0)
New components has been available!
* **UIShiny** : Shiny effect WITHOUT Mask component. This will suppress extra draw calls and improve performance.
* **UIDissolve** : Dissolve effect WITHOUT material instancing. This will suppress extra draw calls and improve performance.
* **UIFlip** : Flip graphic horizontal/vertical.
![v2.3.0](https://user-images.githubusercontent.com/12690315/40706142-cb98d2d0-6427-11e8-96fc-5cc5fd9c553a.gif)
New components has been available!
* **UIShiny** : Shiny effect WITHOUT Mask component. This will suppress extra draw calls and improve performance.
* **UIDissolve** : Dissolve effect WITHOUT material instancing. This will suppress extra draw calls and improve performance.
* **UIFlip** : Flip graphic horizontal/vertical.
![v2.3.0](https://user-images.githubusercontent.com/12690315/40706142-cb98d2d0-6427-11e8-96fc-5cc5fd9c553a.gif)
**Implemented enhancements:**
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 37c4bd2925c96431b827a2031f76add8
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: b00cb7cc19de648f38332743361bdacb
folderAsset: yes
timeCreated: 1547811341
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,169 @@
#if TMP_PRESENT
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using TMPro.EditorUtilities;
using UnityEditor;
using Coffee.UIExtensions;
using System.IO;
using System.Linq;
using System;
namespace Coffee.UIEffect.Editors
{
public class TMP_SDFShaderGUI : TMPro.EditorUtilities.TMP_SDFShaderGUI
{
static GUIStyle s_PanelTitle;
Material currentMaterial;
public override void OnGUI(MaterialEditor materialEditor, MaterialProperty[] properties)
{
currentMaterial = materialEditor.target as Material;
base.OnGUI(materialEditor, properties);
}
protected override void DoGUI()
{
if (currentMaterial.HasProperty("_FaceColor"))
{
base.DoGUI();
}
else
{
DrawSpritePanel();
}
var name = currentMaterial.shader.name;
if (name.EndsWith("(UIEffect)"))
{
DrawEffectPanel();
}
else if (name.EndsWith("(UIDissolve)"))
{
DrawDissolvePanel();
}
else if (name.EndsWith("(UIShiny)"))
{
DrawShinyPanel();
}
else if (name.EndsWith("(UITransition)"))
{
DrawTransitionPanel();
}
}
void DrawSpritePanel()
{
if (BeginTmpPanel("Sprite", true))
{
EditorGUI.indentLevel += 1;
DoTexture2D("_MainTex", "Texture");
DoColor("_Color", "Color");
EditorGUI.indentLevel -= 1;
}
EndTmpPanel();
}
void DrawDissolvePanel()
{
if (BeginTmpPanel("Dissolve", true))
{
EditorGUI.indentLevel += 1;
DoTexture2D("_NoiseTex", "Texture");
DrawEnum<ColorMode>(currentMaterial);
EditorGUI.indentLevel -= 1;
}
EndTmpPanel();
}
void DrawShinyPanel()
{
}
void DrawTransitionPanel()
{
if (BeginTmpPanel("Transition", true))
{
EditorGUI.indentLevel += 1;
DoTexture2D("_NoiseTex", "Texture");
DrawEnum<UITransitionEffect.EffectMode>(currentMaterial);
EditorGUI.indentLevel -= 1;
}
EndTmpPanel();
}
void DrawEffectPanel()
{
if (BeginTmpPanel("Effect", true))
{
EditorGUI.indentLevel += 1;
DrawEnum<EffectMode>(currentMaterial);
DrawEnum<ColorMode>(currentMaterial);
DrawEnum<BlurMode>(currentMaterial);
DrawToggleKeyword(currentMaterial, "Advanced Blur", "EX");
EditorGUI.indentLevel -= 1;
}
EndTmpPanel();
}
static void DrawEnum<T>(Material mat)
{
Type type = typeof(T);
string[] names = System.Enum.GetNames(type);
int[] values = System.Enum.GetValues(type) as int[];
int mode = 0;
for (int i = 0; i < names.Length; i++)
{
if (mat.IsKeywordEnabled(names[i].ToUpper()))
mode = values[i];
}
var newMode = EditorGUILayout.IntPopup(ObjectNames.NicifyVariableName(type.Name), mode, names, values);
if (mode != newMode)
{
Array.IndexOf<int>(values, mode);
mat.DisableKeyword(names[Array.IndexOf<int>(values, mode)].ToUpper());
if (newMode != 0)
mat.EnableKeyword(names[Array.IndexOf<int>(values, newMode)].ToUpper());
}
}
static void DrawToggleKeyword(Material mat, string label, string keyword)
{
bool value = mat.IsKeywordEnabled(keyword);
if (EditorGUILayout.Toggle(label, value) != value)
{
if (value)
mat.DisableKeyword(keyword);
else
mat.EnableKeyword(keyword);
}
}
static bool BeginTmpPanel(string panel, bool expanded)
{
if (s_PanelTitle == null)
{
s_PanelTitle = new GUIStyle(EditorStyles.label) { fontStyle = FontStyle.Bold };
}
EditorGUILayout.BeginVertical(EditorStyles.helpBox);
Rect position = EditorGUI.IndentedRect(GUILayoutUtility.GetRect(20f, 18f));
position.x += 20;
position.width += 6f;
expanded = GUI.Toggle(position, expanded, panel, s_PanelTitle);
EditorGUI.indentLevel++;
EditorGUI.BeginDisabledGroup(false);
return expanded;
}
static void EndTmpPanel()
{
EditorGUI.EndDisabledGroup();
EditorGUI.indentLevel--;
EditorGUILayout.EndVertical();
}
}
}
#endif
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 0163d601911a448eea37923cb9fd6760
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1045b92cbd63c45bab65c540449a8ad3
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,157 @@
Shader "TextMeshPro/Distance Field (UIDissolve)" {
Properties {
_FaceTex ("Face Texture", 2D) = "white" {}
_FaceUVSpeedX ("Face UV Speed X", Range(-5, 5)) = 0.0
_FaceUVSpeedY ("Face UV Speed Y", Range(-5, 5)) = 0.0
_FaceColor ("Face Color", Color) = (1,1,1,1)
_FaceDilate ("Face Dilate", Range(-1,1)) = 0
_OutlineColor ("Outline Color", Color) = (0,0,0,1)
_OutlineTex ("Outline Texture", 2D) = "white" {}
_OutlineUVSpeedX ("Outline UV Speed X", Range(-5, 5)) = 0.0
_OutlineUVSpeedY ("Outline UV Speed Y", Range(-5, 5)) = 0.0
_OutlineWidth ("Outline Thickness", Range(0, 1)) = 0
_OutlineSoftness ("Outline Softness", Range(-1,1)) = 0
_Bevel ("Bevel", Range(0,1)) = 0.5
_BevelOffset ("Bevel Offset", Range(-0.5,0.5)) = 0
_BevelWidth ("Bevel Width", Range(-.5,0.5)) = 0
_BevelClamp ("Bevel Clamp", Range(0,1)) = 0
_BevelRoundness ("Bevel Roundness", Range(0,1)) = 0
_LightAngle ("Light Angle", Range(0.0, 6.2831853)) = 3.1416
_SpecularColor ("Specular", Color) = (1,1,1,1)
_SpecularPower ("Specular", Range(0,4)) = 2.0
_Reflectivity ("Reflectivity", Range(5.0,15.0)) = 10
_Diffuse ("Diffuse", Range(0,1)) = 0.5
_Ambient ("Ambient", Range(1,0)) = 0.5
_BumpMap ("Normal map", 2D) = "bump" {}
_BumpOutline ("Bump Outline", Range(0,1)) = 0
_BumpFace ("Bump Face", Range(0,1)) = 0
_ReflectFaceColor ("Reflection Color", Color) = (0,0,0,1)
_ReflectOutlineColor("Reflection Color", Color) = (0,0,0,1)
_Cube ("Reflection Cubemap", Cube) = "black" { /* TexGen CubeReflect */ }
_EnvMatrixRotation ("Texture Rotation", vector) = (0, 0, 0, 0)
_UnderlayColor ("Border Color", Color) = (0,0,0, 0.5)
_UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0
_UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0
_UnderlayDilate ("Border Dilate", Range(-1,1)) = 0
_UnderlaySoftness ("Border Softness", Range(0,1)) = 0
_GlowColor ("Color", Color) = (0, 1, 0, 0.5)
_GlowOffset ("Offset", Range(-1,1)) = 0
_GlowInner ("Inner", Range(0,1)) = 0.05
_GlowOuter ("Outer", Range(0,1)) = 0.05
_GlowPower ("Falloff", Range(1, 0)) = 0.75
_WeightNormal ("Weight Normal", float) = 0
_WeightBold ("Weight Bold", float) = 0.5
_ShaderFlags ("Flags", float) = 0
_ScaleRatioA ("Scale RatioA", float) = 1
_ScaleRatioB ("Scale RatioB", float) = 1
_ScaleRatioC ("Scale RatioC", float) = 1
_MainTex ("Font Atlas", 2D) = "white" {}
_TextureWidth ("Texture Width", float) = 512
_TextureHeight ("Texture Height", float) = 512
_GradientScale ("Gradient Scale", float) = 5.0
_ScaleX ("Scale X", float) = 1.0
_ScaleY ("Scale Y", float) = 1.0
_PerspectiveFilter ("Perspective Correction", Range(0, 1)) = 0.875
_VertexOffsetX ("Vertex OffsetX", float) = 0
_VertexOffsetY ("Vertex OffsetY", float) = 0
_MaskCoord ("Mask Coordinates", vector) = (0, 0, 32767, 32767)
_ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
_MaskSoftnessX ("Mask SoftnessX", float) = 0
_MaskSoftnessY ("Mask SoftnessY", float) = 0
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
_NoiseTex("Noise Texture (A)", 2D) = "white" {}
}
SubShader {
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull [_CullMode]
ZWrite Off
Lighting Off
Fog { Mode Off }
ZTest [unity_GUIZTestMode]
Blend One OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass {
CGPROGRAM
#pragma target 3.0
#pragma vertex VertShader
#pragma fragment frag
#pragma shader_feature __ BEVEL_ON
#pragma shader_feature __ UNDERLAY_ON UNDERLAY_INNER
#pragma shader_feature __ GLOW_ON
#pragma multi_compile __ UNITY_UI_CLIP_RECT
#pragma multi_compile __ UNITY_UI_ALPHACLIP
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#include "Assets/TextMesh Pro/Resources/Shaders/TMPro_Properties.cginc"
#include "Assets/TextMesh Pro/Resources/Shaders/TMPro.cginc"
#define UI_DISSOLVE 1
#define DISSOLVE 1
#include "Assets/Coffee/UIExtensions/UIEffect/Shaders/UI-Effect.cginc"
#include "UI-Effect-TMPro.cginc"
#pragma shader_feature __ ADD SUBTRACT FILL
fixed4 frag(pixel_t IN) : SV_Target
{
half4 color = PixShader(IN);
// Dissolve
color = ApplyTransitionEffect(color, IN.eParam);
color.rgb *= color.a;
#if UNITY_UI_ALPHACLIP
clip(color.a - 0.001);
#endif
return color * IN.color.a;
}
ENDCG
}
}
Fallback "TextMeshPro/Mobile/Distance Field (UIDissolve)"
CustomEditor "Coffee.UIEffect.Editors.TMP_SDFShaderGUI"
}
@@ -0,0 +1,15 @@
fileFormatVersion: 2
guid: 983d3d7238f4540e3af421a4abb25e26
ShaderImporter:
externalObjects: {}
defaultTextures:
- _FaceTex: {instanceID: 0}
- _OutlineTex: {instanceID: 0}
- _BumpMap: {instanceID: 0}
- _Cube: {instanceID: 0}
- _MainTex: {instanceID: 0}
- _NoiseTex: {fileID: 2800000, guid: 3e04c247fb2604af186173fce0bc62de, type: 3}
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,173 @@
Shader "TextMeshPro/Distance Field (UIEffect)" {
Properties {
_FaceTex ("Face Texture", 2D) = "white" {}
_FaceUVSpeedX ("Face UV Speed X", Range(-5, 5)) = 0.0
_FaceUVSpeedY ("Face UV Speed Y", Range(-5, 5)) = 0.0
_FaceColor ("Face Color", Color) = (1,1,1,1)
_FaceDilate ("Face Dilate", Range(-1,1)) = 0
_OutlineColor ("Outline Color", Color) = (0,0,0,1)
_OutlineTex ("Outline Texture", 2D) = "white" {}
_OutlineUVSpeedX ("Outline UV Speed X", Range(-5, 5)) = 0.0
_OutlineUVSpeedY ("Outline UV Speed Y", Range(-5, 5)) = 0.0
_OutlineWidth ("Outline Thickness", Range(0, 1)) = 0
_OutlineSoftness ("Outline Softness", Range(-1,1)) = 0
_Bevel ("Bevel", Range(0,1)) = 0.5
_BevelOffset ("Bevel Offset", Range(-0.5,0.5)) = 0
_BevelWidth ("Bevel Width", Range(-.5,0.5)) = 0
_BevelClamp ("Bevel Clamp", Range(0,1)) = 0
_BevelRoundness ("Bevel Roundness", Range(0,1)) = 0
_LightAngle ("Light Angle", Range(0.0, 6.2831853)) = 3.1416
_SpecularColor ("Specular", Color) = (1,1,1,1)
_SpecularPower ("Specular", Range(0,4)) = 2.0
_Reflectivity ("Reflectivity", Range(5.0,15.0)) = 10
_Diffuse ("Diffuse", Range(0,1)) = 0.5
_Ambient ("Ambient", Range(1,0)) = 0.5
_BumpMap ("Normal map", 2D) = "bump" {}
_BumpOutline ("Bump Outline", Range(0,1)) = 0
_BumpFace ("Bump Face", Range(0,1)) = 0
_ReflectFaceColor ("Reflection Color", Color) = (0,0,0,1)
_ReflectOutlineColor("Reflection Color", Color) = (0,0,0,1)
_Cube ("Reflection Cubemap", Cube) = "black" { /* TexGen CubeReflect */ }
_EnvMatrixRotation ("Texture Rotation", vector) = (0, 0, 0, 0)
_UnderlayColor ("Border Color", Color) = (0,0,0, 0.5)
_UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0
_UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0
_UnderlayDilate ("Border Dilate", Range(-1,1)) = 0
_UnderlaySoftness ("Border Softness", Range(0,1)) = 0
_GlowColor ("Color", Color) = (0, 1, 0, 0.5)
_GlowOffset ("Offset", Range(-1,1)) = 0
_GlowInner ("Inner", Range(0,1)) = 0.05
_GlowOuter ("Outer", Range(0,1)) = 0.05
_GlowPower ("Falloff", Range(1, 0)) = 0.75
_WeightNormal ("Weight Normal", float) = 0
_WeightBold ("Weight Bold", float) = 0.5
_ShaderFlags ("Flags", float) = 0
_ScaleRatioA ("Scale RatioA", float) = 1
_ScaleRatioB ("Scale RatioB", float) = 1
_ScaleRatioC ("Scale RatioC", float) = 1
_MainTex ("Font Atlas", 2D) = "white" {}
_TextureWidth ("Texture Width", float) = 512
_TextureHeight ("Texture Height", float) = 512
_GradientScale ("Gradient Scale", float) = 5.0
_ScaleX ("Scale X", float) = 1.0
_ScaleY ("Scale Y", float) = 1.0
_PerspectiveFilter ("Perspective Correction", Range(0, 1)) = 0.875
_VertexOffsetX ("Vertex OffsetX", float) = 0
_VertexOffsetY ("Vertex OffsetY", float) = 0
_MaskCoord ("Mask Coordinates", vector) = (0, 0, 32767, 32767)
_ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
_MaskSoftnessX ("Mask SoftnessX", float) = 0
_MaskSoftnessY ("Mask SoftnessY", float) = 0
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
}
SubShader {
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull [_CullMode]
ZWrite Off
Lighting Off
Fog { Mode Off }
ZTest [unity_GUIZTestMode]
Blend One OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass {
CGPROGRAM
#pragma target 3.0
#pragma vertex VertShader
#pragma fragment frag
#pragma shader_feature __ BEVEL_ON
#pragma shader_feature __ UNDERLAY_ON UNDERLAY_INNER
#pragma shader_feature __ GLOW_ON
#pragma multi_compile __ UNITY_UI_CLIP_RECT
#pragma multi_compile __ UNITY_UI_ALPHACLIP
#pragma shader_feature __ GRAYSCALE SEPIA NEGA PIXEL
#pragma shader_feature __ ADD SUBTRACT FILL
#pragma shader_feature __ FASTBLUR MEDIUMBLUR DETAILBLUR
#pragma shader_feature __ EX
float4 _MainTex_TexelSize;
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#include "Assets/TextMesh Pro/Resources/Shaders/TMPro_Properties.cginc"
#include "Assets/TextMesh Pro/Resources/Shaders/TMPro.cginc"
#define UI_EFFECT 1
#include "Assets/Coffee/UIExtensions/UIEffect/Shaders/UI-Effect.cginc"
#include "UI-Effect-TMPro.cginc"
fixed4 frag(pixel_t IN) : SV_Target
{
fixed4 param = tex2D(_ParamTex, float2(0.5, IN.eParam));
fixed effectFactor = param.x;
fixed colorFactor = param.y;
fixed blurFactor = param.z;
#if PIXEL
half2 pixelSize = max(2, (1-effectFactor*0.95) * float2(_TextureWidth, _TextureHeight));
UV(IN).xy = round(UV(IN).xy * pixelSize) / pixelSize;
#endif
#if defined(UI_BLUR) && EX
half4 color = Tex2DBlurring(IN, blurFactor * float2(1/_TextureWidth, 1/_TextureHeight) * 4, IN.uvMask);
#elif defined(UI_BLUR)
half4 color = Tex2DBlurring(IN, blurFactor * float2(1/_TextureWidth, 1/_TextureHeight) * 4);
#else
half4 color = PixShader(IN) * IN.color.a;
#endif
#if defined (UI_TONE)
color = ApplyToneEffect(color, effectFactor);
#endif
color = ApplyColorEffect(color, fixed4(IN.color.rgb, colorFactor));
color.rgb *= color.a;
return color * IN.color.a;
}
ENDCG
}
}
Fallback "TextMeshPro/Mobile/Distance Field (UIEffect)"
CustomEditor "Coffee.UIEffect.Editors.TMP_SDFShaderGUI"
}
@@ -0,0 +1,15 @@
fileFormatVersion: 2
guid: fdc3d2db3815548ae9eea37e1be79f36
ShaderImporter:
externalObjects: {}
defaultTextures:
- _FaceTex: {instanceID: 0}
- _OutlineTex: {instanceID: 0}
- _BumpMap: {instanceID: 0}
- _Cube: {instanceID: 0}
- _MainTex: {instanceID: 0}
- _NoiseTex: {fileID: 2800000, guid: 3e04c247fb2604af186173fce0bc62de, type: 3}
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,156 @@
Shader "TextMeshPro/Distance Field (UIHsvModifier)" {
Properties {
_FaceTex ("Face Texture", 2D) = "white" {}
_FaceUVSpeedX ("Face UV Speed X", Range(-5, 5)) = 0.0
_FaceUVSpeedY ("Face UV Speed Y", Range(-5, 5)) = 0.0
_FaceColor ("Face Color", Color) = (1,1,1,1)
_FaceDilate ("Face Dilate", Range(-1,1)) = 0
_OutlineColor ("Outline Color", Color) = (0,0,0,1)
_OutlineTex ("Outline Texture", 2D) = "white" {}
_OutlineUVSpeedX ("Outline UV Speed X", Range(-5, 5)) = 0.0
_OutlineUVSpeedY ("Outline UV Speed Y", Range(-5, 5)) = 0.0
_OutlineWidth ("Outline Thickness", Range(0, 1)) = 0
_OutlineSoftness ("Outline Softness", Range(-1,1)) = 0
_Bevel ("Bevel", Range(0,1)) = 0.5
_BevelOffset ("Bevel Offset", Range(-0.5,0.5)) = 0
_BevelWidth ("Bevel Width", Range(-.5,0.5)) = 0
_BevelClamp ("Bevel Clamp", Range(0,1)) = 0
_BevelRoundness ("Bevel Roundness", Range(0,1)) = 0
_LightAngle ("Light Angle", Range(0.0, 6.2831853)) = 3.1416
_SpecularColor ("Specular", Color) = (1,1,1,1)
_SpecularPower ("Specular", Range(0,4)) = 2.0
_Reflectivity ("Reflectivity", Range(5.0,15.0)) = 10
_Diffuse ("Diffuse", Range(0,1)) = 0.5
_Ambient ("Ambient", Range(1,0)) = 0.5
_BumpMap ("Normal map", 2D) = "bump" {}
_BumpOutline ("Bump Outline", Range(0,1)) = 0
_BumpFace ("Bump Face", Range(0,1)) = 0
_ReflectFaceColor ("Reflection Color", Color) = (0,0,0,1)
_ReflectOutlineColor("Reflection Color", Color) = (0,0,0,1)
_Cube ("Reflection Cubemap", Cube) = "black" { /* TexGen CubeReflect */ }
_EnvMatrixRotation ("Texture Rotation", vector) = (0, 0, 0, 0)
_UnderlayColor ("Border Color", Color) = (0,0,0, 0.5)
_UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0
_UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0
_UnderlayDilate ("Border Dilate", Range(-1,1)) = 0
_UnderlaySoftness ("Border Softness", Range(0,1)) = 0
_GlowColor ("Color", Color) = (0, 1, 0, 0.5)
_GlowOffset ("Offset", Range(-1,1)) = 0
_GlowInner ("Inner", Range(0,1)) = 0.05
_GlowOuter ("Outer", Range(0,1)) = 0.05
_GlowPower ("Falloff", Range(1, 0)) = 0.75
_WeightNormal ("Weight Normal", float) = 0
_WeightBold ("Weight Bold", float) = 0.5
_ShaderFlags ("Flags", float) = 0
_ScaleRatioA ("Scale RatioA", float) = 1
_ScaleRatioB ("Scale RatioB", float) = 1
_ScaleRatioC ("Scale RatioC", float) = 1
_MainTex ("Font Atlas", 2D) = "white" {}
_TextureWidth ("Texture Width", float) = 512
_TextureHeight ("Texture Height", float) = 512
_GradientScale ("Gradient Scale", float) = 5.0
_ScaleX ("Scale X", float) = 1.0
_ScaleY ("Scale Y", float) = 1.0
_PerspectiveFilter ("Perspective Correction", Range(0, 1)) = 0.875
_VertexOffsetX ("Vertex OffsetX", float) = 0
_VertexOffsetY ("Vertex OffsetY", float) = 0
_MaskCoord ("Mask Coordinates", vector) = (0, 0, 32767, 32767)
_ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
_MaskSoftnessX ("Mask SoftnessX", float) = 0
_MaskSoftnessY ("Mask SoftnessY", float) = 0
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
_NoiseTex("Noise Texture (A)", 2D) = "white" {}
}
SubShader {
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull [_CullMode]
ZWrite Off
Lighting Off
Fog { Mode Off }
ZTest [unity_GUIZTestMode]
Blend One OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass {
CGPROGRAM
#pragma target 3.0
#pragma vertex VertShader
#pragma fragment frag
#pragma shader_feature __ BEVEL_ON
#pragma shader_feature __ UNDERLAY_ON UNDERLAY_INNER
#pragma shader_feature __ GLOW_ON
#pragma multi_compile __ UNITY_UI_CLIP_RECT
#pragma multi_compile __ UNITY_UI_ALPHACLIP
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#include "Assets/TextMesh Pro/Resources/Shaders/TMPro_Properties.cginc"
#include "Assets/TextMesh Pro/Resources/Shaders/TMPro.cginc"
#define UI_HSV_MODIFIER 1
#include "Assets/Coffee/UIExtensions/UIEffect/Shaders/UI-Effect.cginc"
#include "UI-Effect-TMPro.cginc"
fixed4 frag(pixel_t IN) : SV_Target
{
half4 color = PixShader(IN);
#if UNITY_UI_ALPHACLIP
clip(color.a - 0.001);
#endif
// Hsv
color = ApplyHsvEffect(color, IN.eParam);
color.rgb *= IN.color.rgb;
return color * IN.color.a;
}
ENDCG
}
}
Fallback "TextMeshPro/Mobile/Distance Field (UIHsv)"
CustomEditor "TMPro.EditorUtilities.TMP_SDFShaderGUI"
}
@@ -0,0 +1,15 @@
fileFormatVersion: 2
guid: 58c5c12ea67b943f2bb08cdba8767f41
ShaderImporter:
externalObjects: {}
defaultTextures:
- _FaceTex: {instanceID: 0}
- _OutlineTex: {instanceID: 0}
- _BumpMap: {instanceID: 0}
- _Cube: {instanceID: 0}
- _MainTex: {instanceID: 0}
- _NoiseTex: {fileID: 2800000, guid: 3e04c247fb2604af186173fce0bc62de, type: 3}
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,154 @@
Shader "TextMeshPro/Distance Field (UIShiny)" {
Properties {
_FaceTex ("Face Texture", 2D) = "white" {}
_FaceUVSpeedX ("Face UV Speed X", Range(-5, 5)) = 0.0
_FaceUVSpeedY ("Face UV Speed Y", Range(-5, 5)) = 0.0
_FaceColor ("Face Color", Color) = (1,1,1,1)
_FaceDilate ("Face Dilate", Range(-1,1)) = 0
_OutlineColor ("Outline Color", Color) = (0,0,0,1)
_OutlineTex ("Outline Texture", 2D) = "white" {}
_OutlineUVSpeedX ("Outline UV Speed X", Range(-5, 5)) = 0.0
_OutlineUVSpeedY ("Outline UV Speed Y", Range(-5, 5)) = 0.0
_OutlineWidth ("Outline Thickness", Range(0, 1)) = 0
_OutlineSoftness ("Outline Softness", Range(-1,1)) = 0
_Bevel ("Bevel", Range(0,1)) = 0.5
_BevelOffset ("Bevel Offset", Range(-0.5,0.5)) = 0
_BevelWidth ("Bevel Width", Range(-.5,0.5)) = 0
_BevelClamp ("Bevel Clamp", Range(0,1)) = 0
_BevelRoundness ("Bevel Roundness", Range(0,1)) = 0
_LightAngle ("Light Angle", Range(0.0, 6.2831853)) = 3.1416
_SpecularColor ("Specular", Color) = (1,1,1,1)
_SpecularPower ("Specular", Range(0,4)) = 2.0
_Reflectivity ("Reflectivity", Range(5.0,15.0)) = 10
_Diffuse ("Diffuse", Range(0,1)) = 0.5
_Ambient ("Ambient", Range(1,0)) = 0.5
_BumpMap ("Normal map", 2D) = "bump" {}
_BumpOutline ("Bump Outline", Range(0,1)) = 0
_BumpFace ("Bump Face", Range(0,1)) = 0
_ReflectFaceColor ("Reflection Color", Color) = (0,0,0,1)
_ReflectOutlineColor("Reflection Color", Color) = (0,0,0,1)
_Cube ("Reflection Cubemap", Cube) = "black" { /* TexGen CubeReflect */ }
_EnvMatrixRotation ("Texture Rotation", vector) = (0, 0, 0, 0)
_UnderlayColor ("Border Color", Color) = (0,0,0, 0.5)
_UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0
_UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0
_UnderlayDilate ("Border Dilate", Range(-1,1)) = 0
_UnderlaySoftness ("Border Softness", Range(0,1)) = 0
_GlowColor ("Color", Color) = (0, 1, 0, 0.5)
_GlowOffset ("Offset", Range(-1,1)) = 0
_GlowInner ("Inner", Range(0,1)) = 0.05
_GlowOuter ("Outer", Range(0,1)) = 0.05
_GlowPower ("Falloff", Range(1, 0)) = 0.75
_WeightNormal ("Weight Normal", float) = 0
_WeightBold ("Weight Bold", float) = 0.5
_ShaderFlags ("Flags", float) = 0
_ScaleRatioA ("Scale RatioA", float) = 1
_ScaleRatioB ("Scale RatioB", float) = 1
_ScaleRatioC ("Scale RatioC", float) = 1
_MainTex ("Font Atlas", 2D) = "white" {}
_TextureWidth ("Texture Width", float) = 512
_TextureHeight ("Texture Height", float) = 512
_GradientScale ("Gradient Scale", float) = 5.0
_ScaleX ("Scale X", float) = 1.0
_ScaleY ("Scale Y", float) = 1.0
_PerspectiveFilter ("Perspective Correction", Range(0, 1)) = 0.875
_VertexOffsetX ("Vertex OffsetX", float) = 0
_VertexOffsetY ("Vertex OffsetY", float) = 0
_MaskCoord ("Mask Coordinates", vector) = (0, 0, 32767, 32767)
_ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
_MaskSoftnessX ("Mask SoftnessX", float) = 0
_MaskSoftnessY ("Mask SoftnessY", float) = 0
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
_NoiseTex("Noise Texture (A)", 2D) = "white" {}
}
SubShader {
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull [_CullMode]
ZWrite Off
Lighting Off
Fog { Mode Off }
ZTest [unity_GUIZTestMode]
Blend One OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass {
CGPROGRAM
#pragma target 3.0
#pragma vertex VertShader
#pragma fragment frag
#pragma shader_feature __ BEVEL_ON
#pragma shader_feature __ UNDERLAY_ON UNDERLAY_INNER
#pragma shader_feature __ GLOW_ON
#pragma multi_compile __ UNITY_UI_CLIP_RECT
#pragma multi_compile __ UNITY_UI_ALPHACLIP
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#include "Assets/TextMesh Pro/Resources/Shaders/TMPro_Properties.cginc"
#include "Assets/TextMesh Pro/Resources/Shaders/TMPro.cginc"
#define UI_SHINY 1
#include "Assets/Coffee/UIExtensions/UIEffect/Shaders/UI-Effect.cginc"
#include "UI-Effect-TMPro.cginc"
fixed4 frag(pixel_t IN) : SV_Target
{
half4 color = PixShader(IN);
#if UNITY_UI_ALPHACLIP
clip(color.a - 0.001);
#endif
// Shiny
color = ApplyShinyEffect(color, IN.eParam);
return color * IN.color.a;
}
ENDCG
}
}
Fallback "TextMeshPro/Mobile/Distance Field (UIShiny)"
CustomEditor "TMPro.EditorUtilities.TMP_SDFShaderGUI"
}
@@ -0,0 +1,15 @@
fileFormatVersion: 2
guid: 7a9c01b59189f4a738528999fa0aa9fe
ShaderImporter:
externalObjects: {}
defaultTextures:
- _FaceTex: {instanceID: 0}
- _OutlineTex: {instanceID: 0}
- _BumpMap: {instanceID: 0}
- _Cube: {instanceID: 0}
- _MainTex: {instanceID: 0}
- _NoiseTex: {fileID: 2800000, guid: 3e04c247fb2604af186173fce0bc62de, type: 3}
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,157 @@
Shader "TextMeshPro/Distance Field (UITransition)" {
Properties {
_FaceTex ("Face Texture", 2D) = "white" {}
_FaceUVSpeedX ("Face UV Speed X", Range(-5, 5)) = 0.0
_FaceUVSpeedY ("Face UV Speed Y", Range(-5, 5)) = 0.0
_FaceColor ("Face Color", Color) = (1,1,1,1)
_FaceDilate ("Face Dilate", Range(-1,1)) = 0
_OutlineColor ("Outline Color", Color) = (0,0,0,1)
_OutlineTex ("Outline Texture", 2D) = "white" {}
_OutlineUVSpeedX ("Outline UV Speed X", Range(-5, 5)) = 0.0
_OutlineUVSpeedY ("Outline UV Speed Y", Range(-5, 5)) = 0.0
_OutlineWidth ("Outline Thickness", Range(0, 1)) = 0
_OutlineSoftness ("Outline Softness", Range(-1,1)) = 0
_Bevel ("Bevel", Range(0,1)) = 0.5
_BevelOffset ("Bevel Offset", Range(-0.5,0.5)) = 0
_BevelWidth ("Bevel Width", Range(-.5,0.5)) = 0
_BevelClamp ("Bevel Clamp", Range(0,1)) = 0
_BevelRoundness ("Bevel Roundness", Range(0,1)) = 0
_LightAngle ("Light Angle", Range(0.0, 6.2831853)) = 3.1416
_SpecularColor ("Specular", Color) = (1,1,1,1)
_SpecularPower ("Specular", Range(0,4)) = 2.0
_Reflectivity ("Reflectivity", Range(5.0,15.0)) = 10
_Diffuse ("Diffuse", Range(0,1)) = 0.5
_Ambient ("Ambient", Range(1,0)) = 0.5
_BumpMap ("Normal map", 2D) = "bump" {}
_BumpOutline ("Bump Outline", Range(0,1)) = 0
_BumpFace ("Bump Face", Range(0,1)) = 0
_ReflectFaceColor ("Reflection Color", Color) = (0,0,0,1)
_ReflectOutlineColor("Reflection Color", Color) = (0,0,0,1)
_Cube ("Reflection Cubemap", Cube) = "black" { /* TexGen CubeReflect */ }
_EnvMatrixRotation ("Texture Rotation", vector) = (0, 0, 0, 0)
_UnderlayColor ("Border Color", Color) = (0,0,0, 0.5)
_UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0
_UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0
_UnderlayDilate ("Border Dilate", Range(-1,1)) = 0
_UnderlaySoftness ("Border Softness", Range(0,1)) = 0
_GlowColor ("Color", Color) = (0, 1, 0, 0.5)
_GlowOffset ("Offset", Range(-1,1)) = 0
_GlowInner ("Inner", Range(0,1)) = 0.05
_GlowOuter ("Outer", Range(0,1)) = 0.05
_GlowPower ("Falloff", Range(1, 0)) = 0.75
_WeightNormal ("Weight Normal", float) = 0
_WeightBold ("Weight Bold", float) = 0.5
_ShaderFlags ("Flags", float) = 0
_ScaleRatioA ("Scale RatioA", float) = 1
_ScaleRatioB ("Scale RatioB", float) = 1
_ScaleRatioC ("Scale RatioC", float) = 1
_MainTex ("Font Atlas", 2D) = "white" {}
_TextureWidth ("Texture Width", float) = 512
_TextureHeight ("Texture Height", float) = 512
_GradientScale ("Gradient Scale", float) = 5.0
_ScaleX ("Scale X", float) = 1.0
_ScaleY ("Scale Y", float) = 1.0
_PerspectiveFilter ("Perspective Correction", Range(0, 1)) = 0.875
_VertexOffsetX ("Vertex OffsetX", float) = 0
_VertexOffsetY ("Vertex OffsetY", float) = 0
_MaskCoord ("Mask Coordinates", vector) = (0, 0, 32767, 32767)
_ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
_MaskSoftnessX ("Mask SoftnessX", float) = 0
_MaskSoftnessY ("Mask SoftnessY", float) = 0
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
_NoiseTex("Noise Texture (A)", 2D) = "white" {}
}
SubShader {
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull [_CullMode]
ZWrite Off
Lighting Off
Fog { Mode Off }
ZTest [unity_GUIZTestMode]
Blend One OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass {
CGPROGRAM
#pragma target 3.0
#pragma vertex VertShader
#pragma fragment frag
#pragma shader_feature __ BEVEL_ON
#pragma shader_feature __ UNDERLAY_ON UNDERLAY_INNER
#pragma shader_feature __ GLOW_ON
#pragma multi_compile __ UNITY_UI_CLIP_RECT
#pragma multi_compile __ UNITY_UI_ALPHACLIP
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#include "Assets/TextMesh Pro/Resources/Shaders/TMPro_Properties.cginc"
#include "Assets/TextMesh Pro/Resources/Shaders/TMPro.cginc"
#define ADD 1
#define UI_TRANSITION 1
#include "Assets/Coffee/UIExtensions/UIEffect/Shaders/UI-Effect.cginc"
#include "UI-Effect-TMPro.cginc"
#pragma shader_feature __ FADE CUTOFF DISSOLVE
fixed4 frag(pixel_t IN) : SV_Target
{
half4 color = PixShader(IN);
// Transition
color = ApplyTransitionEffect(color, IN.eParam);
color.rgb *= color.a;
#if UNITY_UI_ALPHACLIP
clip(color.a - 0.001);
#endif
return color * IN.color.a;
}
ENDCG
}
}
Fallback "TextMeshPro/Mobile/Distance Field (UITransition)"
CustomEditor "Coffee.UIEffect.Editors.TMP_SDFShaderGUI"
}
@@ -0,0 +1,15 @@
fileFormatVersion: 2
guid: fa7d8d6e393ae4a9b94b2331c7d0097c
ShaderImporter:
externalObjects: {}
defaultTextures:
- _FaceTex: {instanceID: 0}
- _OutlineTex: {instanceID: 0}
- _BumpMap: {instanceID: 0}
- _Cube: {instanceID: 0}
- _MainTex: {instanceID: 0}
- _NoiseTex: {fileID: 2800000, guid: 3e04c247fb2604af186173fce0bc62de, type: 3}
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,122 @@
// Simplified SDF shader:
// - No Shading Option (bevel / bump / env map)
// - No Glow Option
// - Softness is applied on both side of the outline
Shader "TextMeshPro/Mobile/Distance Field (UIDissolve)" {
Properties {
_FaceColor ("Face Color", Color) = (1,1,1,1)
_FaceDilate ("Face Dilate", Range(-1,1)) = 0
_OutlineColor ("Outline Color", Color) = (0,0,0,1)
_OutlineWidth ("Outline Thickness", Range(0,1)) = 0
_OutlineSoftness ("Outline Softness", Range(0,1)) = 0
_UnderlayColor ("Border Color", Color) = (0,0,0,.5)
_UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0
_UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0
_UnderlayDilate ("Border Dilate", Range(-1,1)) = 0
_UnderlaySoftness ("Border Softness", Range(0,1)) = 0
_WeightNormal ("Weight Normal", float) = 0
_WeightBold ("Weight Bold", float) = .5
_ShaderFlags ("Flags", float) = 0
_ScaleRatioA ("Scale RatioA", float) = 1
_ScaleRatioB ("Scale RatioB", float) = 1
_ScaleRatioC ("Scale RatioC", float) = 1
_MainTex ("Font Atlas", 2D) = "white" {}
_TextureWidth ("Texture Width", float) = 512
_TextureHeight ("Texture Height", float) = 512
_GradientScale ("Gradient Scale", float) = 5
_ScaleX ("Scale X", float) = 1
_ScaleY ("Scale Y", float) = 1
_PerspectiveFilter ("Perspective Correction", Range(0, 1)) = 0.875
_VertexOffsetX ("Vertex OffsetX", float) = 0
_VertexOffsetY ("Vertex OffsetY", float) = 0
_ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
_MaskSoftnessX ("Mask SoftnessX", float) = 0
_MaskSoftnessY ("Mask SoftnessY", float) = 0
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
_NoiseTex("Noise Texture (A)", 2D) = "white" {}
}
SubShader {
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull [_CullMode]
ZWrite Off
Lighting Off
Fog { Mode Off }
ZTest [unity_GUIZTestMode]
Blend One OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass {
CGPROGRAM
#pragma vertex VertShader
#pragma fragment frag
#pragma shader_feature __ OUTLINE_ON
#pragma shader_feature __ UNDERLAY_ON UNDERLAY_INNER
#pragma multi_compile __ UNITY_UI_CLIP_RECT
#pragma multi_compile __ UNITY_UI_ALPHACLIP
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#include "Assets/TextMesh Pro/Resources/Shaders/TMPro_Properties.cginc"
#define MOBILE 1
#define UI_DISSOLVE 1
#define DISSOLVE 1
#include "Assets/Coffee/UIExtensions/UIEffect/Shaders/UI-Effect.cginc"
#include "UI-Effect-TMPro.cginc"
#pragma shader_feature __ ADD SUBTRACT FILL
fixed4 frag(pixel_t IN) : SV_Target
{
half4 color = PixShader(IN);
// Dissolve
color = ApplyTransitionEffect(color, IN.eParam);
color.rgb *= color.a;
#if UNITY_UI_ALPHACLIP
clip(color.a - 0.001);
#endif
return color * IN.color.a;
}
ENDCG
}
}
CustomEditor "Coffee.UIEffect.Editors.TMP_SDFShaderGUI"
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 15b053e7702f54708a75b82db8303cba
ShaderImporter:
externalObjects: {}
defaultTextures:
- _MainTex: {instanceID: 0}
- _NoiseTex: {fileID: 2800000, guid: 3e04c247fb2604af186173fce0bc62de, type: 3}
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,140 @@
// Simplified SDF shader:
// - No Shading Option (bevel / bump / env map)
// - No Glow Option
// - Softness is applied on both side of the outline
Shader "TextMeshPro/Mobile/Distance Field (UIEffect)" {
Properties {
_FaceColor ("Face Color", Color) = (1,1,1,1)
_FaceDilate ("Face Dilate", Range(-1,1)) = 0
_OutlineColor ("Outline Color", Color) = (0,0,0,1)
_OutlineWidth ("Outline Thickness", Range(0,1)) = 0
_OutlineSoftness ("Outline Softness", Range(0,1)) = 0
_UnderlayColor ("Border Color", Color) = (0,0,0,.5)
_UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0
_UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0
_UnderlayDilate ("Border Dilate", Range(-1,1)) = 0
_UnderlaySoftness ("Border Softness", Range(0,1)) = 0
_WeightNormal ("Weight Normal", float) = 0
_WeightBold ("Weight Bold", float) = .5
_ShaderFlags ("Flags", float) = 0
_ScaleRatioA ("Scale RatioA", float) = 1
_ScaleRatioB ("Scale RatioB", float) = 1
_ScaleRatioC ("Scale RatioC", float) = 1
_MainTex ("Font Atlas", 2D) = "white" {}
_TextureWidth ("Texture Width", float) = 512
_TextureHeight ("Texture Height", float) = 512
_GradientScale ("Gradient Scale", float) = 5
_ScaleX ("Scale X", float) = 1
_ScaleY ("Scale Y", float) = 1
_PerspectiveFilter ("Perspective Correction", Range(0, 1)) = 0.875
_VertexOffsetX ("Vertex OffsetX", float) = 0
_VertexOffsetY ("Vertex OffsetY", float) = 0
_ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
_MaskSoftnessX ("Mask SoftnessX", float) = 0
_MaskSoftnessY ("Mask SoftnessY", float) = 0
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
_NoiseTex("Noise Texture (A)", 2D) = "white" {}
}
SubShader {
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull [_CullMode]
ZWrite Off
Lighting Off
Fog { Mode Off }
ZTest [unity_GUIZTestMode]
Blend One OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass {
CGPROGRAM
#pragma vertex VertShader
#pragma fragment frag
#pragma shader_feature __ OUTLINE_ON
#pragma shader_feature __ UNDERLAY_ON UNDERLAY_INNER
#pragma multi_compile __ UNITY_UI_CLIP_RECT
#pragma multi_compile __ UNITY_UI_ALPHACLIP
#pragma shader_feature __ GRAYSCALE SEPIA NEGA PIXEL
#pragma shader_feature __ ADD SUBTRACT FILL
#pragma shader_feature __ FASTBLUR MEDIUMBLUR DETAILBLUR
#pragma shader_feature __ EX
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#include "Assets/TextMesh Pro/Resources/Shaders/TMPro_Properties.cginc"
#define MOBILE 1
#define UI_EFFECT 1
#include "Assets/Coffee/UIExtensions/UIEffect/Shaders/UI-Effect.cginc"
#include "UI-Effect-TMPro.cginc"
fixed4 frag(pixel_t IN) : SV_Target
{
fixed4 param = tex2D(_ParamTex, float2(0.5, IN.eParam));
fixed effectFactor = param.x;
fixed colorFactor = param.y;
fixed blurFactor = param.z;
#if PIXEL
half2 pixelSize = max(2, (1-effectFactor*0.95) * float2(_TextureWidth, _TextureHeight));
UV(IN).xy = round(UV(IN).xy * pixelSize) / pixelSize;
#endif
#if defined(UI_BLUR) && EX
half4 color = Tex2DBlurring(IN, blurFactor * float2(1/_TextureWidth, 1/_TextureHeight) * 4, IN.uvMask);
#elif defined(UI_BLUR)
half4 color = Tex2DBlurring(IN, blurFactor * float2(1/_TextureWidth, 1/_TextureHeight) * 4);
#else
half4 color = PixShader(IN) * IN.color.a;
#endif
#if defined (UI_TONE)
color = ApplyToneEffect(color, effectFactor);
#endif
color = ApplyColorEffect(color, fixed4(IN.color.rgb, colorFactor));
color.rgb *= color.a;
return color * IN.color.a;
}
ENDCG
}
}
CustomEditor "Coffee.UIEffect.Editors.TMP_SDFShaderGUI"
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: af5de66855c8d4b758264103262d4883
ShaderImporter:
externalObjects: {}
defaultTextures:
- _MainTex: {instanceID: 0}
- _NoiseTex: {fileID: 2800000, guid: 3e04c247fb2604af186173fce0bc62de, type: 3}
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,120 @@
// Simplified SDF shader:
// - No Shading Option (bevel / bump / env map)
// - No Glow Option
// - Softness is applied on both side of the outline
Shader "TextMeshPro/Mobile/Distance Field (UIHsvModifier)" {
Properties {
_FaceColor ("Face Color", Color) = (1,1,1,1)
_FaceDilate ("Face Dilate", Range(-1,1)) = 0
_OutlineColor ("Outline Color", Color) = (0,0,0,1)
_OutlineWidth ("Outline Thickness", Range(0,1)) = 0
_OutlineSoftness ("Outline Softness", Range(0,1)) = 0
_UnderlayColor ("Border Color", Color) = (0,0,0,.5)
_UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0
_UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0
_UnderlayDilate ("Border Dilate", Range(-1,1)) = 0
_UnderlaySoftness ("Border Softness", Range(0,1)) = 0
_WeightNormal ("Weight Normal", float) = 0
_WeightBold ("Weight Bold", float) = .5
_ShaderFlags ("Flags", float) = 0
_ScaleRatioA ("Scale RatioA", float) = 1
_ScaleRatioB ("Scale RatioB", float) = 1
_ScaleRatioC ("Scale RatioC", float) = 1
_MainTex ("Font Atlas", 2D) = "white" {}
_TextureWidth ("Texture Width", float) = 512
_TextureHeight ("Texture Height", float) = 512
_GradientScale ("Gradient Scale", float) = 5
_ScaleX ("Scale X", float) = 1
_ScaleY ("Scale Y", float) = 1
_PerspectiveFilter ("Perspective Correction", Range(0, 1)) = 0.875
_VertexOffsetX ("Vertex OffsetX", float) = 0
_VertexOffsetY ("Vertex OffsetY", float) = 0
_ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
_MaskSoftnessX ("Mask SoftnessX", float) = 0
_MaskSoftnessY ("Mask SoftnessY", float) = 0
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
_NoiseTex("Noise Texture (A)", 2D) = "white" {}
}
SubShader {
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull [_CullMode]
ZWrite Off
Lighting Off
Fog { Mode Off }
ZTest [unity_GUIZTestMode]
Blend One OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass {
CGPROGRAM
#pragma vertex VertShader
#pragma fragment frag
#pragma shader_feature __ OUTLINE_ON
#pragma shader_feature __ UNDERLAY_ON UNDERLAY_INNER
#pragma multi_compile __ UNITY_UI_CLIP_RECT
#pragma multi_compile __ UNITY_UI_ALPHACLIP
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#include "Assets/TextMesh Pro/Resources/Shaders/TMPro_Properties.cginc"
#define MOBILE 1
#define UI_HSV_MODIFIER 1
#include "Assets/Coffee/UIExtensions/UIEffect/Shaders/UI-Effect.cginc"
#include "UI-Effect-TMPro.cginc"
fixed4 frag(pixel_t IN) : SV_Target
{
half4 color = PixShader(IN);
#if UNITY_UI_ALPHACLIP
clip(color.a - 0.001);
#endif
// Hsv
color = ApplyHsvEffect(color, IN.eParam);
color.rgb *= IN.color.rgb;
return color * IN.color.a;
}
ENDCG
}
}
CustomEditor "TMPro.EditorUtilities.TMP_SDFShaderGUI"
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 374467ba16b434455b8886b70c293a0d
ShaderImporter:
externalObjects: {}
defaultTextures:
- _MainTex: {instanceID: 0}
- _NoiseTex: {fileID: 2800000, guid: 3e04c247fb2604af186173fce0bc62de, type: 3}
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,119 @@
// Simplified SDF shader:
// - No Shading Option (bevel / bump / env map)
// - No Glow Option
// - Softness is applied on both side of the outline
Shader "TextMeshPro/Mobile/Distance Field (UIShiny)" {
Properties {
_FaceColor ("Face Color", Color) = (1,1,1,1)
_FaceDilate ("Face Dilate", Range(-1,1)) = 0
_OutlineColor ("Outline Color", Color) = (0,0,0,1)
_OutlineWidth ("Outline Thickness", Range(0,1)) = 0
_OutlineSoftness ("Outline Softness", Range(0,1)) = 0
_UnderlayColor ("Border Color", Color) = (0,0,0,.5)
_UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0
_UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0
_UnderlayDilate ("Border Dilate", Range(-1,1)) = 0
_UnderlaySoftness ("Border Softness", Range(0,1)) = 0
_WeightNormal ("Weight Normal", float) = 0
_WeightBold ("Weight Bold", float) = .5
_ShaderFlags ("Flags", float) = 0
_ScaleRatioA ("Scale RatioA", float) = 1
_ScaleRatioB ("Scale RatioB", float) = 1
_ScaleRatioC ("Scale RatioC", float) = 1
_MainTex ("Font Atlas", 2D) = "white" {}
_TextureWidth ("Texture Width", float) = 512
_TextureHeight ("Texture Height", float) = 512
_GradientScale ("Gradient Scale", float) = 5
_ScaleX ("Scale X", float) = 1
_ScaleY ("Scale Y", float) = 1
_PerspectiveFilter ("Perspective Correction", Range(0, 1)) = 0.875
_VertexOffsetX ("Vertex OffsetX", float) = 0
_VertexOffsetY ("Vertex OffsetY", float) = 0
_ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
_MaskSoftnessX ("Mask SoftnessX", float) = 0
_MaskSoftnessY ("Mask SoftnessY", float) = 0
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
_NoiseTex("Noise Texture (A)", 2D) = "white" {}
}
SubShader {
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull [_CullMode]
ZWrite Off
Lighting Off
Fog { Mode Off }
ZTest [unity_GUIZTestMode]
Blend One OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass {
CGPROGRAM
#pragma vertex VertShader
#pragma fragment frag
#pragma shader_feature __ OUTLINE_ON
#pragma shader_feature __ UNDERLAY_ON UNDERLAY_INNER
#pragma multi_compile __ UNITY_UI_CLIP_RECT
#pragma multi_compile __ UNITY_UI_ALPHACLIP
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#include "Assets/TextMesh Pro/Resources/Shaders/TMPro_Properties.cginc"
#define MOBILE 1
#define UI_SHINY 1
#include "Assets/Coffee/UIExtensions/UIEffect/Shaders/UI-Effect.cginc"
#include "UI-Effect-TMPro.cginc"
fixed4 frag(pixel_t IN) : SV_Target
{
half4 color = PixShader(IN);
#if UNITY_UI_ALPHACLIP
clip(color.a - 0.001);
#endif
// Shiny
color = ApplyShinyEffect(color, IN.eParam);
return color * IN.color.a;
}
ENDCG
}
}
CustomEditor "TMPro.EditorUtilities.TMP_SDFShaderGUI"
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: f852f73c234534dbc9da0e57e661dc9d
ShaderImporter:
externalObjects: {}
defaultTextures:
- _MainTex: {instanceID: 0}
- _NoiseTex: {fileID: 2800000, guid: 3e04c247fb2604af186173fce0bc62de, type: 3}
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,122 @@
// Simplified SDF shader:
// - No Shading Option (bevel / bump / env map)
// - No Glow Option
// - Softness is applied on both side of the outline
Shader "TextMeshPro/Mobile/Distance Field (UITransition)" {
Properties {
_FaceColor ("Face Color", Color) = (1,1,1,1)
_FaceDilate ("Face Dilate", Range(-1,1)) = 0
_OutlineColor ("Outline Color", Color) = (0,0,0,1)
_OutlineWidth ("Outline Thickness", Range(0,1)) = 0
_OutlineSoftness ("Outline Softness", Range(0,1)) = 0
_UnderlayColor ("Border Color", Color) = (0,0,0,.5)
_UnderlayOffsetX ("Border OffsetX", Range(-1,1)) = 0
_UnderlayOffsetY ("Border OffsetY", Range(-1,1)) = 0
_UnderlayDilate ("Border Dilate", Range(-1,1)) = 0
_UnderlaySoftness ("Border Softness", Range(0,1)) = 0
_WeightNormal ("Weight Normal", float) = 0
_WeightBold ("Weight Bold", float) = .5
_ShaderFlags ("Flags", float) = 0
_ScaleRatioA ("Scale RatioA", float) = 1
_ScaleRatioB ("Scale RatioB", float) = 1
_ScaleRatioC ("Scale RatioC", float) = 1
_MainTex ("Font Atlas", 2D) = "white" {}
_TextureWidth ("Texture Width", float) = 512
_TextureHeight ("Texture Height", float) = 512
_GradientScale ("Gradient Scale", float) = 5
_ScaleX ("Scale X", float) = 1
_ScaleY ("Scale Y", float) = 1
_PerspectiveFilter ("Perspective Correction", Range(0, 1)) = 0.875
_VertexOffsetX ("Vertex OffsetX", float) = 0
_VertexOffsetY ("Vertex OffsetY", float) = 0
_ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
_MaskSoftnessX ("Mask SoftnessX", float) = 0
_MaskSoftnessY ("Mask SoftnessY", float) = 0
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
_NoiseTex("Noise Texture (A)", 2D) = "white" {}
}
SubShader {
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull [_CullMode]
ZWrite Off
Lighting Off
Fog { Mode Off }
ZTest [unity_GUIZTestMode]
Blend One OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass {
CGPROGRAM
#pragma vertex VertShader
#pragma fragment frag
#pragma shader_feature __ OUTLINE_ON
#pragma shader_feature __ UNDERLAY_ON UNDERLAY_INNER
#pragma multi_compile __ UNITY_UI_CLIP_RECT
#pragma multi_compile __ UNITY_UI_ALPHACLIP
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#include "Assets/TextMesh Pro/Resources/Shaders/TMPro_Properties.cginc"
#define MOBILE 1
#define ADD 1
#define UI_TRANSITION 1
#include "Assets/Coffee/UIExtensions/UIEffect/Shaders/UI-Effect.cginc"
#include "UI-Effect-TMPro.cginc"
#pragma shader_feature __ FADE CUTOFF DISSOLVE
fixed4 frag(pixel_t IN) : SV_Target
{
half4 color = PixShader(IN);
// Transition
color = ApplyTransitionEffect(color, IN.eParam);
color.rgb *= color.a;
#if UNITY_UI_ALPHACLIP
clip(color.a - 0.001);
#endif
return color * IN.color.a;
}
ENDCG
}
}
CustomEditor "Coffee.UIEffect.Editors.TMP_SDFShaderGUI"
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 3158328dfc0344d72bc0e7eaa29cac0e
ShaderImporter:
externalObjects: {}
defaultTextures:
- _MainTex: {instanceID: 0}
- _NoiseTex: {fileID: 2800000, guid: 3e04c247fb2604af186173fce0bc62de, type: 3}
nonModifiableTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,90 @@
Shader "TextMeshPro/Sprite (UIDissolve)"
{
Properties
{
_MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
_ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0
_NoiseTex("Noise Texture (A)", 2D) = "white" {}
}
SubShader
{
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull Off
Lighting Off
ZWrite Off
ZTest [unity_GUIZTestMode]
Blend SrcAlpha OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#pragma multi_compile __ UNITY_UI_CLIP_RECT
#pragma multi_compile __ UNITY_UI_ALPHACLIP
#define TMP_SPRITE 1
#define UI_DISSOLVE 1
#define DISSOLVE 1
#include "Assets/Coffee/UIExtensions/UIEffect/Shaders/UI-Effect.cginc"
#include "Assets/Coffee/UIExtensions/UIEffect/Shaders/UI-Effect-Sprite.cginc"
#pragma shader_feature __ ADD SUBTRACT FILL
fixed4 frag(v2f IN) : SV_Target
{
half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd) * IN.color;
#if UNITY_UI_CLIP_RECT
color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
#endif
#ifdef UNITY_UI_ALPHACLIP
clip (color.a - 0.001);
#endif
// Dissolve
color = ApplyTransitionEffect(color, IN.eParam);
return color;
}
ENDCG
}
}
CustomEditor "Coffee.UIEffect.Editors.TMP_SDFShaderGUI"
}
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 43184227f35f24905865f36834c4fea9
timeCreated: 1450517184
licenseType: Pro
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,110 @@
Shader "TextMeshPro/Sprite (UIEffect)"
{
Properties
{
_MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
_ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0
_NoiseTex("Noise Texture (A)", 2D) = "white" {}
}
SubShader
{
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull Off
Lighting Off
ZWrite Off
ZTest [unity_GUIZTestMode]
Blend SrcAlpha OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#pragma multi_compile __ UNITY_UI_CLIP_RECT
#pragma multi_compile __ UNITY_UI_ALPHACLIP
#pragma shader_feature __ GRAYSCALE SEPIA NEGA PIXEL
#pragma shader_feature __ ADD SUBTRACT FILL
#pragma shader_feature __ FASTBLUR MEDIUMBLUR DETAILBLUR
#pragma shader_feature __ EX
#define TMP_SPRITE 1
#define UI_EFFECT 1
#include "Assets/Coffee/UIExtensions/UIEffect/Shaders/UI-Effect.cginc"
#include "Assets/Coffee/UIExtensions/UIEffect/Shaders/UI-Effect-Sprite.cginc"
fixed4 frag(v2f IN) : SV_Target
{
fixed4 param = tex2D(_ParamTex, float2(0.5, IN.eParam));
fixed effectFactor = param.x;
fixed colorFactor = param.y;
fixed blurFactor = param.z;
#if PIXEL
half2 pixelSize = max(2, (1-effectFactor*0.95) * _MainTex_TexelSize.zw);
IN.texcoord = round(IN.texcoord * pixelSize) / pixelSize;
#endif
#if defined(UI_BLUR) && EX
half4 color = (Tex2DBlurring(_MainTex, IN.texcoord, blurFactor * _MainTex_TexelSize.xy * 2, IN.uvMask) + _TextureSampleAdd);
#elif defined(UI_BLUR)
half4 color = (Tex2DBlurring(_MainTex, IN.texcoord, blurFactor * _MainTex_TexelSize.xy * 2) + _TextureSampleAdd);
#else
half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd);
#endif
color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
#if UNITY_UI_ALPHACLIP
clip (color.a - 0.001);
#endif
#if defined (UI_TONE)
color = ApplyToneEffect(color, effectFactor);
#endif
color = ApplyColorEffect(color, fixed4(IN.color.rgb, colorFactor));
color.a *= IN.color.a;
return color;
}
ENDCG
}
}
CustomEditor "Coffee.UIEffect.Editors.TMP_SDFShaderGUI"
}
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 466007890ce83421082c2d58b0121dcd
timeCreated: 1450517184
licenseType: Pro
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,87 @@
Shader "TextMeshPro/Sprite (UIHsvModifier)"
{
Properties
{
_MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
_ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0
_NoiseTex("Noise Texture (A)", 2D) = "white" {}
}
SubShader
{
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull Off
Lighting Off
ZWrite Off
ZTest [unity_GUIZTestMode]
Blend SrcAlpha OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#pragma multi_compile __ UNITY_UI_CLIP_RECT
#pragma multi_compile __ UNITY_UI_ALPHACLIP
#define TMP_SPRITE 1
#define UI_HSV_MODIFIER 1
#include "Assets/Coffee/UIExtensions/UIEffect/Shaders/UI-Effect.cginc"
#include "Assets/Coffee/UIExtensions/UIEffect/Shaders/UI-Effect-Sprite.cginc"
fixed4 frag(v2f IN) : SV_Target
{
half4 color = tex2D(_MainTex, IN.texcoord);// + _TextureSampleAdd) * IN.color;
#if UNITY_UI_CLIP_RECT
color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
#endif
#ifdef UNITY_UI_ALPHACLIP
clip (color.a - 0.001);
#endif
// Hsv
color = (ApplyHsvEffect(color, IN.eParam)+ _TextureSampleAdd) * IN.color;
return color;
}
ENDCG
}
}
CustomEditor "Coffee.UIEffect.Editors.TMP_SDFShaderGUI"
}
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 1c6bc77283bff44c7aad3f18690f024b
timeCreated: 1450517184
licenseType: Pro
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,87 @@
Shader "TextMeshPro/Sprite (UIShiny)"
{
Properties
{
_MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
_ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0
_NoiseTex("Noise Texture (A)", 2D) = "white" {}
}
SubShader
{
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull Off
Lighting Off
ZWrite Off
ZTest [unity_GUIZTestMode]
Blend SrcAlpha OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#pragma multi_compile __ UNITY_UI_CLIP_RECT
#pragma multi_compile __ UNITY_UI_ALPHACLIP
#define TMP_SPRITE 1
#define UI_SHINY 1
#include "Assets/Coffee/UIExtensions/UIEffect/Shaders/UI-Effect.cginc"
#include "Assets/Coffee/UIExtensions/UIEffect/Shaders/UI-Effect-Sprite.cginc"
fixed4 frag(v2f IN) : SV_Target
{
half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd) * IN.color;
#if UNITY_UI_CLIP_RECT
color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
#endif
#ifdef UNITY_UI_ALPHACLIP
clip (color.a - 0.001);
#endif
// Shiny
color = ApplyShinyEffect(color, IN.eParam);
return color;
}
ENDCG
}
}
CustomEditor "Coffee.UIEffect.Editors.TMP_SDFShaderGUI"
}
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: c518dd47762104054aeb15fbb2092350
timeCreated: 1450517184
licenseType: Pro
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,90 @@
Shader "TextMeshPro/Sprite (UITransition)"
{
Properties
{
_MainTex ("Sprite Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
_StencilOp ("Stencil Operation", Float) = 0
_StencilWriteMask ("Stencil Write Mask", Float) = 255
_StencilReadMask ("Stencil Read Mask", Float) = 255
_ColorMask ("Color Mask", Float) = 15
_ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0
_NoiseTex("Noise Texture (A)", 2D) = "white" {}
}
SubShader
{
Tags
{
"Queue"="Transparent"
"IgnoreProjector"="True"
"RenderType"="Transparent"
"PreviewType"="Plane"
"CanUseSpriteAtlas"="True"
}
Stencil
{
Ref [_Stencil]
Comp [_StencilComp]
Pass [_StencilOp]
ReadMask [_StencilReadMask]
WriteMask [_StencilWriteMask]
}
Cull Off
Lighting Off
ZWrite Off
ZTest [unity_GUIZTestMode]
Blend SrcAlpha OneMinusSrcAlpha
ColorMask [_ColorMask]
Pass
{
CGPROGRAM
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#pragma multi_compile __ UNITY_UI_CLIP_RECT
#pragma multi_compile __ UNITY_UI_ALPHACLIP
#define TMP_SPRITE 1
#define UI_TRANSITION 1
#define ADD 1
#include "Assets/Coffee/UIExtensions/UIEffect/Shaders/UI-Effect.cginc"
#include "Assets/Coffee/UIExtensions/UIEffect/Shaders/UI-Effect-Sprite.cginc"
#pragma shader_feature __ FADE CUTOFF DISSOLVE
fixed4 frag(v2f IN) : SV_Target
{
half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd) * IN.color;
#if UNITY_UI_CLIP_RECT
color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
#endif
#ifdef UNITY_UI_ALPHACLIP
clip (color.a - 0.001);
#endif
// Transition
color = ApplyTransitionEffect(color, IN.eParam);
color.rgb *= color.a;
return color;
}
ENDCG
}
}
CustomEditor "Coffee.UIEffect.Editors.TMP_SDFShaderGUI"
}
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: 8a91c64bfdfa7448cb176a87750a6b64
timeCreated: 1450517184
licenseType: Pro
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,452 @@
#ifndef UI_EFFECT_TMPRO_INCLUDED
#define UI_EFFECT_TMPRO_INCLUDED
// Used by Unity internally to handle Texture Tiling and Offset.
float4 _FaceTex_ST;
float4 _OutlineTex_ST;
#if MOBILE
#define UV(x) x.texcoord0
#define UV2(x) x.texcoord1
struct vertex_t {
float4 vertex : POSITION;
float3 normal : NORMAL;
fixed4 color : COLOR;
float2 texcoord0 : TEXCOORD0;
float2 texcoord1 : TEXCOORD1;
#if EX
float2 uvMask : TEXCOORD2;
#endif
};
struct pixel_t {
float4 vertex : SV_POSITION;
fixed4 faceColor : COLOR;
fixed4 outlineColor : COLOR1;
float4 texcoord0 : TEXCOORD0; // Texture UV, Mask UV
half4 param : TEXCOORD1; // Scale(x), BiasIn(y), BiasOut(z), Bias(w)
half4 mask : TEXCOORD2; // Position in clip space(xy), Softness(zw)
#if (UNDERLAY_ON | UNDERLAY_INNER)
float4 texcoord1 : TEXCOORD3; // Texture UV, alpha, reserved
half2 underlayParam : TEXCOORD4; // Scale(x), Bias(y)
#endif
fixed4 color : COLOR2;
#if UI_DISSOLVE || UI_TRANSITION
half3 eParam : TEXCOORD5;
#elif UI_SHINY
half2 eParam : TEXCOORD5;
#else
half eParam : TEXCOORD5;
#endif
#if EX
half4 uvMask : TEXCOORD6;
#endif
};
pixel_t VertShader(vertex_t input)
{
float bold = step(input.texcoord1.y, 0);
float4 vert = input.vertex;
vert.x += _VertexOffsetX;
vert.y += _VertexOffsetY;
float4 vPosition = UnityObjectToClipPos(vert);
float2 pixelSize = vPosition.w;
pixelSize /= float2(_ScaleX, _ScaleY) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy));
float scale = rsqrt(dot(pixelSize, pixelSize));
scale *= abs(input.texcoord1.y) * _GradientScale * 1.5;
if(UNITY_MATRIX_P[3][3] == 0) scale = lerp(abs(scale) * (1 - _PerspectiveFilter), scale, abs(dot(UnityObjectToWorldNormal(input.normal.xyz), normalize(WorldSpaceViewDir(vert)))));
float weight = lerp(_WeightNormal, _WeightBold, bold) / 4.0;
weight = (weight + _FaceDilate) * _ScaleRatioA * 0.5;
float layerScale = scale;
scale /= 1 + (_OutlineSoftness * _ScaleRatioA * scale);
float bias = (0.5 - weight) * scale - 0.5;
float outline = _OutlineWidth * _ScaleRatioA * 0.5 * scale;
// float opacity = input.color.a;
//#if (UNDERLAY_ON | UNDERLAY_INNER)
// opacity = 1.0;
//#endif
fixed4 faceColor = input.color * _FaceColor;
// fixed4 faceColor = fixed4(input.color.rgb, opacity) * _FaceColor;
// faceColor.rgb *= faceColor.a;
fixed4 outlineColor = _OutlineColor;
// outlineColor.a *= opacity;
// outlineColor.rgb *= outlineColor.a;
outlineColor = lerp(faceColor, outlineColor, sqrt(min(1.0, (outline * 2))));
#if (UNDERLAY_ON | UNDERLAY_INNER)
layerScale /= 1 + ((_UnderlaySoftness * _ScaleRatioC) * layerScale);
float layerBias = (.5 - weight) * layerScale - .5 - ((_UnderlayDilate * _ScaleRatioC) * .5 * layerScale);
float x = -(_UnderlayOffsetX * _ScaleRatioC) * _GradientScale / _TextureWidth;
float y = -(_UnderlayOffsetY * _ScaleRatioC) * _GradientScale / _TextureHeight;
float2 layerOffset = float2(x, y);
#endif
// Generate UV for the Masking Texture
float4 clampedRect = clamp(_ClipRect, -2e10, 2e10);
float2 maskUV = (vert.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy);
// Structure for pixel shader
#if UI_DISSOLVE || UI_TRANSITION
half3 param = UnpackToVec3(input.texcoord0.y);
#elif UI_SHINY
half2 param = UnpackToVec2(input.texcoord0.y);
#else
half param = input.texcoord0.y;
#endif
#if UI_EFFECT
input.texcoord0 = UnpackToVec2(input.texcoord0.x) * 2 - 0.5;
#else
input.texcoord0 = UnpackToVec2(input.texcoord0.x);
#endif
pixel_t output = {
vPosition,
faceColor,
outlineColor,
float4(input.texcoord0, maskUV.x, maskUV.y),
half4(scale, bias - outline, bias + outline, bias),
half4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy)),
#if (UNDERLAY_ON | UNDERLAY_INNER)
float4(input.texcoord0 + layerOffset, input.color.a, 0),
half2(layerScale, layerBias),
#endif
input.color,
param,
#if EX
half4(UnpackToVec2(input.uvMask.x), UnpackToVec2(input.uvMask.y)),
#endif
};
return output;
}
// PIXEL SHADER
fixed4 PixShader(pixel_t input) : SV_Target
{
half d = tex2D(_MainTex, input.texcoord0.xy).a * input.param.x;
half4 c = input.faceColor * saturate(d - input.param.w);
#ifdef OUTLINE_ON
c = lerp(input.outlineColor, input.faceColor, saturate(d - input.param.z));
c *= saturate(d - input.param.y);
#endif
#if UNDERLAY_ON
d = tex2D(_MainTex, input.texcoord1.xy).a * input.underlayParam.x;
c += float4(_UnderlayColor.rgb * _UnderlayColor.a, _UnderlayColor.a) * saturate(d - input.underlayParam.y) * (1 - c.a);
#endif
#if UNDERLAY_INNER
half sd = saturate(d - input.param.z);
d = tex2D(_MainTex, input.texcoord1.xy).a * input.underlayParam.x;
c += float4(_UnderlayColor.rgb * _UnderlayColor.a, _UnderlayColor.a) * (1 - saturate(d - input.underlayParam.y)) * sd * (1 - c.a);
#endif
// Alternative implementation to UnityGet2DClipping with support for softness.
#if UNITY_UI_CLIP_RECT
half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(input.mask.xy)) * input.mask.zw);
c *= m.x * m.y;
#endif
#if (UNDERLAY_ON | UNDERLAY_INNER)
// c *= input.texcoord1.z;
#endif
// Dissolve
//c = ApplyTransitionEffect(c, input.eParam);
//c.rgb *= c.a;
#if UNITY_UI_ALPHACLIP
clip(c.a - 0.001);
#endif
return c;
}
#else
#define UV(x) x.atlas
#define UV2(x) x.texcoord2
struct vertex_t {
float4 position : POSITION;
float3 normal : NORMAL;
fixed4 color : COLOR;
float2 texcoord0 : TEXCOORD0;
float2 texcoord1 : TEXCOORD1;
#if EX
float2 uvMask : TEXCOORD2;
#endif
};
struct pixel_t {
float4 position : SV_POSITION;
fixed4 color : COLOR;
float2 atlas : TEXCOORD0; // Atlas
float4 param : TEXCOORD1; // alphaClip, scale, bias, weight
float4 mask : TEXCOORD2; // Position in object space(xy), pixel Size(zw)
float3 viewDir : TEXCOORD3;
#if (UNDERLAY_ON || UNDERLAY_INNER)
float4 texcoord2 : TEXCOORD4; // u,v, scale, bias
fixed4 underlayColor : COLOR1;
#endif
float4 textures : TEXCOORD5;
#if UI_DISSOLVE || UI_TRANSITION
half3 eParam : TEXCOORD6;
#elif UI_SHINY
half2 eParam : TEXCOORD6;
#else
half eParam : TEXCOORD6;
#endif
#if EX
half4 uvMask : TEXCOORD7;
#endif
};
pixel_t VertShader(vertex_t input)
{
float bold = step(input.texcoord1.y, 0);
float4 vert = input.position;
vert.x += _VertexOffsetX;
vert.y += _VertexOffsetY;
float4 vPosition = UnityObjectToClipPos(vert);
float2 pixelSize = vPosition.w;
pixelSize /= float2(_ScaleX, _ScaleY) * abs(mul((float2x2)UNITY_MATRIX_P, _ScreenParams.xy));
float scale = rsqrt(dot(pixelSize, pixelSize));
scale *= abs(input.texcoord1.y) * _GradientScale * 1.5;
if (UNITY_MATRIX_P[3][3] == 0) scale = lerp(abs(scale) * (1 - _PerspectiveFilter), scale, abs(dot(UnityObjectToWorldNormal(input.normal.xyz), normalize(WorldSpaceViewDir(vert)))));
float weight = lerp(_WeightNormal, _WeightBold, bold) / 4.0;
weight = (weight + _FaceDilate) * _ScaleRatioA * 0.5;
float bias =(.5 - weight) + (.5 / scale);
float alphaClip = (1.0 - _OutlineWidth*_ScaleRatioA - _OutlineSoftness*_ScaleRatioA);
#if GLOW_ON
alphaClip = min(alphaClip, 1.0 - _GlowOffset * _ScaleRatioB - _GlowOuter * _ScaleRatioB);
#endif
alphaClip = alphaClip / 2.0 - ( .5 / scale) - weight;
#if (UNDERLAY_ON || UNDERLAY_INNER)
float4 underlayColor = _UnderlayColor;
underlayColor.rgb *= underlayColor.a;
float bScale = scale;
bScale /= 1 + ((_UnderlaySoftness*_ScaleRatioC) * bScale);
float bBias = (0.5 - weight) * bScale - 0.5 - ((_UnderlayDilate * _ScaleRatioC) * 0.5 * bScale);
float x = -(_UnderlayOffsetX * _ScaleRatioC) * _GradientScale / _TextureWidth;
float y = -(_UnderlayOffsetY * _ScaleRatioC) * _GradientScale / _TextureHeight;
float2 bOffset = float2(x, y);
#endif
// Generate UV for the Masking Texture
float4 clampedRect = clamp(_ClipRect, -2e10, 2e10);
float2 maskUV = (vert.xy - clampedRect.xy) / (clampedRect.zw - clampedRect.xy);
// Support for texture tiling and offset
float2 textureUV = UnpackUV(input.texcoord1.x);
float2 faceUV = TRANSFORM_TEX(textureUV, _FaceTex);
float2 outlineUV = TRANSFORM_TEX(textureUV, _OutlineTex);
#if UI_DISSOLVE || UI_TRANSITION
half3 param = UnpackToVec3(input.texcoord0.y);
#elif UI_SHINY
half2 param = UnpackToVec2(input.texcoord0.y);
#else
half param = input.texcoord0.y;
#endif
#if UI_EFFECT
input.texcoord0 = UnpackToVec2(input.texcoord0.x) * 2 - 0.5;
#else
input.texcoord0 = UnpackToVec2(input.texcoord0.x);
#endif
pixel_t output = {
vPosition,
input.color,
input.texcoord0,
float4(alphaClip, scale, bias, weight),
half4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy)),
mul((float3x3)_EnvMatrix, _WorldSpaceCameraPos.xyz - mul(unity_ObjectToWorld, vert).xyz),
#if (UNDERLAY_ON || UNDERLAY_INNER)
float4(input.texcoord0 + bOffset, bScale, bBias),
underlayColor,
#endif
float4(faceUV, outlineUV),
param,
#if EX
half4(UnpackToVec2(input.uvMask.x), UnpackToVec2(input.uvMask.y)),
#endif
};
return output;
}
fixed4 PixShader(pixel_t input)// : SV_Target
{
float c = tex2D(_MainTex, input.atlas).a;
// #ifndef UNDERLAY_ON
// clip(c - input.param.x);
// #endif
float scale = input.param.y;
float bias = input.param.z;
float weight = input.param.w;
float sd = (bias - c) * scale;
float outline = (_OutlineWidth * _ScaleRatioA) * scale;
float softness = (_OutlineSoftness * _ScaleRatioA) * scale;
half4 faceColor = _FaceColor;
half4 outlineColor = _OutlineColor;
// faceColor.rgb *= input.color.rgb;
faceColor *= tex2D(_FaceTex, input.textures.xy + float2(_FaceUVSpeedX, _FaceUVSpeedY) * _Time.y);
outlineColor *= tex2D(_OutlineTex, input.textures.zw + float2(_OutlineUVSpeedX, _OutlineUVSpeedY) * _Time.y);
faceColor = GetColor(sd, faceColor, outlineColor, outline, softness);
#if BEVEL_ON
float3 dxy = float3(0.5 / _TextureWidth, 0.5 / _TextureHeight, 0);
float3 n = GetSurfaceNormal(input.atlas, weight, dxy);
float3 bump = UnpackNormal(tex2D(_BumpMap, input.textures.xy + float2(_FaceUVSpeedX, _FaceUVSpeedY) * _Time.y)).xyz;
bump *= lerp(_BumpFace, _BumpOutline, saturate(sd + outline * 0.5));
n = normalize(n- bump);
float3 light = normalize(float3(sin(_LightAngle), cos(_LightAngle), -1.0));
float3 col = GetSpecular(n, light);
faceColor.rgb += col*faceColor.a;
faceColor.rgb *= 1-(dot(n, light)*_Diffuse);
faceColor.rgb *= lerp(_Ambient, 1, n.z*n.z);
fixed4 reflcol = texCUBE(_Cube, reflect(input.viewDir, -n));
faceColor.rgb += reflcol.rgb * lerp(_ReflectFaceColor.rgb, _ReflectOutlineColor.rgb, saturate(sd + outline * 0.5)) * faceColor.a;
#endif
#if UNDERLAY_ON
float d = tex2D(_MainTex, input.texcoord2.xy).a * input.texcoord2.z;
faceColor += input.underlayColor * saturate(d - input.texcoord2.w) * (1 - faceColor.a);
#endif
#if UNDERLAY_INNER
float d = tex2D(_MainTex, input.texcoord2.xy).a * input.texcoord2.z;
faceColor += input.underlayColor * (1 - saturate(d - input.texcoord2.w)) * saturate(1 - sd) * (1 - faceColor.a);
#endif
#if GLOW_ON
float4 glowColor = GetGlowColor(sd, scale);
faceColor.rgb += glowColor.rgb * glowColor.a;
#endif
// Alternative implementation to UnityGet2DClipping with support for softness.
#if UNITY_UI_CLIP_RECT
half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(input.mask.xy)) * input.mask.zw);
faceColor *= m.x * m.y;
#endif
//#if UNITY_UI_ALPHACLIP
// clip(faceColor.a - 0.001);
//#endif
return faceColor;
}
#endif
#if defined(UI_BLUR)
fixed4 Tex2DBlurring (pixel_t IN, half2 blur, half4 mask)
{
#if FASTBLUR && EX
const int KERNEL_SIZE = 5;
const float KERNEL_[5] = { 0.2486, 0.7046, 1.0, 0.7046, 0.2486};
#elif MEDIUMBLUR && EX
const int KERNEL_SIZE = 9;
const float KERNEL_[9] = { 0.0438, 0.1719, 0.4566, 0.8204, 1.0, 0.8204, 0.4566, 0.1719, 0.0438};
#elif DETAILBLUR && EX
const int KERNEL_SIZE = 13;
const float KERNEL_[13] = { 0.0438, 0.1138, 0.2486, 0.4566, 0.7046, 0.9141, 1.0, 0.9141, 0.7046, 0.4566, 0.2486, 0.1138, 0.0438};
#elif FASTBLUR
const int KERNEL_SIZE = 3;
const float KERNEL_[3] = { 0.4566, 1.0, 0.4566};
#elif MEDIUMBLUR
const int KERNEL_SIZE = 5;
const float KERNEL_[5] = { 0.2486, 0.7046, 1.0, 0.7046, 0.2486};
#elif DETAILBLUR
const int KERNEL_SIZE = 7;
const float KERNEL_[7] = { 0.1719, 0.4566, 0.8204, 1.0, 0.8204, 0.4566, 0.1719};
#else
const int KERNEL_SIZE = 1;
const float KERNEL_[1] = { 1.0 };
#endif
float4 o = 0;
float sum = 0;
float2 shift = 0;
half alpha = IN.color.a;
half2 texcood = UV(IN);
#if UNDERLAY_ON
half2 texcood2 = UV2(IN);
#endif
for(int x = 0; x < KERNEL_SIZE; x++)
{
shift.x = blur.x * (float(x) - KERNEL_SIZE/2);
for(int y = 0; y < KERNEL_SIZE; y++)
{
shift.y = blur.y * (float(y) - KERNEL_SIZE/2);
float2 uv = texcood + shift;
float weight = KERNEL_[x] * KERNEL_[y];
sum += weight;
UV(IN).xy = uv;
IN.color.a = weight;
#if UNDERLAY_ON
UV2(IN).xy = texcood2 + shift;
#endif
#if EX
fixed masked = min(mask.x <= uv.x, uv.x <= mask.z) * min(mask.y <= uv.y, uv.y <= mask.w);
o += lerp(fixed4(0, 0, 0, 0), PixShader(IN) * weight, masked);
#else
o += PixShader(IN) * weight;
#endif
}
}
IN.color.a = alpha;
return o / sum;// * alpha;
}
fixed4 Tex2DBlurring (pixel_t IN, half2 blur)
{
return Tex2DBlurring(IN, blur, half4(0,0,1,1));
}
#endif
#endif // UI_EFFECT_TMPRO_INCLUDED
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: c6f704fc82d194f60ac2b8884db48ffe
timeCreated: 1487915863
licenseType: Pro
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -115,6 +115,12 @@ Material:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _NoiseTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _ParamTex
second:
@@ -268,6 +274,12 @@ Material:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _NoiseTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _ParamTex
second:
@@ -421,6 +433,12 @@ Material:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _NoiseTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _ParamTex
second:
@@ -897,6 +897,12 @@ Material:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _ParamTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _ColorMask
@@ -80,6 +80,28 @@ AnimationClip is supported as a matter of course!
7. Enjoy!
#### Usage with TextMeshPro
1. Add a symbol `TMP_PRESENT` to scripting define symbols.
![](https://user-images.githubusercontent.com/12690315/54080742-14583500-433a-11e9-815b-8ed600697569.png)
2. If the material does not support the effect component, the following warning will be displayed.
When you press the Fix button, new material is automatically generated and set.
![](https://user-images.githubusercontent.com/12690315/49728471-377d3500-fcb6-11e8-849b-d664aeb9da75.png)
3. If you want to use material variants, select `Create Material Preset` from the context menu to duplicate the material.
![](https://user-images.githubusercontent.com/12690315/53881014-dfa45f00-4055-11e9-833f-7409adebc542.png)
4. Effect mode, color mode, blur mode and etc. can not be changed from the component editor.
Change them from the material editor.
![](https://user-images.githubusercontent.com/12690315/53782892-bea71580-3f52-11e9-9d43-e7cb6761f52c.png)
5. If you want to enable "Advanced Blur", enable `TexCoord2` channel of canvas.
![](https://user-images.githubusercontent.com/12690315/46567584-3525f400-c970-11e8-9839-5c9e810b0b80.png)
#### Usage without TextMeshPro
1. When you uninstalled TextMeshPro from the project, remove a symbol `TMP_PRESENT` to scripting define symbols.
![](https://user-images.githubusercontent.com/12690315/54080761-cabc1a00-433a-11e9-97ab-431cf1cfe602.png)
##### Requirement
* Unity 5.5+ *(included Unity 2018.x)*
@@ -0,0 +1,565 @@
using UnityEngine;
using UnityEngine.EventSystems;
using UnityEngine.UI;
#if TMP_PRESENT
using System.Collections.Generic;
using TMPro;
#if UNITY_EDITOR
using UnityEditor;
using System.IO;
using System.Linq;
#endif
#endif
namespace Coffee.UIExtensions
{
/// <summary>
/// Base class for effects that modify the generated Mesh.
/// It works well not only for standard Graphic components (Image, RawImage, Text, etc.) but also for TextMeshPro and TextMeshProUGUI.
/// </summary>
[ExecuteInEditMode]
public abstract class BaseMeshEffect : UIBehaviour, IMeshModifier
{
//################################
// Constant or Static Members.
//################################
#if TMP_PRESENT
static readonly List<Vector2> s_Uv0 = new List<Vector2> (4096);
static readonly List<Vector2> s_Uv1 = new List<Vector2> (4096);
#if UNITY_2017_1_OR_NEWER
static readonly List<Vector2> s_Uv2 = new List<Vector2> (4096);
static readonly List<Vector2> s_Uv3 = new List<Vector2> (4096);
#endif
static readonly List<Vector3> s_Vertices = new List<Vector3> (4096);
static readonly List<int> s_Indices = new List<int> (4096);
static readonly List<Vector3> s_Normals = new List<Vector3> (4096);
static readonly List<Vector4> s_Tangents = new List<Vector4> (4096);
static readonly List<Color32> s_Colors = new List<Color32> (4096);
static readonly VertexHelper s_VertexHelper = new VertexHelper ();
static readonly List<TMP_SubMeshUI> s_SubMeshUIs = new List<TMP_SubMeshUI> (4096);
static readonly List<Mesh> s_Meshes = new List<Mesh> (4096);
static readonly List<UIVertex> s_UIVertices = new List<UIVertex> (4096);
static readonly List<BaseMeshEffect> s_TmpEffects = new List<BaseMeshEffect>(4);
#endif
static readonly Material [] s_EmptyMaterials = new Material [0];
//################################
// Public Members.
//################################
/// <summary>
/// The Graphic attached to this GameObject.
/// </summary>
public Graphic graphic { get { Initialize (); return _graphic; } }
/// <summary>
/// The CanvasRenderer attached to this GameObject.
/// </summary>
public CanvasRenderer canvasRenderer { get { Initialize (); return _canvasRenderer; } }
#if TMP_PRESENT
/// <summary>
/// The TMP_Text attached to this GameObject.
/// </summary>
public TMP_Text textMeshPro { get { Initialize (); return _textMeshPro; } }
#endif
/// <summary>
/// The RectTransform attached to this GameObject.
/// </summary>
public RectTransform rectTransform { get { Initialize (); return _rectTransform; } }
#if UNITY_5_6_OR_NEWER
/// <summary>
/// Additional canvas shader channels to use this component.
/// </summary>
public virtual AdditionalCanvasShaderChannels requiredChannels { get { return AdditionalCanvasShaderChannels.None; } }
#endif
/// <summary>
/// Is TextMeshPro or TextMeshProUGUI attached to this GameObject?
/// </summary>
public bool isTMPro
{
get
{
#if TMP_PRESENT
return textMeshPro != null;
#else
return false;
#endif
}
}
/// <summary>
/// The material for rendering.
/// </summary>
public virtual Material material
{
get
{
#if TMP_PRESENT
if (textMeshPro)
{
return textMeshPro.fontSharedMaterial;
}
else
#endif
if (graphic)
{
return graphic.material;
}
else
{
return null;
}
}
set
{
#if TMP_PRESENT
if (textMeshPro)
{
textMeshPro.fontSharedMaterial = value;
}
else
#endif
if (graphic)
{
graphic.material = value;
}
}
}
public virtual Material[] materials
{
get
{
#if TMP_PRESENT
if (textMeshPro)
{
return textMeshPro.fontSharedMaterials ?? s_EmptyMaterials;
}
else
#endif
if (graphic)
{
_materials [0] = graphic.material;
return _materials;
}
else
{
return s_EmptyMaterials;
}
}
}
/// <summary>
/// Call used to modify mesh. (legacy)
/// </summary>
/// <param name="mesh">Mesh.</param>
public virtual void ModifyMesh (Mesh mesh)
{
}
/// <summary>
/// Call used to modify mesh.
/// </summary>
/// <param name="vh">VertexHelper.</param>
public virtual void ModifyMesh (VertexHelper vh)
{
}
/// <summary>
/// Mark the vertices as dirty.
/// </summary>
public virtual void SetVerticesDirty ()
{
#if TMP_PRESENT
if (textMeshPro)
{
foreach (var info in textMeshPro.textInfo.meshInfo)
{
var mesh = info.mesh;
if (mesh)
{
mesh.Clear ();
mesh.vertices = info.vertices;
mesh.uv = info.uvs0;
mesh.uv2 = info.uvs2;
mesh.colors32 = info.colors32;
mesh.normals = info.normals;
mesh.tangents = info.tangents;
mesh.triangles = info.triangles;
}
}
if (canvasRenderer)
{
canvasRenderer.SetMesh (textMeshPro.mesh);
GetComponentsInChildren (false, s_SubMeshUIs);
foreach (var sm in s_SubMeshUIs)
{
sm.canvasRenderer.SetMesh (sm.mesh);
}
s_SubMeshUIs.Clear ();
}
textMeshPro.havePropertiesChanged = true;
}
else
#endif
if (graphic)
{
graphic.SetVerticesDirty ();
}
}
public void ShowTMProWarning (Shader shader, Shader mobileShader, Shader spriteShader, System.Action<Material> onCreatedMaterial)
{
#if UNITY_EDITOR && TMP_PRESENT
if(!textMeshPro || !textMeshPro.fontSharedMaterial)
{
return;
}
// Is the material preset for dissolve?
Material m = textMeshPro.fontSharedMaterial;
if (m.shader != shader && m.shader != mobileShader)
{
EditorGUILayout.BeginHorizontal ();
EditorGUILayout.HelpBox (string.Format("{0} requires '{1}' or '{2}' as a shader for material preset.", GetType().Name, shader.name, mobileShader.name), MessageType.Warning);
if(GUILayout.Button ("Fix"))
{
var correctShader = m.shader.name.Contains ("Mobile") ? mobileShader : shader;
textMeshPro.fontSharedMaterial = ModifyTMProMaterialPreset (m, correctShader, onCreatedMaterial);
}
EditorGUILayout.EndHorizontal ();
return;
}
// Is the sprite asset for dissolve?
TMP_SpriteAsset spriteAsset = textMeshPro.spriteAsset ?? TMP_Settings.GetSpriteAsset ();
// Sprite asset might not exist at all
if(spriteAsset == null) {
return;
}
m = spriteAsset.material;
if (m && m.shader != spriteShader && textMeshPro.richText && textMeshPro.text.Contains("<sprite="))
{
EditorGUILayout.BeginHorizontal ();
EditorGUILayout.HelpBox (string.Format ("{0} requires '{1}' as a shader for sprite asset.", GetType().Name,spriteShader.name), MessageType.Warning);
if (GUILayout.Button ("Fix"))
{
GetComponentsInChildren<TMP_SubMesh> ().Select (x => x.gameObject).ToList ().ForEach (DestroyImmediate);
GetComponentsInChildren<TMP_SubMeshUI> ().Select (x => x.gameObject).ToList ().ForEach (DestroyImmediate);
textMeshPro.spriteAsset = ModifyTMProSpriteAsset (m, spriteShader, onCreatedMaterial);
}
EditorGUILayout.EndHorizontal ();
return;
}
}
Material ModifyTMProMaterialPreset (Material baseMaterial, Shader shader, System.Action<Material> onCreatedMaterial)
{
string path = AssetDatabase.GetAssetPath (baseMaterial);
string filename = Path.GetFileNameWithoutExtension (path) + " (" + GetType ().Name + ")";
Material mat = Resources.Load<Material> (TMP_Settings.defaultFontAssetPath + filename);
if (!mat)
{
mat = new Material (baseMaterial)
{
shaderKeywords = baseMaterial.shaderKeywords,
shader = shader,
};
onCreatedMaterial (mat);
AssetDatabase.CreateAsset (mat, Path.GetDirectoryName (path) + "/" + filename + ".mat");
EditorUtility.FocusProjectWindow ();
EditorGUIUtility.PingObject (mat);
}
else
{
mat.shader = shader;
}
EditorUtility.SetDirty (mat);
return mat;
}
TMP_SpriteAsset ModifyTMProSpriteAsset (Material baseMaterial, Shader shader, System.Action<Material> onCreatedMaterial)
{
string path = AssetDatabase.GetAssetPath (baseMaterial);
string filename = Path.GetFileNameWithoutExtension (path) + " (" + this.GetType ().Name + ")";
TMP_SpriteAsset spriteAsset = Resources.Load<TMP_SpriteAsset> (TMP_Settings.defaultSpriteAssetPath + filename);
if (!spriteAsset)
{
AssetDatabase.CopyAsset (path, Path.GetDirectoryName (path) + "/" + filename + ".mat");
spriteAsset = Resources.Load<TMP_SpriteAsset> (TMP_Settings.defaultSpriteAssetPath + filename);
spriteAsset.material.shader = shader;
spriteAsset.material.name = shader.name;
onCreatedMaterial (spriteAsset.material);
EditorUtility.FocusProjectWindow ();
EditorGUIUtility.PingObject (spriteAsset);
}
else
{
spriteAsset.material.shader = shader;
}
EditorUtility.SetDirty (spriteAsset);
return spriteAsset;
#endif
}
//################################
// Protected Members.
//################################
/// <summary>
/// Should the effect modify the mesh directly for TMPro?
/// </summary>
protected virtual bool isLegacyMeshModifier { get { return false; } }
protected virtual void Initialize ()
{
if (!_initialized)
{
_initialized = true;
_graphic = _graphic ?? GetComponent<Graphic> ();
_canvasRenderer = _canvasRenderer ?? GetComponent<CanvasRenderer> ();
_rectTransform = _rectTransform ?? GetComponent<RectTransform> ();
#if TMP_PRESENT
_textMeshPro = _textMeshPro ?? GetComponent<TMP_Text> ();
#endif
}
}
/// <summary>
/// This function is called when the object becomes enabled and active.
/// </summary>
protected override void OnEnable ()
{
_initialized = false;
SetVerticesDirty ();
#if TMP_PRESENT
if (textMeshPro)
{
TMPro_EventManager.TEXT_CHANGED_EVENT.Add (OnTextChanged);
}
#endif
#if UNITY_EDITOR && TMP_PRESENT
if (graphic && textMeshPro)
{
GraphicRebuildTracker.TrackGraphic (graphic);
}
#endif
#if UNITY_5_6_OR_NEWER
if (graphic)
{
AdditionalCanvasShaderChannels channels = requiredChannels;
var canvas = graphic.canvas;
if (canvas && (canvas.additionalShaderChannels & channels) != channels)
{
Debug.LogWarningFormat (this, "Enable {1} of Canvas.additionalShaderChannels to use {0}.", GetType ().Name, channels);
}
}
#endif
}
/// <summary>
/// This function is called when the behaviour becomes disabled () or inactive.
/// </summary>
protected override void OnDisable ()
{
#if TMP_PRESENT
TMPro_EventManager.TEXT_CHANGED_EVENT.Remove (OnTextChanged);
#endif
SetVerticesDirty ();
#if UNITY_EDITOR && TMP_PRESENT
if (graphic && textMeshPro)
{
GraphicRebuildTracker.UnTrackGraphic (graphic);
}
#endif
}
/// <summary>
/// LateUpdate is called every frame, if the Behaviour is enabled.
/// </summary>
protected virtual void LateUpdate ()
{
#if TMP_PRESENT
if (textMeshPro)
{
if (textMeshPro.havePropertiesChanged || _isTextMeshProActive != textMeshPro.isActiveAndEnabled)
{
SetVerticesDirty ();
}
_isTextMeshProActive = textMeshPro.isActiveAndEnabled;
}
#endif
}
/// <summary>
/// Callback for when properties have been changed by animation.
/// </summary>
protected override void OnDidApplyAnimationProperties ()
{
SetVerticesDirty ();
}
#if UNITY_EDITOR
/// <summary>
/// This function is called when the script is loaded or a value is changed in the inspector (Called in the editor only).
/// </summary>
protected override void OnValidate ()
{
SetVerticesDirty ();
}
#endif
//################################
// Private Members.
//################################
bool _initialized;
CanvasRenderer _canvasRenderer;
RectTransform _rectTransform;
Graphic _graphic;
Material [] _materials = new Material [1];
#if TMP_PRESENT
bool _isTextMeshProActive;
TMP_Text _textMeshPro;
/// <summary>
/// Called when any TextMeshPro generated the mesh.
/// </summary>
/// <param name="obj">TextMeshPro object.</param>
void OnTextChanged (Object obj)
{
// Skip if the object is different from the current object or the text is empty.
var textInfo = textMeshPro.textInfo;
if (textMeshPro != obj || textInfo.characterCount - textInfo.spaceCount <= 0)
{
return;
}
GetComponents<BaseMeshEffect>(s_TmpEffects);
for (int i = 0; i < s_TmpEffects.Count; i++)
{
if (s_TmpEffects[i].enabled)
{
if (s_TmpEffects[i] == this)
break;
else
return;
}
}
// Collect the meshes.
s_Meshes.Clear ();
foreach (var info in textInfo.meshInfo)
{
s_Meshes.Add (info.mesh);
}
// Modify the meshes.
foreach (var e in s_TmpEffects)
{
if (!e.enabled)
continue;
if (e.isLegacyMeshModifier)
{
// Legacy mode: Modify the meshes directly.
foreach (var m in s_Meshes)
{
if (m)
{
e.ModifyMesh(m);
}
}
}
else
{
// Convert meshes to VertexHelpers and modify them.
foreach (var m in s_Meshes)
{
if (m)
{
FillVertexHelper(s_VertexHelper, m);
e.ModifyMesh(s_VertexHelper);
s_VertexHelper.FillMesh(m);
}
}
}
}
// Set the modified meshes to the CanvasRenderers (for UI only).
if (canvasRenderer)
{
canvasRenderer.SetMesh (textMeshPro.mesh);
GetComponentsInChildren (false, s_SubMeshUIs);
foreach (var sm in s_SubMeshUIs)
{
sm.canvasRenderer.SetMesh (sm.mesh);
}
s_SubMeshUIs.Clear ();
}
// Clear.
s_Meshes.Clear ();
}
void FillVertexHelper (VertexHelper vh, Mesh mesh)
{
vh.Clear ();
mesh.GetVertices (s_Vertices);
mesh.GetColors (s_Colors);
mesh.GetUVs (0, s_Uv0);
mesh.GetUVs (1, s_Uv1);
mesh.GetNormals (s_Normals);
mesh.GetTangents (s_Tangents);
mesh.GetIndices (s_Indices, 0);
#if UNITY_2017_1_OR_NEWER
mesh.GetUVs (2, s_Uv2);
mesh.GetUVs (3, s_Uv3);
bool useUv2 = 0 < s_Uv2.Count;
bool useUv3 = 0 < s_Uv3.Count;
#endif
s_UIVertices.Clear();
UIVertex v = default(UIVertex);
for (int i = 0; i < s_Vertices.Count; i++)
{
v.position = s_Vertices[i];
v.color = s_Colors[i];
v.uv0 = s_Uv0[i];
v.uv1 = s_Uv1[i];
#if UNITY_2017_1_OR_NEWER
if (useUv2 && i < s_Uv2.Count)
v.uv2 = s_Uv2[i];
if (useUv3 && i < s_Uv3.Count)
v.uv3 = s_Uv3[i];
#endif
v.normal = s_Normals[i];
v.tangent = s_Tangents[i];
s_UIVertices.Add(v);
}
s_VertexHelper.AddUIVertexStream(s_UIVertices, s_Indices);
}
#endif
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 229ee7044e2514b0e9bd9fd40a2baa3a
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -16,37 +16,43 @@ namespace Coffee.UIExtensions
public static class EffectAreaExtensions
{
static readonly Rect rectForCharacter = new Rect(0, 0, 1, 1);
static readonly Vector2 [] splitedCharacterPosition = { Vector2.up, Vector2.one, Vector2.right, Vector2.zero };
/// <summary>
/// Gets effect for area.
/// </summary>
public static Rect GetEffectArea(this EffectArea area, VertexHelper vh, Graphic graphic, float aspectRatio = -1)
public static Rect GetEffectArea (this EffectArea area, VertexHelper vh, Rect rectangle, float aspectRatio = -1)
{
Rect rect = default(Rect);
switch (area)
{
case EffectArea.RectTransform:
rect = graphic.rectTransform.rect;
rect = rectangle;
break;
case EffectArea.Character:
rect = rectForCharacter;
break;
case EffectArea.Fit:
// Fit to contents.
UIVertex vertex = default(UIVertex);
rect.xMin = rect.yMin = float.MaxValue;
rect.xMax = rect.yMax = float.MinValue;
UIVertex vertex = default (UIVertex);
float xMin = float.MaxValue;
float yMin = float.MaxValue;
float xMax = float.MinValue;
float yMax = float.MinValue;
for (int i = 0; i < vh.currentVertCount; i++)
{
vh.PopulateUIVertex(ref vertex, i);
rect.xMin = Mathf.Min(rect.xMin, vertex.position.x);
rect.yMin = Mathf.Min(rect.yMin, vertex.position.y);
rect.xMax = Mathf.Max(rect.xMax, vertex.position.x);
rect.yMax = Mathf.Max(rect.yMax, vertex.position.y);
float x = vertex.position.x;
float y = vertex.position.y;
xMin = Mathf.Min(xMin, x);
yMin = Mathf.Min(yMin, y);
xMax = Mathf.Max(xMax, x);
yMax = Mathf.Max(yMax, y);
}
rect.Set (xMin, yMin, xMax - xMin, yMax - yMin);
break;
default:
rect = graphic.rectTransform.rect;
rect = rectangle;
break;
}
@@ -64,5 +70,43 @@ namespace Coffee.UIExtensions
}
return rect;
}
/// <summary>
/// Gets position factor for area.
/// </summary>
public static void GetPositionFactor (this EffectArea area, int index, Rect rect, Vector2 position, bool isText, bool isTMPro, out float x, out float y)
{
if (isText && area == EffectArea.Character)
{
index = isTMPro ? (index + 3) % 4 : index % 4;
x = splitedCharacterPosition [index].x;
y = splitedCharacterPosition [index].y;
}
else if (area == EffectArea.Fit)
{
x = Mathf.Clamp01 ((position.x - rect.xMin) / rect.width);
y = Mathf.Clamp01 ((position.y - rect.yMin) / rect.height);
}
else
{
x = Mathf.Clamp01 (position.x / rect.width + 0.5f);
y = Mathf.Clamp01 (position.y / rect.height + 0.5f);
}
}
/// <summary>
/// Normalize vertex position by local matrix.
/// </summary>
public static void GetNormalizedFactor (this EffectArea area, int index, Matrix2x3 matrix, Vector2 position, bool isText, out Vector2 nomalizedPos)
{
if (isText && area == EffectArea.Character)
{
nomalizedPos = matrix * splitedCharacterPosition [(index + 3) % 4];
}
else
{
nomalizedPos = matrix * position;
}
}
}
}
@@ -16,6 +16,7 @@ namespace Coffee.UIExtensions
/// <summary>
/// Gets or sets a value indicating whether is playing.
/// </summary>
[Header("Effect Player")]
[Tooltip("Playing.")]
public bool play = false;
@@ -26,12 +27,6 @@ namespace Coffee.UIExtensions
[Range(0f, 10f)]
public float initialPlayDelay = 0;
/// <summary>
/// Gets or sets a value indicating whether can loop.
/// </summary>
[Tooltip("Loop.")]
public bool loop = false;
/// <summary>
/// Gets or sets the duration.
/// </summary>
@@ -39,6 +34,12 @@ namespace Coffee.UIExtensions
[Range(0.01f,10f)]
public float duration = 1;
/// <summary>
/// Gets or sets a value indicating whether can loop.
/// </summary>
[Tooltip("Loop.")]
public bool loop = false;
/// <summary>
/// Gets or sets the delay before looping.
/// </summary>
@@ -97,9 +98,12 @@ namespace Coffee.UIExtensions
/// <summary>
/// Start playing.
/// </summary>
public void Play(Action<float> callback = null)
public void Play(bool reset, Action<float> callback = null)
{
_time = 0;
if (reset)
{
_time = 0;
}
play = true;
if (callback != null)
{
@@ -110,8 +114,16 @@ namespace Coffee.UIExtensions
/// <summary>
/// Stop playing.
/// </summary>
public void Stop()
public void Stop(bool reset)
{
if (reset)
{
_time = 0;
if (_callback != null)
{
_callback(_time);
}
}
play = false;
}
@@ -21,10 +21,17 @@ namespace Coffee.UIExtensions
return null;
}
Material mat = null;
string variantName = GetVariantName(shader, append);
if (s_MaterialMap.TryGetValue(variantName, out mat) && mat)
{
return mat;
}
string[] keywords = append.Where(x => 0 < (int)x)
.Select(x => x.ToString().ToUpper())
.ToArray();
Material mat = GetMaterial(shader, append);
mat = GetMaterial(shader, append);
if (mat)
{
if (!mat.shaderKeywords.OrderBy(x => x).SequenceEqual(keywords.OrderBy(x => x)))
@@ -39,7 +46,6 @@ namespace Coffee.UIExtensions
return mat;
}
string variantName = GetVariantName(shader, append);
if (s_MaterialMap.TryGetValue(variantName, out mat) && mat)
{
return mat;
@@ -5,7 +5,7 @@ namespace Coffee.UIExtensions
/// <summary>
/// Matrix2x3.
/// </summary>
struct Matrix2x3
public struct Matrix2x3
{
public float m00, m01, m02, m10, m11, m12;
@@ -1,15 +1,12 @@
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;
using System.Linq;
using System.IO;
namespace Coffee.UIExtensions
{
/// <summary>
/// Abstract effect base for UI.
/// </summary>
[RequireComponent(typeof(Graphic))]
[DisallowMultipleComponent]
public abstract class UIEffectBase : BaseMeshEffect, IParameterTexture
#if UNITY_EDITOR
@@ -55,6 +52,8 @@ namespace Coffee.UIExtensions
/// </summary>
protected override void OnValidate()
{
base.OnValidate ();
var mat = GetMaterial();
if (m_EffectMaterial != mat)
{
@@ -63,8 +62,8 @@ namespace Coffee.UIExtensions
}
ModifyMaterial();
targetGraphic.SetVerticesDirty();
SetDirty();
SetVerticesDirty ();
SetDirty ();
}
public void OnBeforeSerialize()
@@ -124,12 +123,14 @@ namespace Coffee.UIExtensions
/// </summary>
protected override void OnEnable()
{
base.OnEnable ();
if (ptex != null)
{
ptex.Register(this);
}
ModifyMaterial();
targetGraphic.SetVerticesDirty();
SetVerticesDirty();
SetDirty();
}
@@ -138,8 +139,10 @@ namespace Coffee.UIExtensions
/// </summary>
protected override void OnDisable()
{
ModifyMaterial();
targetGraphic.SetVerticesDirty();
base.OnDisable ();
ModifyMaterial ();
SetVerticesDirty();
if (ptex != null)
{
ptex.Unregister(this);
@@ -151,7 +154,7 @@ namespace Coffee.UIExtensions
/// </summary>
protected virtual void SetDirty()
{
targetGraphic.SetVerticesDirty();
SetVerticesDirty();
}
protected override void OnDidApplyAnimationProperties()
@@ -0,0 +1,86 @@
using System.Collections;
using System.Collections.Generic;
using UnityEditor;
using UnityEngine;
namespace Coffee.UIExtensions.Editors
{
public class BaseMeshEffectEditor : Editor
{
List<MaterialEditor> _materialEditors = new List<MaterialEditor> ();
protected virtual void OnEnable ()
{
ClearMaterialEditors ();
}
protected virtual void OnDisable ()
{
ClearMaterialEditors ();
}
void ClearMaterialEditors ()
{
foreach (var e in _materialEditors)
{
if (e)
{
DestroyImmediate (e);
}
}
_materialEditors.Clear ();
}
protected void ShowMaterialEditors (Material [] materials, int startIndex, int count)
{
for (int i = 0; i < count; i++)
{
if (_materialEditors.Count == i)
{
_materialEditors.Add (null);
}
var mat = materials [startIndex + i];
var editor = _materialEditors [i];
if (editor && editor.target != mat)
{
DestroyImmediate (editor);
editor = null;
}
if (!editor)
{
editor = _materialEditors [i] = Editor.CreateEditor (mat) as MaterialEditor;
}
editor.DrawHeader ();
editor.OnInspectorGUI ();
}
}
protected void ShowCanvasChannelsWarning ()
{
BaseMeshEffect effect = target as BaseMeshEffect;
if (!effect || !effect.graphic)
{
return;
}
#if UNITY_5_6_OR_NEWER
AdditionalCanvasShaderChannels channels = effect.requiredChannels;
var canvas = effect.graphic.canvas;
if (canvas && (canvas.additionalShaderChannels & channels) != channels)
{
EditorGUILayout.BeginHorizontal ();
EditorGUILayout.HelpBox (string.Format ("Enable {1} of Canvas.additionalShaderChannels to use {0}.", effect.GetType ().Name, channels), MessageType.Warning);
if (GUILayout.Button ("Fix"))
{
canvas.additionalShaderChannels |= channels;
}
EditorGUILayout.EndHorizontal ();
}
#endif
}
}
}
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 7ddf2f64ff7af4a9f9b5ba45f40302bf
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -2,6 +2,8 @@
using UnityEditorInternal;
using UnityEngine;
using System.Linq;
using System.Collections.Generic;
using UnityEngine.UI;
namespace Coffee.UIExtensions.Editors
{
@@ -10,16 +12,20 @@ namespace Coffee.UIExtensions.Editors
/// </summary>
[CustomEditor(typeof(UIDissolve))]
[CanEditMultipleObjects]
public class UIDissolveEditor : Editor
public class UIDissolveEditor : BaseMeshEffectEditor
{
static int s_NoiseTexId;
//################################
// Public/Protected Members.
//################################
/// <summary>
/// This function is called when the object becomes enabled and active.
/// </summary>
protected void OnEnable()
protected override void OnEnable()
{
base.OnEnable ();
_spMaterial = serializedObject.FindProperty("m_EffectMaterial");
_spEffectFactor = serializedObject.FindProperty("m_EffectFactor");
_spEffectArea = serializedObject.FindProperty("m_EffectArea");
@@ -30,17 +36,50 @@ namespace Coffee.UIExtensions.Editors
_spColorMode = serializedObject.FindProperty("m_ColorMode");
_spNoiseTexture = serializedObject.FindProperty("m_NoiseTexture");
_spKeepAspectRatio = serializedObject.FindProperty("m_KeepAspectRatio");
_spReverse = serializedObject.FindProperty("m_Reverse");
var player = serializedObject.FindProperty("m_Player");
_spPlay = player.FindPropertyRelative("play");
_spDuration = player.FindPropertyRelative("duration");
_spInitialPlayDelay = player.FindPropertyRelative("initialPlayDelay");
_spLoop = player.FindPropertyRelative("loop");
_spLoopDelay = player.FindPropertyRelative("loopDelay");
_spUpdateMode = player.FindPropertyRelative("updateMode");
}
s_NoiseTexId = Shader.PropertyToID ("_NoiseTex");
_shader = Shader.Find ("TextMeshPro/Distance Field (UIDissolve)");
_mobileShader = Shader.Find ("TextMeshPro/Mobile/Distance Field (UIDissolve)");
_spriteShader = Shader.Find ("TextMeshPro/Sprite (UIDissolve)");
}
/// <summary>
/// Implement this function to make a custom inspector.
/// </summary>
public override void OnInspectorGUI()
{
foreach (var d in targets.Cast<UIDissolve> ())
{
var mat = d.material;
if (d.isTMPro && mat && mat.HasProperty(s_NoiseTexId))
{
ColorMode colorMode =
mat.IsKeywordEnabled ("ADD") ? ColorMode.Add
: mat.IsKeywordEnabled ("SUBTRACT") ? ColorMode.Subtract
: mat.IsKeywordEnabled ("FILL") ? ColorMode.Fill
: ColorMode.Multiply;
Texture noiseTexture = mat.GetTexture(s_NoiseTexId);
if (d.colorMode != colorMode || d.noiseTexture != noiseTexture)
{
var so = new SerializedObject (d);
so.FindProperty ("m_ColorMode").intValue = (int)colorMode;
so.FindProperty ("m_NoiseTexture").objectReferenceValue = noiseTexture;
so.ApplyModifiedProperties ();
}
}
}
serializedObject.Update();
//================
@@ -57,25 +96,30 @@ namespace Coffee.UIExtensions.Editors
EditorGUILayout.PropertyField(_spWidth);
EditorGUILayout.PropertyField(_spSoftness);
EditorGUILayout.PropertyField(_spColor);
EditorGUILayout.PropertyField(_spColorMode);
EditorGUILayout.PropertyField(_spNoiseTexture);
bool isAnyTMPro = targets.Cast<UIDissolve>().Any(x => x.isTMPro);
using (new EditorGUI.DisabledGroupScope (isAnyTMPro))
{
EditorGUILayout.PropertyField (_spColorMode);
EditorGUILayout.PropertyField (_spNoiseTexture);
}
//================
// Advanced option.
//================
GUILayout.Space(10);
EditorGUILayout.LabelField("Advanced Option", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(_spEffectArea);
EditorGUILayout.PropertyField(_spKeepAspectRatio);
//================
// Effect runner.
// Effect player.
//================
GUILayout.Space(10);
EditorGUILayout.LabelField("Effect Player", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(_spPlay);
EditorGUILayout.PropertyField(_spDuration);
EditorGUILayout.PropertyField(_spInitialPlayDelay);
EditorGUILayout.PropertyField(_spLoop);
EditorGUILayout.PropertyField(_spLoopDelay);
EditorGUILayout.PropertyField(_spUpdateMode);
EditorGUILayout.PropertyField(_spReverse);
// Debug.
using (new EditorGUI.DisabledGroupScope(!Application.isPlaying))
@@ -94,7 +138,20 @@ namespace Coffee.UIExtensions.Editors
}
}
var c = target as UIDissolve;
c.ShowTMProWarning (_shader, _mobileShader, _spriteShader, mat => {
if(mat.shader == _spriteShader)
{
mat.shaderKeywords = c.material.shaderKeywords;
mat.SetTexture ("_NoiseTex", c.material.GetTexture ("_NoiseTex"));
}
});
ShowCanvasChannelsWarning ();
ShowMaterialEditors (c.materials, 1, c.materials.Length - 1);
serializedObject.ApplyModifiedProperties();
}
//################################
@@ -109,7 +166,16 @@ namespace Coffee.UIExtensions.Editors
SerializedProperty _spNoiseTexture;
SerializedProperty _spEffectArea;
SerializedProperty _spKeepAspectRatio;
SerializedProperty _spReverse;
SerializedProperty _spPlay;
SerializedProperty _spLoop;
SerializedProperty _spLoopDelay;
SerializedProperty _spDuration;
SerializedProperty _spInitialPlayDelay;
SerializedProperty _spUpdateMode;
Shader _shader;
Shader _mobileShader;
Shader _spriteShader;
}
}
@@ -44,7 +44,6 @@ namespace Coffee.UIExtensions.Editors
_spKeepSizeToRootCanvas = serializedObject.FindProperty("m_FitToScreen");
_spBlurMode = serializedObject.FindProperty("m_BlurMode");
_spCaptureOnEnable = serializedObject.FindProperty("m_CaptureOnEnable");
_spImmediateCapturing = serializedObject.FindProperty("m_ImmediateCapturing");
_customAdvancedOption = (qualityMode == QualityMode.Custom);
@@ -80,7 +79,6 @@ namespace Coffee.UIExtensions.Editors
EditorGUILayout.PropertyField(_spCaptureOnEnable);// CaptureOnEnable.
EditorGUILayout.PropertyField(_spKeepSizeToRootCanvas);// Keep Graphic Size To RootCanvas.
EditorGUILayout.PropertyField(_spImmediateCapturing);// Capture immediately.
EditorGUI.BeginChangeCheck();
QualityMode quality = qualityMode;
@@ -145,7 +143,6 @@ namespace Coffee.UIExtensions.Editors
SerializedProperty _spIterations;
SerializedProperty _spKeepSizeToRootCanvas;
SerializedProperty _spCaptureOnEnable;
SerializedProperty _spImmediateCapturing;
QualityMode qualityMode
{
@@ -2,6 +2,7 @@
using UnityEditorInternal;
using UnityEngine;
using System.Linq;
using System;
namespace Coffee.UIExtensions.Editors
{
@@ -10,13 +11,15 @@ namespace Coffee.UIExtensions.Editors
/// </summary>
[CustomEditor(typeof(UIEffect))]
[CanEditMultipleObjects]
public class UIEffectEditor : Editor
public class UIEffectEditor : BaseMeshEffectEditor
{
static readonly GUIContent contentEffectColor = new GUIContent ("Effect Color");
//################################
// Constant or Static Members.
// Public/Protected Members.
//################################
/// <summary>
/// Draw effect properties.
/// </summary>
@@ -57,7 +60,7 @@ namespace Coffee.UIExtensions.Editors
SerializedProperty spColor = serializedObject.FindProperty(colorProperty);
if (spColor == null && serializedObject.targetObject is UIEffect) {
spColor = new SerializedObject (serializedObject.targetObjects.Select(x=>(x as UIEffect).targetGraphic).ToArray()).FindProperty("m_Color");
spColor = new SerializedObject (serializedObject.targetObjects.Select(x=>(x as UIEffect).targetGraphic).ToArray()).FindProperty(colorProperty);
}
EditorGUI.BeginChangeCheck ();
@@ -96,37 +99,155 @@ namespace Coffee.UIExtensions.Editors
}
}
//################################
// Private Members.
//################################
int GetEnum<T>(Material mat)
{
Type type = typeof(T);
string[] names = System.Enum.GetNames (type);
int[] values = System.Enum.GetValues (type) as int[];
int mode = 0;
for(int i=0;i<names.Length;i++)
{
if (mat.IsKeywordEnabled (names [i].ToUpper()))
mode = values [i];
}
return mode;
}
/// <summary>
/// Implement this function to make a custom inspector.
/// </summary>
public override void OnInspectorGUI()
{
serializedObject.Update();
DrawEffectProperties(serializedObject);
serializedObject.ApplyModifiedProperties();
#if UNITY_5_6_OR_NEWER
var graphic = (target as UIEffectBase).targetGraphic;
if(graphic)
foreach (var d in targets.Cast<UIEffect> ())
{
var canvas = graphic.canvas;
if( canvas && 0 == (canvas.additionalShaderChannels & AdditionalCanvasShaderChannels.TexCoord1))
var mat = d.material;
if (d.isTMPro && mat)
{
using (new GUILayout.HorizontalScope())
var so = new SerializedObject (d);
EffectMode eMode = (EffectMode)GetEnum<EffectMode> (mat);
ColorMode cMode = (ColorMode)GetEnum<ColorMode> (mat);
BlurMode bMode = (BlurMode)GetEnum<BlurMode> (mat);
bool aBlur = mat.IsKeywordEnabled("EX");
if (d.effectMode != eMode || d.colorMode != cMode || d.blurMode != bMode || so.FindProperty ("m_AdvancedBlur").boolValue != aBlur)
{
EditorGUILayout.HelpBox("[Unity5.6+] Enable TexCoord1 of Canvas.additionalShaderChannels to use UIEffect.", MessageType.Warning);
if (GUILayout.Button("Fix"))
canvas.additionalShaderChannels |= AdditionalCanvasShaderChannels.TexCoord1;
so.FindProperty ("m_EffectMode").intValue = (int)eMode;
so.FindProperty ("m_ColorMode").intValue = (int)cMode;
so.FindProperty ("m_BlurMode").intValue = (int)bMode;
so.FindProperty ("m_AdvancedBlur").boolValue = aBlur;
so.ApplyModifiedProperties ();
}
}
}
#endif
serializedObject.Update();
bool isAnyTMPro = targets.Cast<UIEffect>().Any(x => x.isTMPro);
var c = target as UIEffect;
//================
// Effect material.
//================
var spMaterial = serializedObject.FindProperty("m_EffectMaterial");
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.PropertyField(spMaterial);
EditorGUI.EndDisabledGroup();
//================
// Effect setting.
//================
var spToneMode = serializedObject.FindProperty("m_EffectMode");
using (new EditorGUI.DisabledGroupScope(isAnyTMPro))
EditorGUILayout.PropertyField(spToneMode);
// When tone is enable, show parameters.
if (spToneMode.intValue != (int)EffectMode.None)
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_EffectFactor"));
EditorGUI.indentLevel--;
}
//================
// Color setting.
//================
var spColorMode = serializedObject.FindProperty("m_ColorMode");
using (new EditorGUI.DisabledGroupScope(isAnyTMPro))
EditorGUILayout.PropertyField(spColorMode);
// When color is enable, show parameters.
//if (spColorMode.intValue != (int)ColorMode.Multiply)
{
EditorGUI.indentLevel++;
SerializedProperty spColor = serializedObject.FindProperty("m_Color");
if (spColor == null && serializedObject.targetObject is UIEffect) {
spColor = new SerializedObject (serializedObject.targetObjects.Select(x=>(x as UIEffect).targetGraphic).ToArray()).FindProperty(!isAnyTMPro ? "m_Color" : "m_fontColor");
}
EditorGUI.BeginChangeCheck ();
EditorGUI.showMixedValue = spColor.hasMultipleDifferentValues;
#if UNITY_2018_1_OR_NEWER
spColor.colorValue = EditorGUILayout.ColorField (contentEffectColor, spColor.colorValue, true, false, false);
#else
spColor.colorValue = EditorGUILayout.ColorField (contentEffectColor, spColor.colorValue, true, false, false, null);
#endif
if (EditorGUI.EndChangeCheck ()) {
spColor.serializedObject.ApplyModifiedProperties ();
}
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_ColorFactor"));
EditorGUI.indentLevel--;
}
//================
// Blur setting.
//================
var spBlurMode = serializedObject.FindProperty("m_BlurMode");
using (new EditorGUI.DisabledGroupScope(isAnyTMPro))
EditorGUILayout.PropertyField(spBlurMode);
// When blur is enable, show parameters.
if (spBlurMode.intValue != (int)BlurMode.None)
{
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_BlurFactor"));
var spAdvancedBlur = serializedObject.FindProperty("m_AdvancedBlur");
using (new EditorGUI.DisabledGroupScope(isAnyTMPro))
EditorGUILayout.PropertyField(spAdvancedBlur);
EditorGUI.indentLevel--;
}
serializedObject.ApplyModifiedProperties();
c.ShowTMProWarning (_shader, _mobileShader, _spriteShader, mat => {});
ShowCanvasChannelsWarning ();
ShowMaterialEditors (c.materials, 1, c.materials.Length - 1);
serializedObject.ApplyModifiedProperties();
}
/// <summary>
/// This function is called when the object becomes enabled and active.
/// </summary>
protected override void OnEnable()
{
base.OnEnable ();
_shader = Shader.Find ("TextMeshPro/Distance Field (UIEffect)");
_mobileShader = Shader.Find ("TextMeshPro/Mobile/Distance Field (UIEffect)");
_spriteShader = Shader.Find ("TextMeshPro/Sprite (UIEffect)");
}
//################################
// Private Members.
//################################
Shader _shader;
Shader _mobileShader;
Shader _spriteShader;
}
}
@@ -87,7 +87,7 @@ namespace Coffee.UIExtensions.Editors
EditorGUILayout.LabelField("Advanced Options", EditorStyles.boldLabel);
EditorGUI.indentLevel++;
{
if ((target as UIGradient).targetGraphic is Text)
//if ((target as UIGradient).targetGraphic is Text)
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_GradientStyle"));
EditorGUILayout.PropertyField(serializedObject.FindProperty("m_ColorSpace"));
@@ -0,0 +1,84 @@
using UnityEditor;
using UnityEditorInternal;
using UnityEngine;
using System.Linq;
namespace Coffee.UIExtensions.Editors
{
/// <summary>
/// UIEffect editor.
/// </summary>
[CustomEditor(typeof(UIHsvModifier))]
[CanEditMultipleObjects]
public class UIHsvModifierEditor : BaseMeshEffectEditor
{
//################################
// Public/Protected Members.
//################################
/// <summary>
/// This function is called when the object becomes enabled and active.
/// </summary>
protected override void OnEnable()
{
base.OnEnable ();
_spMaterial = serializedObject.FindProperty("m_EffectMaterial");
_spTargetColor = serializedObject.FindProperty("m_TargetColor");
_spRange = serializedObject.FindProperty("m_Range");
_spHue = serializedObject.FindProperty("m_Hue");
_spSaturation = serializedObject.FindProperty("m_Saturation");
_spValue = serializedObject.FindProperty("m_Value");
_shader = Shader.Find ("TextMeshPro/Distance Field (UIHsvModifier)");
_mobileShader = Shader.Find ("TextMeshPro/Mobile/Distance Field (UIHsvModifier)");
_spriteShader = Shader.Find ("TextMeshPro/Sprite (UIHsvModifier)");
}
/// <summary>
/// Implement this function to make a custom inspector.
/// </summary>
public override void OnInspectorGUI()
{
serializedObject.Update();
//================
// Effect material.
//================
EditorGUI.BeginDisabledGroup(true);
EditorGUILayout.PropertyField(_spMaterial);
EditorGUI.EndDisabledGroup();
//================
// Effect setting.
//================
EditorGUILayout.PropertyField(_spTargetColor);
EditorGUILayout.PropertyField(_spRange);
EditorGUILayout.PropertyField(_spHue);
EditorGUILayout.PropertyField(_spSaturation);
EditorGUILayout.PropertyField(_spValue);
var c = target as UIHsvModifier;
c.ShowTMProWarning (_shader, _mobileShader, _spriteShader, mat => {});
ShowCanvasChannelsWarning ();
ShowMaterialEditors (c.materials, 1, c.materials.Length - 1);
serializedObject.ApplyModifiedProperties();
}
//################################
// Private Members.
//################################
SerializedProperty _spMaterial;
SerializedProperty _spTargetColor;
SerializedProperty _spRange;
SerializedProperty _spHue;
SerializedProperty _spSaturation;
SerializedProperty _spValue;
Shader _shader;
Shader _mobileShader;
Shader _spriteShader;
}
}
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: f002ba0ac474d487b936bc046dda56b4
timeCreated: 1538806052
licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -10,7 +10,7 @@ namespace Coffee.UIExtensions.Editors
/// </summary>
[CustomEditor(typeof(UIShiny))]
[CanEditMultipleObjects]
public class UIShinyEditor : Editor
public class UIShinyEditor : BaseMeshEffectEditor
{
//################################
// Public/Protected Members.
@@ -18,8 +18,10 @@ namespace Coffee.UIExtensions.Editors
/// <summary>
/// This function is called when the object becomes enabled and active.
/// </summary>
protected void OnEnable()
protected override void OnEnable()
{
base.OnEnable ();
_spMaterial = serializedObject.FindProperty("m_EffectMaterial");
_spEffectFactor = serializedObject.FindProperty("m_EffectFactor");
_spEffectArea = serializedObject.FindProperty("m_EffectArea");
@@ -35,6 +37,11 @@ namespace Coffee.UIExtensions.Editors
_spLoop = player.FindPropertyRelative("loop");
_spLoopDelay = player.FindPropertyRelative("loopDelay");
_spUpdateMode = player.FindPropertyRelative("updateMode");
_shader = Shader.Find ("TextMeshPro/Distance Field (UIShiny)");
_mobileShader = Shader.Find ("TextMeshPro/Mobile/Distance Field (UIShiny)");
_spriteShader = Shader.Find ("TextMeshPro/Sprite (UIShiny)");
}
@@ -65,22 +72,14 @@ namespace Coffee.UIExtensions.Editors
//================
// Advanced option.
//================
GUILayout.Space(10);
EditorGUILayout.LabelField("Advanced Option", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(_spEffectArea);
//================
// Effect runner.
// Effect player.
//================
GUILayout.Space(10);
EditorGUILayout.LabelField("Effect Player", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(_spPlay);
if (_spPlay.boolValue)
{
EditorGUILayout.PropertyField(_spInitialPlayDelay);
}
EditorGUILayout.PropertyField(_spDuration);
EditorGUILayout.PropertyField(_spInitialPlayDelay);
EditorGUILayout.PropertyField(_spLoop);
EditorGUILayout.PropertyField(_spLoopDelay);
EditorGUILayout.PropertyField(_spUpdateMode);
@@ -102,6 +101,12 @@ namespace Coffee.UIExtensions.Editors
}
}
var c = target as UIShiny;
c.ShowTMProWarning (_shader, _mobileShader, _spriteShader, mat => {});
ShowCanvasChannelsWarning ();
ShowMaterialEditors (c.materials, 1, c.materials.Length - 1);
serializedObject.ApplyModifiedProperties();
}
@@ -122,5 +127,9 @@ namespace Coffee.UIExtensions.Editors
SerializedProperty _spDuration;
SerializedProperty _spInitialPlayDelay;
SerializedProperty _spUpdateMode;
Shader _shader;
Shader _mobileShader;
Shader _spriteShader;
}
}
@@ -10,30 +10,20 @@ namespace Coffee.UIExtensions.Editors
/// </summary>
[CustomEditor(typeof(UITransitionEffect))]
[CanEditMultipleObjects]
public class UITransitionEffectEditor : Editor
public class UITransitionEffectEditor : BaseMeshEffectEditor
{
SerializedProperty _spMaterial;
SerializedProperty _spEffectMode;
SerializedProperty _spEffectFactor;
SerializedProperty _spEffectArea;
SerializedProperty _spKeepAspectRatio;
SerializedProperty _spDissolveWidth;
SerializedProperty _spDissolveSoftness;
SerializedProperty _spDissolveColor;
SerializedProperty _spTransitionTexture;
SerializedProperty _spDuration;
SerializedProperty _spUpdateMode;
SerializedProperty _spPassRayOnHidden;
static int s_NoiseTexId;
//################################
// Public/Protected Members.
//################################
/// <summary>
/// This function is called when the object becomes enabled and active.
/// </summary>
protected void OnEnable()
protected override void OnEnable()
{
base.OnEnable();
_spMaterial = serializedObject.FindProperty("m_EffectMaterial");
_spEffectMode = serializedObject.FindProperty("m_EffectMode");
_spEffectFactor = serializedObject.FindProperty("m_EffectFactor");
@@ -44,9 +34,19 @@ namespace Coffee.UIExtensions.Editors
_spDissolveColor = serializedObject.FindProperty("m_DissolveColor");
_spTransitionTexture = serializedObject.FindProperty("m_TransitionTexture");
var player = serializedObject.FindProperty("m_Player");
_spPlay = player.FindPropertyRelative("play");
_spDuration = player.FindPropertyRelative("duration");
_spInitialPlayDelay = player.FindPropertyRelative("initialPlayDelay");
_spLoop = player.FindPropertyRelative("loop");
_spLoopDelay = player.FindPropertyRelative("loopDelay");
_spUpdateMode = player.FindPropertyRelative("updateMode");
_spPassRayOnHidden = serializedObject.FindProperty("m_PassRayOnHidden");
s_NoiseTexId = Shader.PropertyToID("_NoiseTex");
_shader = Shader.Find("TextMeshPro/Distance Field (UITransition)");
_mobileShader = Shader.Find("TextMeshPro/Mobile/Distance Field (UITransition)");
_spriteShader = Shader.Find("TextMeshPro/Sprite (UITransition)");
}
@@ -55,6 +55,36 @@ namespace Coffee.UIExtensions.Editors
/// </summary>
public override void OnInspectorGUI()
{
foreach (var d in targets.Cast<UITransitionEffect> ())
{
var mat = d.material;
if (d.isTMPro && mat && mat.HasProperty (s_NoiseTexId))
{
Texture noiseTexture = mat.GetTexture (s_NoiseTexId);
UITransitionEffect.EffectMode mode =
mat.IsKeywordEnabled ("CUTOFF") ? UITransitionEffect.EffectMode.Cutoff
: mat.IsKeywordEnabled ("FADE") ? UITransitionEffect.EffectMode.Fade
: mat.IsKeywordEnabled ("DISSOLVE") ? UITransitionEffect.EffectMode.Dissolve
: (UITransitionEffect.EffectMode)0;
if (mode == (UITransitionEffect.EffectMode)0)
{
mode = UITransitionEffect.EffectMode.Cutoff;
mat.EnableKeyword ("CUTOFF");
}
bool hasChanged = d.transitionTexture != noiseTexture || d.effectMode != mode;
if (hasChanged)
{
var so = new SerializedObject (d);
so.FindProperty ("m_TransitionTexture").objectReferenceValue = noiseTexture;
so.FindProperty ("m_EffectMode").intValue = (int)mode;
so.ApplyModifiedProperties ();
}
}
}
serializedObject.Update();
//================
@@ -67,7 +97,9 @@ namespace Coffee.UIExtensions.Editors
//================
// Effect setting.
//================
EditorGUILayout.PropertyField(_spEffectMode);
bool isAnyTMPro = targets.Cast<UITransitionEffect>().Any(x => x.isTMPro);
using (new EditorGUI.DisabledGroupScope(isAnyTMPro))
EditorGUILayout.PropertyField(_spEffectMode);
EditorGUI.indentLevel++;
EditorGUILayout.PropertyField(_spEffectFactor);
@@ -82,20 +114,20 @@ namespace Coffee.UIExtensions.Editors
//================
// Advanced option.
//================
GUILayout.Space(10);
EditorGUILayout.LabelField("Advanced Option", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(_spEffectArea);
EditorGUILayout.PropertyField(_spTransitionTexture);
using (new EditorGUI.DisabledGroupScope(isAnyTMPro))
EditorGUILayout.PropertyField(_spTransitionTexture);
EditorGUILayout.PropertyField(_spKeepAspectRatio);
EditorGUILayout.PropertyField(_spPassRayOnHidden);
//================
// Effect runner.
// Effect player.
//================
GUILayout.Space(10);
EditorGUILayout.LabelField("Effect Player", EditorStyles.boldLabel);
EditorGUILayout.PropertyField(_spPlay);
EditorGUILayout.PropertyField(_spDuration);
EditorGUILayout.PropertyField(_spInitialPlayDelay);
EditorGUILayout.PropertyField(_spLoop);
EditorGUILayout.PropertyField(_spLoopDelay);
EditorGUILayout.PropertyField(_spUpdateMode);
// Debug.
@@ -115,7 +147,44 @@ namespace Coffee.UIExtensions.Editors
}
}
var current = target as UITransitionEffect;
current.ShowTMProWarning(_shader, _mobileShader, _spriteShader, mat =>
{
if (mat.shader == _spriteShader)
{
mat.shaderKeywords = current.material.shaderKeywords;
mat.SetTexture(s_NoiseTexId, current.material.GetTexture(s_NoiseTexId));
}
});
ShowCanvasChannelsWarning();
ShowMaterialEditors(current.materials, 1, current.materials.Length - 1);
serializedObject.ApplyModifiedProperties();
}
//################################
// Private Members.
//################################
SerializedProperty _spMaterial;
SerializedProperty _spEffectMode;
SerializedProperty _spEffectFactor;
SerializedProperty _spEffectArea;
SerializedProperty _spKeepAspectRatio;
SerializedProperty _spDissolveWidth;
SerializedProperty _spDissolveSoftness;
SerializedProperty _spDissolveColor;
SerializedProperty _spTransitionTexture;
SerializedProperty _spPlay;
SerializedProperty _spLoop;
SerializedProperty _spLoopDelay;
SerializedProperty _spDuration;
SerializedProperty _spInitialPlayDelay;
SerializedProperty _spUpdateMode;
SerializedProperty _spPassRayOnHidden;
Shader _shader;
Shader _mobileShader;
Shader _spriteShader;
}
}
@@ -40,6 +40,7 @@ namespace Coffee.UIExtensions
[Tooltip("Noise texture for dissolving (single channel texture).")]
[SerializeField] Texture m_NoiseTexture;
[Header("Advanced Option")]
[Tooltip("The area for effect.")]
[SerializeField] protected EffectArea m_EffectArea;
@@ -49,6 +50,10 @@ namespace Coffee.UIExtensions
[Header("Effect Player")]
[SerializeField] EffectPlayer m_Player;
[Tooltip("Reverse the dissolve effect.")]
[FormerlySerializedAs("m_ReverseAnimation")]
[SerializeField] bool m_Reverse = false;
#pragma warning disable 0414
[Obsolete][HideInInspector]
[SerializeField][Range(0.1f, 10)] float m_Duration = 1;
@@ -151,7 +156,7 @@ namespace Coffee.UIExtensions
/// </summary>
public Texture noiseTexture
{
get { return m_NoiseTexture ?? graphic.material.GetTexture("_NoiseTex"); }
get { return m_NoiseTexture ?? material.GetTexture("_NoiseTex"); }
set
{
if (m_NoiseTexture != value)
@@ -176,7 +181,7 @@ namespace Coffee.UIExtensions
if (m_EffectArea != value)
{
m_EffectArea = value;
SetDirty();
SetVerticesDirty();
}
}
}
@@ -192,7 +197,7 @@ namespace Coffee.UIExtensions
if (m_KeepAspectRatio != value)
{
m_KeepAspectRatio = value;
SetDirty();
SetVerticesDirty ();
}
}
}
@@ -205,7 +210,7 @@ namespace Coffee.UIExtensions
/// <summary>
/// Play effect on enable.
/// </summary>
[System.Obsolete("Use Show/Hide method instead")]
[System.Obsolete("Use Play/Stop method instead")]
public bool play { get { return _player.play; } set { _player.play = value; } }
/// <summary>
@@ -230,6 +235,11 @@ namespace Coffee.UIExtensions
/// </summary>
public AnimatorUpdateMode updateMode { get { return _player.updateMode; } set { _player.updateMode = value; } }
/// <summary>
/// Reverse the dissolve effect.
/// </summary>
public bool reverse { get { return m_Reverse; } set { m_Reverse = value; } }
/// <summary>
/// Gets the parameter texture.
/// </summary>
@@ -240,6 +250,11 @@ namespace Coffee.UIExtensions
/// </summary>
public override void ModifyMaterial()
{
if (isTMPro)
{
return;
}
ulong hash = (m_NoiseTexture ? (uint)m_NoiseTexture.GetInstanceID() : 0) + ((ulong)1 << 32) + ((ulong)m_ColorMode << 36);
if (_materialCache != null && (_materialCache.hash != hash || !isActiveAndEnabled || !m_EffectMaterial))
{
@@ -249,15 +264,15 @@ namespace Coffee.UIExtensions
if (!isActiveAndEnabled || !m_EffectMaterial)
{
graphic.material = null;
material = null;
}
else if (!m_NoiseTexture)
{
graphic.material = m_EffectMaterial;
material = m_EffectMaterial;
}
else if (_materialCache != null && _materialCache.hash == hash)
{
graphic.material = _materialCache.material;
material = _materialCache.material;
}
else
{
@@ -268,7 +283,7 @@ namespace Coffee.UIExtensions
mat.SetTexture("_NoiseTex", m_NoiseTexture);
return mat;
});
graphic.material = _materialCache.material;
material = _materialCache.material;
}
}
@@ -280,37 +295,43 @@ namespace Coffee.UIExtensions
if (!isActiveAndEnabled)
return;
bool isText = isTMPro || graphic is Text;
float normalizedIndex = ptex.GetNormalizedIndex(this);
// rect.
var tex = noiseTexture;
var aspectRatio = m_KeepAspectRatio && tex ? ((float)tex.width) / tex.height : -1;
Rect rect = m_EffectArea.GetEffectArea(vh, graphic, aspectRatio);
Rect rect = m_EffectArea.GetEffectArea(vh, rectTransform.rect, aspectRatio);
// Calculate vertex position.
UIVertex vertex = default(UIVertex);
bool effectEachCharacter = graphic is Text && m_EffectArea == EffectArea.Character;
float x, y;
int count = vh.currentVertCount;
for (int i = 0; i < count; i++)
{
vh.PopulateUIVertex(ref vertex, i);
if (effectEachCharacter)
{
x = splitedCharacterPosition[i % 4].x;
y = splitedCharacterPosition[i % 4].y;
}
else
{
x = Mathf.Clamp01(vertex.position.x / rect.width + 0.5f);
y = Mathf.Clamp01(vertex.position.y / rect.height + 0.5f);
}
m_EffectArea.GetPositionFactor (i, rect, vertex.position, isText, isTMPro, out x, out y);
vertex.uv0 = new Vector2(
Packer.ToFloat(vertex.uv0.x, vertex.uv0.y),
Packer.ToFloat(x, y, normalizedIndex)
);
// if(!isTMPro)
// {
// vertex.uv0 = new Vector2(
// Packer.ToFloat(vertex.uv0.x, vertex.uv0.y),
// Packer.ToFloat(x, y, normalizedIndex)
// );
// }
// #if UNITY_5_6_OR_NEWER
// else
// {
// vertex.uv2 = new Vector2 (
// Packer.ToFloat (x, y, normalizedIndex),
// 0
// );
// }
// #endif
vh.SetUIVertex(vertex, i);
}
@@ -318,7 +339,10 @@ namespace Coffee.UIExtensions
protected override void SetDirty()
{
ptex.RegisterMaterial(targetGraphic.material);
foreach(var m in materials)
{
ptex.RegisterMaterial (m);
}
ptex.SetData(this, 0, m_EffectFactor); // param1.x : location
ptex.SetData(this, 1, m_Width); // param1.y : width
ptex.SetData(this, 2, m_Softness); // param1.z : softness
@@ -330,17 +354,17 @@ namespace Coffee.UIExtensions
/// <summary>
/// Play effect.
/// </summary>
public void Play()
public void Play(bool reset = true)
{
_player.Play();
_player.Play(reset);
}
/// <summary>
/// Stop effect.
/// </summary>
public void Stop()
public void Stop(bool reset = true)
{
_player.Stop();
_player.Stop(reset);
}
//################################
@@ -352,15 +376,19 @@ namespace Coffee.UIExtensions
protected override void OnEnable()
{
base.OnEnable();
_player.OnEnable(f => effectFactor = f);
_player.OnEnable((f) =>
{
effectFactor = m_Reverse ? 1f - f : f;
});
}
protected override void OnDisable()
{
base.OnDisable ();
MaterialCache.Unregister(_materialCache);
_materialCache = null;
_player.OnDisable();
base.OnDisable();
}
#if UNITY_EDITOR
@@ -370,6 +398,11 @@ namespace Coffee.UIExtensions
/// <returns>The material.</returns>
protected override Material GetMaterial()
{
if (isTMPro)
{
return null;
}
return MaterialResolver.GetOrGenerateMaterialVariant(Shader.Find(shaderName), m_ColorMode);
}
@@ -81,6 +81,21 @@ namespace Coffee.UIExtensions
//################################
// Public Members.
//################################
#if UNITY_2017_1_OR_NEWER
public override AdditionalCanvasShaderChannels requiredChannels
{
get
{
if (advancedBlur)
{
return isTMPro
? AdditionalCanvasShaderChannels.TexCoord1 | AdditionalCanvasShaderChannels.TexCoord2
: AdditionalCanvasShaderChannels.TexCoord1;
}
return AdditionalCanvasShaderChannels.None;
}
}
#endif
/// <summary>
/// Effect factor between 0(no effect) and 1(complete effect).
@@ -189,6 +204,11 @@ namespace Coffee.UIExtensions
/// </summary>
public override ParameterTexture ptex { get { return _ptex; } }
/// <summary>
/// Advanced blurring remove common artifacts in the blur effect for uGUI.
/// </summary>
public bool advancedBlur { get { return isTMPro ? (material && material.IsKeywordEnabled("EX")) : m_AdvancedBlur; } }
/// <summary>
/// Modifies the mesh.
/// </summary>
@@ -201,14 +221,14 @@ namespace Coffee.UIExtensions
float normalizedIndex = ptex.GetNormalizedIndex(this);
if (m_BlurMode != BlurMode.None && m_AdvancedBlur)
if (m_BlurMode != BlurMode.None && advancedBlur)
{
vh.GetUIVertexStream(tempVerts);
vh.Clear();
var count = tempVerts.Count;
// Bundle
int bundleSize = targetGraphic is Text ? 6 : count;
int bundleSize = (targetGraphic is Text || isTMPro) ? 6 : count;
Rect posBounds = default(Rect);
Rect uvBounds = default(Rect);
Vector3 size = default(Vector3);
@@ -272,7 +292,17 @@ namespace Coffee.UIExtensions
vt.uv0 = new Vector2(Packer.ToFloat((uv0.x + 0.5f) / 2f, (uv0.y + 0.5f) / 2f), normalizedIndex);
vt.position = pos;
vt.uv1 = uvMask;
if (isTMPro)
{
#if UNITY_2017_1_OR_NEWER
vt.uv2 = uvMask;
#endif
}
else
{
vt.uv1 = uvMask;
}
tempVerts[i + j + k] = vt;
}
@@ -301,7 +331,10 @@ namespace Coffee.UIExtensions
protected override void SetDirty()
{
ptex.RegisterMaterial(m_EffectMaterial);
foreach (var m in materials)
{
ptex.RegisterMaterial (m);
}
ptex.SetData(this, 0, m_EffectFactor); // param.x : effect factor
ptex.SetData(this, 1, m_ColorFactor); // param.y : color factor
ptex.SetData(this, 2, m_BlurFactor); // param.z : blur factor
@@ -314,6 +347,10 @@ namespace Coffee.UIExtensions
/// <returns>The material.</returns>
protected override Material GetMaterial()
{
if (isTMPro)
{
return null;
}
return MaterialResolver.GetOrGenerateMaterialVariant(Shader.Find(shaderName), m_EffectMode, m_ColorMode, m_BlurMode, m_AdvancedBlur ? BlurEx.Ex : BlurEx.None);
}
@@ -85,9 +85,6 @@ namespace Coffee.UIExtensions
[Tooltip("Capture automatically on enable.")]
[SerializeField] bool m_CaptureOnEnable = false;
[Tooltip("Capture immediately.")]
[SerializeField] bool m_ImmediateCapturing = true;
//################################
// Public Members.
@@ -203,11 +200,6 @@ namespace Coffee.UIExtensions
/// </summary>
public bool captureOnEnable { get { return m_CaptureOnEnable; } set { m_CaptureOnEnable = value; } }
/// <summary>
/// Capture immediately.
/// </summary>
public bool immediateCapturing { get { return m_ImmediateCapturing; } set { m_ImmediateCapturing = value; } }
/// <summary>
/// This function is called when the object becomes enabled and active.
/// </summary>
@@ -405,20 +397,9 @@ namespace Coffee.UIExtensions
UpdateTexture();
return;
}
else
{
Graphics.ExecuteCommandBuffer(s_CommandBuffer);
}
#endif
if (m_ImmediateCapturing)
{
UpdateTexture();
}
else
{
// Execute command buffer.
canvas.rootCanvas.GetComponent<CanvasScaler>().StartCoroutine(_CoUpdateTextureOnNextFrame());
}
// Execute command buffer.
canvas.rootCanvas.GetComponent<CanvasScaler> ().StartCoroutine (_CoUpdateTextureOnNextFrame ());
}
/// <summary>
@@ -6,9 +6,9 @@ using UnityEngine.UI;
namespace Coffee.UIExtensions
{
[RequireComponent(typeof(Graphic))]
//[RequireComponent(typeof(Graphic))]
[DisallowMultipleComponent]
[AddComponentMenu("UI/UIEffect/UIFlip",102)]
[AddComponentMenu("UI/MeshEffectForTextMeshPro/UIFlip", 102)]
public class UIFlip : BaseMeshEffect
{
//################################
@@ -28,13 +28,13 @@ namespace Coffee.UIExtensions
/// Gets or sets a value indicating whether this <see cref="Coffee.UIExtensions.UIFlip"/> should be flipped horizontally.
/// </summary>
/// <value><c>true</c> if be flipped horizontally; otherwise, <c>false</c>.</value>
public bool horizontal { get { return this.m_Horizontal; } set { this.m_Horizontal = value; } }
public bool horizontal { get { return this.m_Horizontal; } set { this.m_Horizontal = value; SetVerticesDirty (); } }
/// <summary>
/// Gets or sets a value indicating whether this <see cref="Coffee.UIExtensions.UIFlip"/> should be flipped vertically.
/// </summary>
/// <value><c>true</c> if be flipped horizontally; otherwise, <c>false</c>.</value>
public bool vertical { get { return this.m_Veritical; } set { this.m_Veritical = value; } }
public bool vertical { get { return this.m_Veritical; } set { this.m_Veritical = value; SetVerticesDirty (); } }
/// <summary>
/// Call used to modify mesh.
@@ -53,8 +53,6 @@ namespace Coffee.UIExtensions
vt.position = new Vector3(
m_Horizontal ? -pos.x : pos.x,
m_Veritical ? -pos.y : pos.y
// m_Horizontal ? (pos.x + (center.x - pos.x) * 2) : pos.x,
// m_Veritical ? (pos.y + (center.y - pos.y) * 2) : pos.y
);
vh.SetUIVertex(vt, i);
}
@@ -7,7 +7,7 @@ namespace Coffee.UIExtensions
/// UIGradient.
/// </summary>
[DisallowMultipleComponent]
[AddComponentMenu("UI/UIEffect/UIGradient",101)]
[AddComponentMenu("UI/MeshEffectForTextMeshPro/UIGradient", 101)]
public class UIGradient : BaseMeshEffect
{
//################################
@@ -90,7 +90,7 @@ namespace Coffee.UIExtensions
if (m_Direction != value)
{
m_Direction = value;
graphic.SetVerticesDirty();
SetVerticesDirty();
}
}
}
@@ -106,7 +106,7 @@ namespace Coffee.UIExtensions
if (m_Color1 != value)
{
m_Color1 = value;
graphic.SetVerticesDirty();
SetVerticesDirty();
}
}
}
@@ -122,7 +122,7 @@ namespace Coffee.UIExtensions
if (m_Color2 != value)
{
m_Color2 = value;
graphic.SetVerticesDirty();
SetVerticesDirty();
}
}
}
@@ -138,7 +138,7 @@ namespace Coffee.UIExtensions
if (m_Color3 != value)
{
m_Color3 = value;
graphic.SetVerticesDirty();
SetVerticesDirty();
}
}
}
@@ -154,7 +154,7 @@ namespace Coffee.UIExtensions
if (m_Color4 != value)
{
m_Color4 = value;
graphic.SetVerticesDirty();
SetVerticesDirty();
}
}
}
@@ -175,7 +175,7 @@ namespace Coffee.UIExtensions
if (!Mathf.Approximately(m_Rotation, value))
{
m_Rotation = value;
graphic.SetVerticesDirty();
SetVerticesDirty();
}
}
}
@@ -191,7 +191,7 @@ namespace Coffee.UIExtensions
if (m_Offset1 != value)
{
m_Offset1 = value;
graphic.SetVerticesDirty();
SetVerticesDirty();
}
}
}
@@ -208,7 +208,7 @@ namespace Coffee.UIExtensions
{
m_Offset1 = value.y;
m_Offset2 = value.x;
graphic.SetVerticesDirty();
SetVerticesDirty();
}
}
}
@@ -224,7 +224,7 @@ namespace Coffee.UIExtensions
if (m_GradientStyle != value)
{
m_GradientStyle = value;
graphic.SetVerticesDirty();
SetVerticesDirty();
}
}
}
@@ -240,7 +240,7 @@ namespace Coffee.UIExtensions
if (m_ColorSpace != value)
{
m_ColorSpace = value;
graphic.SetVerticesDirty();
SetVerticesDirty();
}
}
}
@@ -256,7 +256,7 @@ namespace Coffee.UIExtensions
if (m_IgnoreAspectRatio != value)
{
m_IgnoreAspectRatio = value;
graphic.SetVerticesDirty();
SetVerticesDirty();
}
}
}
@@ -273,7 +273,7 @@ namespace Coffee.UIExtensions
// Gradient space.
Rect rect = default(Rect);
UIVertex vertex = default(UIVertex);
if (!(graphic is Text) || m_GradientStyle == GradientStyle.Rect)
if (m_GradientStyle == GradientStyle.Rect)
{
// RectTransform.
rect = graphic.rectTransform.rect;
@@ -44,6 +44,7 @@ namespace Coffee.UIExtensions
//################################
// Public Members.
//################################
/// <summary>
/// Target color to affect hsv shift.
/// </summary>
@@ -136,6 +137,10 @@ namespace Coffee.UIExtensions
#if UNITY_EDITOR
protected override Material GetMaterial()
{
if (isTMPro)
{
return null;
}
return MaterialResolver.GetOrGenerateMaterialVariant(Shader.Find(shaderName));
}
#endif
@@ -168,7 +173,11 @@ namespace Coffee.UIExtensions
float h, s, v;
Color.RGBToHSV(m_TargetColor, out h, out s, out v);
ptex.RegisterMaterial(targetGraphic.material);
foreach (var m in materials)
{
ptex.RegisterMaterial (m);
}
ptex.SetData(this, 0, h); // param1.x : target hue
ptex.SetData(this, 1, s); // param1.y : target saturation
ptex.SetData(this, 2, v); // param1.z : target value
@@ -17,7 +17,7 @@ namespace Coffee.UIExtensions
/// </summary>
[RequireComponent(typeof(Graphic))]
[AddComponentMenu("UI/UIEffect/UIShadow", 100)]
public class UIShadow : Shadow, IParameterTexture
public class UIShadow : BaseMeshEffect, IParameterTexture
#if UNITY_EDITOR
, ISerializationCallbackReceiver
#endif
@@ -75,6 +75,64 @@ namespace Coffee.UIExtensions
#pragma warning restore 0414
[SerializeField]
private Color m_EffectColor = new Color (0f, 0f, 0f, 0.5f);
[SerializeField]
private Vector2 m_EffectDistance = new Vector2 (1f, -1f);
[SerializeField]
private bool m_UseGraphicAlpha = true;
private const float kMaxEffectDistance = 600f;
public Color effectColor
{
get { return m_EffectColor; }
set
{
m_EffectColor = value;
if (graphic != null)
graphic.SetVerticesDirty ();
}
}
public Vector2 effectDistance
{
get { return m_EffectDistance; }
set
{
if (value.x > kMaxEffectDistance)
value.x = kMaxEffectDistance;
if (value.x < -kMaxEffectDistance)
value.x = -kMaxEffectDistance;
if (value.y > kMaxEffectDistance)
value.y = kMaxEffectDistance;
if (value.y < -kMaxEffectDistance)
value.y = -kMaxEffectDistance;
if (m_EffectDistance == value)
return;
m_EffectDistance = value;
if (graphic != null)
graphic.SetVerticesDirty ();
}
}
public bool useGraphicAlpha
{
get { return m_UseGraphicAlpha; }
set
{
m_UseGraphicAlpha = value;
if (graphic != null)
graphic.SetVerticesDirty ();
}
}
//################################
// Public Members.
//################################
@@ -141,6 +199,13 @@ namespace Coffee.UIExtensions
ptex = _uiEffect.ptex;
ptex.Register(this);
}
#if TMP_PRESENT
if (isTMPro)
{
textMeshPro.onCullStateChanged.AddListener (OnCullStateChanged);
}
#endif
}
protected override void OnDisable()
@@ -155,6 +220,37 @@ namespace Coffee.UIExtensions
}
#if UNITY_EDITOR
protected override void OnValidate ()
{
effectDistance = m_EffectDistance;
base.OnValidate ();
}
#endif
#if TMP_PRESENT
protected void OnCullStateChanged (bool state)
{
SetVerticesDirty ();
}
Vector2 res;
protected override void LateUpdate ()
{
if (res.x != Screen.width || res.y != Screen.height)
{
res.x = Screen.width;
res.y = Screen.height;
SetVerticesDirty ();
}
if (textMeshPro && transform.hasChanged)
{
transform.hasChanged = false;
}
base.LateUpdate ();
}
#endif
/// <summary>
/// Modifies the mesh.
/// </summary>
@@ -215,7 +311,7 @@ namespace Coffee.UIExtensions
//################################
// Private Members.
//################################
static readonly List<UIVertex> s_Verts = new List<UIVertex>();
static readonly List<UIVertex> s_Verts = new List<UIVertex>(4096);
/// <summary>
/// Append shadow vertices.
@@ -267,7 +363,7 @@ namespace Coffee.UIExtensions
int count = end - start;
var neededCapacity = verts.Count + count;
if (verts.Capacity < neededCapacity)
verts.Capacity = neededCapacity;
verts.Capacity *= 2;
float normalizedIndex = ptex != null && _uiEffect && _uiEffect.isActiveAndEnabled
? ptex.GetNormalizedIndex(this)
@@ -5,7 +5,7 @@ licenseType: Pro
MonoImporter:
serializedVersion: 2
defaultReferences: []
executionOrder: 0
executionOrder: -400
icon: {instanceID: 0}
userData:
assetBundleName:
@@ -50,6 +50,7 @@ namespace Coffee.UIExtensions
[FormerlySerializedAs("m_Highlight")]
[SerializeField][Range(0, 1)] float m_Gloss = 1;
[Header("Advanced Option")]
[Tooltip("The area for effect.")]
[SerializeField] protected EffectArea m_EffectArea;
@@ -222,8 +223,8 @@ namespace Coffee.UIExtensions
{
if (!Mathf.Approximately(m_Rotation, value))
{
m_Rotation = value;
SetDirty();
m_Rotation = _lastRotation = value;
SetVerticesDirty ();
}
}
}
@@ -239,7 +240,7 @@ namespace Coffee.UIExtensions
if (m_EffectArea != value)
{
m_EffectArea = value;
SetDirty();
SetVerticesDirty ();
}
}
}
@@ -247,11 +248,13 @@ namespace Coffee.UIExtensions
/// <summary>
/// Play shinning on enable.
/// </summary>
[System.Obsolete ("Use Play/Stop method instead")]
public bool play { get { return _player.play; } set { _player.play = value; } }
/// <summary>
/// Play shinning loop.
/// </summary>
[System.Obsolete]
public bool loop { get { return _player.loop; } set { _player.loop = value; } }
/// <summary>
@@ -262,6 +265,7 @@ namespace Coffee.UIExtensions
/// <summary>
/// Delay on loop.
/// </summary>
[System.Obsolete]
public float loopDelay { get { return _player.loopDelay; } set { _player.loopDelay = Mathf.Max(value, 0); } }
/// <summary>
@@ -296,6 +300,11 @@ namespace Coffee.UIExtensions
#if UNITY_EDITOR
protected override Material GetMaterial()
{
if (isTMPro)
{
return null;
}
return MaterialResolver.GetOrGenerateMaterialVariant(Shader.Find(shaderName));
}
@@ -324,10 +333,11 @@ namespace Coffee.UIExtensions
if (!isActiveAndEnabled)
return;
bool isText = isTMPro || graphic is Text;
float normalizedIndex = ptex.GetNormalizedIndex(this);
// rect.
Rect rect = m_EffectArea.GetEffectArea(vh, graphic);
Rect rect = m_EffectArea.GetEffectArea (vh, rectTransform.rect);
// rotation.
float rad = m_Rotation * Mathf.Deg2Rad;
@@ -336,29 +346,17 @@ namespace Coffee.UIExtensions
dir = dir.normalized;
// Calculate vertex position.
bool effectEachCharacter = graphic is Text && m_EffectArea == EffectArea.Character;
UIVertex vertex = default(UIVertex);
Vector2 nomalizedPos;
Matrix2x3 localMatrix = new Matrix2x3(rect, dir.x, dir.y); // Get local matrix.
for (int i = 0; i < vh.currentVertCount; i++)
{
vh.PopulateUIVertex(ref vertex, i);
m_EffectArea.GetNormalizedFactor (i, localMatrix, vertex.position, isText, out nomalizedPos);
// Normalize vertex position by local matrix.
if (effectEachCharacter)
{
nomalizedPos = localMatrix * splitedCharacterPosition[i % 4];
}
else
{
nomalizedPos = localMatrix * vertex.position;
}
vertex.uv0 = new Vector2(
Packer.ToFloat(vertex.uv0.x, vertex.uv0.y),
Packer.ToFloat(nomalizedPos.y, normalizedIndex)
vertex.uv0 = new Vector2 (
Packer.ToFloat (vertex.uv0.x, vertex.uv0.y),
Packer.ToFloat (nomalizedPos.y, normalizedIndex)
);
vh.SetUIVertex(vertex, i);
@@ -368,22 +366,25 @@ namespace Coffee.UIExtensions
/// <summary>
/// Play effect.
/// </summary>
public void Play()
public void Play(bool reset = true)
{
_player.Play();
_player.Play(reset);
}
/// <summary>
/// Stop effect.
/// </summary>
public void Stop()
public void Stop(bool reset = true)
{
_player.Stop();
_player.Stop(reset);
}
protected override void SetDirty()
{
ptex.RegisterMaterial(targetGraphic.material);
foreach (var m in materials)
{
ptex.RegisterMaterial (m);
}
ptex.SetData(this, 0, m_EffectFactor); // param1.x : location
ptex.SetData(this, 1, m_Width); // param1.y : width
ptex.SetData(this, 2, m_Softness); // param1.z : softness
@@ -393,7 +394,7 @@ namespace Coffee.UIExtensions
if (!Mathf.Approximately(_lastRotation, m_Rotation) && targetGraphic)
{
_lastRotation = m_Rotation;
targetGraphic.SetVerticesDirty();
SetVerticesDirty();
}
}
@@ -1,5 +1,6 @@
using UnityEngine;
using UnityEngine.UI;
using UnityEngine.Serialization;
namespace Coffee.UIExtensions
{
@@ -38,6 +39,7 @@ namespace Coffee.UIExtensions
[Tooltip("Transition texture (single channel texture).")]
[SerializeField] Texture m_TransitionTexture;
[Header("Advanced Option")]
[Tooltip("The area for effect.")]
[SerializeField] EffectArea m_EffectArea = EffectArea.RectTransform;
@@ -62,6 +64,7 @@ namespace Coffee.UIExtensions
//################################
// Public Members.
//################################
/// <summary>
/// Effect factor between 0(no effect) and 1(complete effect).
/// </summary>
@@ -192,19 +195,19 @@ namespace Coffee.UIExtensions
/// <summary>
/// Show transition.
/// </summary>
public void Show()
public void Show(bool reset = true)
{
_player.loop = false;
_player.Play(f => effectFactor = f);
_player.Play(reset, f => effectFactor = f);
}
/// <summary>
/// Hide transition.
/// </summary>
public void Hide()
public void Hide(bool reset = true)
{
_player.loop = false;
_player.Play(f => effectFactor = 1 - f);
_player.Play(reset, f => effectFactor = 1 - f);
}
/// <summary>
@@ -212,6 +215,11 @@ namespace Coffee.UIExtensions
/// </summary>
public override void ModifyMaterial()
{
if (isTMPro)
{
return;
}
ulong hash = (m_TransitionTexture ? (uint)m_TransitionTexture.GetInstanceID() : 0) + ((ulong)2 << 32) + ((ulong)m_EffectMode << 36);
if (_materialCache != null && (_materialCache.hash != hash || !isActiveAndEnabled || !m_EffectMaterial))
{
@@ -221,15 +229,15 @@ namespace Coffee.UIExtensions
if (!isActiveAndEnabled || !m_EffectMaterial)
{
graphic.material = null;
material = null;
}
else if (!m_TransitionTexture)
{
graphic.material = m_EffectMaterial;
material = m_EffectMaterial;
}
else if (_materialCache != null && _materialCache.hash == hash)
{
graphic.material = _materialCache.material;
material = _materialCache.material;
}
else
{
@@ -237,10 +245,10 @@ namespace Coffee.UIExtensions
{
var mat = new Material(m_EffectMaterial);
mat.name += "_" + m_TransitionTexture.name;
mat.SetTexture("_TransitionTexture", m_TransitionTexture);
mat.SetTexture("_NoiseTex", m_TransitionTexture);
return mat;
});
graphic.material = _materialCache.material;
material = _materialCache.material;
}
}
@@ -254,35 +262,26 @@ namespace Coffee.UIExtensions
return;
}
bool isText = isTMPro || graphic is Text;
float normalizedIndex = ptex.GetNormalizedIndex (this);
// rect.
var tex = transitionTexture;
var aspectRatio = m_KeepAspectRatio && tex ? ((float)tex.width) / tex.height : -1;
Rect rect = m_EffectArea.GetEffectArea(vh, graphic, aspectRatio);
Rect rect = m_EffectArea.GetEffectArea (vh, rectTransform.rect, aspectRatio);
// Set prameters to vertex.
float normalizedIndex = ptex.GetNormalizedIndex(this);
UIVertex vertex = default(UIVertex);
bool effectEachCharacter = graphic is Text && m_EffectArea == EffectArea.Character;
float x, y;
int count = vh.currentVertCount;
for (int i = 0; i < count; i++)
{
vh.PopulateUIVertex(ref vertex, i);
m_EffectArea.GetPositionFactor (i, rect, vertex.position, isText, isTMPro, out x, out y);
if (effectEachCharacter)
{
x = splitedCharacterPosition[i % 4].x;
y = splitedCharacterPosition[i % 4].y;
}
else
{
x = Mathf.Clamp01(vertex.position.x / rect.width + 0.5f);
y = Mathf.Clamp01(vertex.position.y / rect.height + 0.5f);
}
vertex.uv0 = new Vector2(
Packer.ToFloat(vertex.uv0.x, vertex.uv0.y),
Packer.ToFloat(x, y, normalizedIndex)
vertex.uv0 = new Vector2 (
Packer.ToFloat (vertex.uv0.x, vertex.uv0.y),
Packer.ToFloat (x, y, normalizedIndex)
);
vh.SetUIVertex(vertex, i);
}
@@ -307,15 +306,18 @@ namespace Coffee.UIExtensions
/// </summary>
protected override void OnDisable()
{
base.OnDisable ();
MaterialCache.Unregister(_materialCache);
_materialCache = null;
base.OnDisable();
_player.OnDisable();
}
protected override void SetDirty()
{
ptex.RegisterMaterial(targetGraphic.material);
foreach (var m in materials)
{
ptex.RegisterMaterial (m);
}
ptex.SetData(this, 0, m_EffectFactor); // param1.x : effect factor
if (m_EffectMode == EffectMode.Dissolve)
{
@@ -329,7 +331,7 @@ namespace Coffee.UIExtensions
// Disable graphic's raycastTarget on hidden.
if (m_PassRayOnHidden)
{
graphic.raycastTarget = 0 < m_EffectFactor;
targetGraphic.raycastTarget = 0 < m_EffectFactor;
}
}
@@ -57,80 +57,29 @@ Shader "UI/Hidden/UI-Effect-Dissolve"
#pragma fragment frag
#pragma target 2.0
#define DISSOLVE 1
#pragma multi_compile __ UNITY_UI_ALPHACLIP
#pragma shader_feature __ ADD SUBTRACT FILL
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#define UI_DISSOLVE 1
#include "UI-Effect.cginc"
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
float4 worldPosition : TEXCOORD1;
UNITY_VERTEX_OUTPUT_STEREO
half3 param : TEXCOORD2;
};
fixed4 _Color;
fixed4 _TextureSampleAdd;
float4 _ClipRect;
sampler2D _MainTex;
sampler2D _NoiseTex;
sampler2D _ParamTex;
v2f vert(appdata_t IN)
{
v2f OUT;
UNITY_SETUP_INSTANCE_ID(IN);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT);
OUT.worldPosition = IN.vertex;
OUT.vertex = UnityObjectToClipPos(IN.vertex);
OUT.texcoord = IN.texcoord;
OUT.color = IN.color * _Color;
OUT.texcoord = UnpackToVec2(IN.texcoord.x);
OUT.param = UnpackToVec3(IN.texcoord.y);
return OUT;
}
#include "UI-Effect-Sprite.cginc"
fixed4 frag(v2f IN) : SV_Target
{
fixed4 param1 = tex2D(_ParamTex, float2(0.25, IN.param.z));
fixed location = param1.x;
fixed width = param1.y/4;
fixed softness = param1.z;
fixed3 dissolveColor = tex2D(_ParamTex, float2(0.75, IN.param.z)).rgb;
float cutout = tex2D(_NoiseTex, IN.param.xy).a;
half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd) * IN.color;
color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
float factor = cutout - location * ( 1 + width ) + width;
// Dissolve
color = ApplyTransitionEffect(color, IN.eParam);
#ifdef UNITY_UI_ALPHACLIP
clip (min(color.a - 0.01, factor));
clip (color.a - 0.001);
#endif
fixed edgeLerp = step(factor, color.a) * saturate((width - factor)*16/ softness);
color = ApplyColorEffect(color, fixed4(dissolveColor, edgeLerp));
color.a *= saturate((factor)*32/ softness);
return color;
}
ENDCG
@@ -3,6 +3,7 @@
Properties
{
[PerRendererData] _MainTex ("Main Texture", 2D) = "white" {}
_Color ("Tint", Color) = (1,1,1,1)
_StencilComp ("Stencil Comparison", Float) = 8
_Stencil ("Stencil ID", Float) = 0
@@ -53,89 +54,21 @@
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#define UI_HSV_MODIFIER 1
#include "UI-Effect.cginc"
sampler2D _MainTex;
fixed4 _TextureSampleAdd;
float4 _ClipRect;
sampler2D _ParamTex;
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
float4 wpos : TEXCOORD1;
UNITY_VERTEX_OUTPUT_STEREO
half param : TEXCOORD2;
};
v2f vert(appdata_t IN)
{
v2f OUT;
UNITY_SETUP_INSTANCE_ID(IN);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT);
OUT.wpos = IN.vertex;
OUT.vertex = UnityObjectToClipPos(IN.vertex);
OUT.texcoord = IN.texcoord;
OUT.color = IN.color;
OUT.texcoord = UnpackToVec2(IN.texcoord.x);
OUT.param = IN.texcoord.y;
return OUT;
}
half3 rgb2hsv(half3 c) {
half4 K = half4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
half4 p = lerp(half4(c.bg, K.wz), half4(c.gb, K.xy), step(c.b, c.g));
half4 q = lerp(half4(p.xyw, c.r), half4(c.r, p.yzx), step(p.x, c.r));
half d = q.x - min(q.w, q.y);
half e = 1.0e-10;
return half3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
}
half3 hsv2rgb(half3 c) {
c = half3(c.x, clamp(c.yz, 0.0, 1.0));
half4 K = half4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
half3 p = abs(frac(c.xxx + K.xyz) * 6.0 - K.www);
return c.z * lerp(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
}
#include "UI-Effect-Sprite.cginc"
fixed4 frag(v2f IN) : COLOR
{
fixed4 param1 = tex2D(_ParamTex, float2(0.25, IN.param));
fixed4 param2 = tex2D(_ParamTex, float2(0.75, IN.param));
fixed3 targetHsv = param1.rgb;
fixed3 targetRange = param1.w;
fixed3 hsvShift = param2.xyz - 0.5;
half4 color = tex2D(_MainTex, IN.texcoord);// + _TextureSampleAdd) * IN.color;
color.a *= UnityGet2DClipping(IN.wpos.xy, _ClipRect);
color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
#ifdef UNITY_UI_ALPHACLIP
clip (color.a - 0.001);
#endif
half3 hsv = rgb2hsv(color.rgb);
half3 range = abs(hsv - targetHsv);
half diff = max(max(min(1-range.x, range.x), min(1-range.y, range.y)/10), min(1-range.z, range.z)/10);
fixed masked = step(diff, targetRange);
color.rgb = hsv2rgb(hsv + hsvShift * masked);
color = ApplyHsvEffect(color, IN.eParam);
return (color + _TextureSampleAdd) * IN.color;
}
@@ -55,79 +55,25 @@ Shader "UI/Hidden/UI-Effect-Shiny"
#pragma target 2.0
#pragma multi_compile __ UNITY_UI_ALPHACLIP
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#define UI_SHINY 1
#include "UI-Effect.cginc"
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
float4 worldPosition : TEXCOORD1;
UNITY_VERTEX_OUTPUT_STEREO
half2 param : TEXCOORD2;
};
fixed4 _Color;
fixed4 _TextureSampleAdd;
float4 _ClipRect;
sampler2D _MainTex;
float4 _MainTex_TexelSize;
sampler2D _ParamTex;
v2f vert(appdata_t IN)
{
v2f OUT;
UNITY_SETUP_INSTANCE_ID(IN);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT);
OUT.worldPosition = IN.vertex;
OUT.vertex = UnityObjectToClipPos(IN.vertex);
OUT.color = IN.color * _Color;
OUT.texcoord = UnpackToVec2(IN.texcoord.x);
OUT.param = UnpackToVec2(IN.texcoord.y);
return OUT;
}
#include "UI-Effect-Sprite.cginc"
fixed4 frag(v2f IN) : SV_Target
{
fixed nomalizedPos = IN.param.x;
fixed4 param1 = tex2D(_ParamTex, float2(0.25, IN.param.y));
fixed4 param2 = tex2D(_ParamTex, float2(0.75, IN.param.y));
half location = param1.x * 2 - 0.5;
fixed width = param1.y;
fixed softness = param1.z;
fixed brightness = param1.w;
fixed gloss = param2.x;
half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd);
fixed4 originAlpha = color.a;
color *= IN.color;
half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd) * IN.color;
color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
color = ApplyShinyEffect(color, IN.eParam);
#ifdef UNITY_UI_ALPHACLIP
clip (color.a - 0.001);
#endif
half normalized = 1 - saturate(abs((nomalizedPos - location) / width));
half shinePower = smoothstep(0, softness*2, normalized);
half3 reflectColor = lerp(1, color.rgb * 10, gloss);
color.rgb += originAlpha * (shinePower / 2) * brightness * reflectColor;
return color;
}
ENDCG
@@ -0,0 +1,77 @@
#ifndef UI_EFFECT_SPRITE_INCLUDED
#define UI_EFFECT_SPRITE_INCLUDED
fixed4 _Color;
fixed4 _TextureSampleAdd;
float4 _ClipRect;
sampler2D _MainTex;
float4 _MainTex_TexelSize;
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
#if EX && TMP_SPRITE
float2 uvMask : TEXCOORD2;
#elif EX
float2 uvMask : TEXCOORD1;
#endif
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
half2 texcoord : TEXCOORD0;
float4 worldPosition : TEXCOORD1;
#if UI_DISSOLVE || UI_TRANSITION
half3 eParam : TEXCOORD2;
#elif UI_SHINY
half2 eParam : TEXCOORD2;
#else
half eParam : TEXCOORD2;
#endif
#if EX
half4 uvMask : TEXCOORD3;
#endif
UNITY_VERTEX_OUTPUT_STEREO
};
v2f vert(appdata_t IN)
{
v2f OUT;
UNITY_SETUP_INSTANCE_ID(IN);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT);
OUT.worldPosition = IN.vertex;
OUT.vertex = UnityObjectToClipPos(OUT.worldPosition);
#if UI_EFFECT
OUT.texcoord = UnpackToVec2(IN.texcoord.x) * 2 - 0.5;
#else
OUT.texcoord = UnpackToVec2(IN.texcoord.x);
#endif
#ifdef UNITY_HALF_TEXEL_OFFSET
OUT.vertex.xy += (_ScreenParams.zw-1.0)*float2(-1,1);
#endif
OUT.color = IN.color * _Color;
#if UI_DISSOLVE || UI_TRANSITION
OUT.eParam = UnpackToVec3(IN.texcoord.y);
#elif UI_SHINY
OUT.eParam = UnpackToVec2(IN.texcoord.y);
#else
OUT.eParam = IN.texcoord.y;
#endif
#if EX
OUT.uvMask = half4(UnpackToVec2(IN.uvMask.x), UnpackToVec2(IN.uvMask.y));
#endif
return OUT;
}
#endif // UI_EFFECT_SPRITE_INCLUDED
@@ -0,0 +1,9 @@
fileFormatVersion: 2
guid: dd60a36b172cf49e2b82258a68799ce3
timeCreated: 1487915863
licenseType: Pro
ShaderImporter:
defaultTextures: []
userData:
assetBundleName:
assetBundleVariant:
@@ -16,7 +16,7 @@ Shader "UI/Hidden/UI-Effect-Transition"
[Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0
[Header(Transition)]
_TransitionTexture("Transition Texture (A)", 2D) = "white" {}
_NoiseTex ("Transition Texture (A)", 2D) = "white" {}
_ParamTex ("Parameter Texture", 2D) = "white" {}
}
@@ -56,82 +56,24 @@ Shader "UI/Hidden/UI-Effect-Transition"
#pragma fragment frag
#pragma target 2.0
#define REVERSE 1
#define ADD 1
#pragma multi_compile __ UNITY_UI_ALPHACLIP
#pragma shader_feature __ FADE CUTOFF DISSOLVE
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#define UI_TRANSITION 1
#include "UI-Effect.cginc"
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
};
struct v2f
{
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
float4 wpos : TEXCOORD1;
half3 param : TEXCOORD2;
UNITY_VERTEX_OUTPUT_STEREO
};
fixed4 _Color;
fixed4 _TextureSampleAdd;
float4 _ClipRect;
sampler2D _MainTex;
sampler2D _TransitionTexture;
sampler2D _ParamTex;
v2f vert(appdata_t IN)
{
v2f OUT;
UNITY_SETUP_INSTANCE_ID(IN);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT);
OUT.wpos = IN.vertex;
OUT.vertex = UnityObjectToClipPos(OUT.wpos);
OUT.texcoord = UnpackToVec2(IN.texcoord.x);
OUT.param = UnpackToVec3(IN.texcoord.y);
OUT.color = IN.color * _Color;
return OUT;
}
#include "UI-Effect-Sprite.cginc"
fixed4 frag(v2f IN) : SV_Target
{
fixed4 param1 = tex2D(_ParamTex, float2(0.25, IN.param.z));
fixed effectFactor = param1.x;
float alpha = tex2D(_TransitionTexture, IN.param.xy).a;
half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd);
color.a *= UnityGet2DClipping(IN.wpos.xy, _ClipRect);
#if FADE
color.a *= saturate(alpha + (effectFactor * 2 - 1));
#elif CUTOFF
color.a *= step(0.001, color.a * alpha - 1 + effectFactor);
#elif DISSOLVE
fixed width = param1.y/4;
fixed softness = param1.z;
fixed3 dissolveColor = tex2D(_ParamTex, float2(0.75, IN.param.z)).rgb;
float factor = alpha - (1 - effectFactor) * ( 1 + width ) + width;
fixed edgeLerp = step(factor, color.a) * saturate((width - factor)*16/ softness);
color.rgb += dissolveColor.rgb * edgeLerp;
color.a *= saturate((factor)*32/ softness);
#endif
color *= IN.color;
color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
color = ApplyTransitionEffect(color, IN.eParam) * IN.color;
#if UNITY_UI_ALPHACLIP
clip (color.a - 0.001);
@@ -1,12 +1,12 @@
fileFormatVersion: 2
guid: 85ad24dd0759947ddb117625e108d49c
timeCreated: 1482973535
timeCreated: 1548078121
licenseType: Pro
ShaderImporter:
defaultTextures:
- _MainTex: {instanceID: 0}
- _TransitionTexture: {fileID: 2800000, guid: a74d3d4a498866d44b094d3d3717604d,
type: 3}
- _NoiseTex: {fileID: 2800000, guid: 3e04c247fb2604af186173fce0bc62de, type: 3}
- _ParamTex: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:
@@ -1,6 +1,10 @@
#ifndef UI_EFFECT_INCLUDED
#define UI_EFFECT_INCLUDED
sampler2D _NoiseTex;
sampler2D _ParamTex;
#if GRAYSCALE | SEPIA | NEGA | PIXEL | MONO | CUTOFF | HUE
#define UI_TONE
#endif
@@ -191,9 +195,9 @@ fixed4 ApplyToneEffect(fixed4 color, fixed factor)
}
// Apply color effect.
half4 ApplyColorEffect(half4 color, half4 factor)
fixed4 ApplyColorEffect(half4 color, half4 factor)
{
#ifdef FILL
#if FILL
color.rgb = lerp(color.rgb, factor.rgb, factor.a);
#elif ADD
@@ -213,4 +217,93 @@ half4 ApplyColorEffect(half4 color, half4 factor)
return color;
}
// Apply transition effect.
fixed4 ApplyTransitionEffect(half4 color, half3 transParam)
{
fixed4 param = tex2D(_ParamTex, float2(0.25, transParam.z));
float alpha = tex2D(_NoiseTex, transParam.xy).a;
#if REVERSE
fixed effectFactor = 1 - param.x;
#else
fixed effectFactor = param.x;
#endif
#if FADE
color.a *= saturate(alpha + (1 - effectFactor * 2));
#elif CUTOFF
color.a *= step(0.001, color.a * alpha - effectFactor);
#elif DISSOLVE
fixed width = param.y/4;
fixed softness = param.z;
fixed3 dissolveColor = tex2D(_ParamTex, float2(0.75, transParam.z)).rgb;
float factor = alpha - effectFactor * ( 1 + width ) + width;
fixed edgeLerp = step(factor, color.a) * saturate((width - factor)*16/ softness);
color = ApplyColorEffect(color, fixed4(dissolveColor, edgeLerp));
color.a *= saturate((factor)*32/ softness);
#endif
return color;
}
// Apply shiny effect.
half4 ApplyShinyEffect(half4 color, half2 shinyParam)
{
fixed nomalizedPos = shinyParam.x;
fixed4 param1 = tex2D(_ParamTex, float2(0.25, shinyParam.y));
fixed4 param2 = tex2D(_ParamTex, float2(0.75, shinyParam.y));
half location = param1.x * 2 - 0.5;
fixed width = param1.y;
fixed soft = param1.z;
fixed brightness = param1.w;
fixed gloss = param2.x;
half normalized = 1 - saturate(abs((nomalizedPos - location) / width));
half shinePower = smoothstep(0, soft*2, normalized);
half3 reflectColor = lerp(1, color.rgb * 10, gloss);
color.rgb += color.a * (shinePower / 2) * brightness * reflectColor;
return color;
}
half3 RgbToHsv(half3 c) {
half4 K = half4(0.0, -1.0 / 3.0, 2.0 / 3.0, -1.0);
half4 p = lerp(half4(c.bg, K.wz), half4(c.gb, K.xy), step(c.b, c.g));
half4 q = lerp(half4(p.xyw, c.r), half4(c.r, p.yzx), step(p.x, c.r));
half d = q.x - min(q.w, q.y);
half e = 1.0e-10;
return half3(abs(q.z + (q.w - q.y) / (6.0 * d + e)), d / (q.x + e), q.x);
}
half3 HsvToRgb(half3 c) {
c = half3(c.x, clamp(c.yz, 0.0, 1.0));
half4 K = half4(1.0, 2.0 / 3.0, 1.0 / 3.0, 3.0);
half3 p = abs(frac(c.xxx + K.xyz) * 6.0 - K.www);
return c.z * lerp(K.xxx, clamp(p - K.xxx, 0.0, 1.0), c.y);
}
// Apply Hsv effect.
half4 ApplyHsvEffect(half4 color, half param)
{
fixed4 param1 = tex2D(_ParamTex, float2(0.25, param));
fixed4 param2 = tex2D(_ParamTex, float2(0.75, param));
fixed3 targetHsv = param1.rgb;
fixed3 targetRange = param1.w;
fixed3 hsvShift = param2.xyz - 0.5;
half3 hsv = RgbToHsv(color.rgb);
half3 range = abs(hsv - targetHsv);
half diff = max(max(min(1-range.x, range.x), min(1-range.y, range.y)/10), min(1-range.z, range.z)/10);
fixed masked = step(diff, targetRange);
color.rgb = HsvToRgb(hsv + hsvShift * masked);
return color;
}
#endif // UI_EFFECT_INCLUDED
@@ -67,68 +67,14 @@ Shader "UI/Hidden/UI-Effect"
#include "UnityCG.cginc"
#include "UnityUI.cginc"
#define UI_EFFECT 1
#include "UI-Effect.cginc"
struct appdata_t
{
float4 vertex : POSITION;
float4 color : COLOR;
float2 texcoord : TEXCOORD0;
UNITY_VERTEX_INPUT_INSTANCE_ID
#if defined(EX)
float2 uvMask : TEXCOORD1;
#endif
};
struct v2f
{
float4 vertex : SV_POSITION;
fixed4 color : COLOR;
float2 texcoord : TEXCOORD0;
float4 worldPosition : TEXCOORD1;
UNITY_VERTEX_OUTPUT_STEREO
half param : TEXCOORD2;
#if defined(EX)
half4 uvMask : TEXCOORD3;
#endif
};
fixed4 _Color;
fixed4 _TextureSampleAdd;
float4 _ClipRect;
sampler2D _MainTex;
float4 _MainTex_TexelSize;
sampler2D _ParamTex;
v2f vert(appdata_t IN)
{
v2f OUT;
UNITY_SETUP_INSTANCE_ID(IN);
UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT);
OUT.worldPosition = IN.vertex;
OUT.vertex = UnityObjectToClipPos(OUT.worldPosition);
OUT.color = IN.color * _Color;
OUT.texcoord = UnpackToVec2(IN.texcoord.x) * 2 - 0.5;
OUT.param = IN.texcoord.y;
#if defined(EX)
OUT.uvMask.xy = UnpackToVec2(IN.uvMask.x);
OUT.uvMask.zw = UnpackToVec2(IN.uvMask.y);
#endif
return OUT;
}
#include "UI-Effect-Sprite.cginc"
fixed4 frag(v2f IN) : SV_Target
{
fixed4 param = tex2D(_ParamTex, float2(0.5, IN.param));
fixed4 param = tex2D(_ParamTex, float2(0.5, IN.eParam));
fixed effectFactor = param.x;
fixed colorFactor = param.y;
fixed blurFactor = param.z;
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f19f821c4c7ad4b629b11360fac9f22b
timeCreated: 1551703578
licenseType: Pro
DefaultImporter:
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,7 @@
fileFormatVersion: 2
guid: b19c8ef1bac404c6e95d70b6c332cd60
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
@@ -2,7 +2,7 @@
"name": "com.coffee.uieffect",
"displayName": "UIEffect",
"description": " UIEffect is an effect component for uGUI element in Unity.\nLet's decorate your UI with effects!",
"version": "3.0.4",
"version": "3.2.0",
"unity": "5.5",
"license": "MIT",
"repository": {
@@ -0,0 +1,238 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Bangers Logo SDF (UIDissolve)
m_Shader: {fileID: 4800000, guid: 983d3d7238f4540e3af421a4abb25e26, type: 3}
m_ShaderKeywords: ADD GLOW_ON
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _BumpMap
second:
m_Texture: {fileID: 2800000, guid: f3133098380a54154a6efe8ad05b5303, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _Cube
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _FaceTex
second:
m_Texture: {fileID: 2800000, guid: 05b6b2f208a9b485795b37fc99d07e64, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MainTex
second:
m_Texture: {fileID: 2800000, guid: bbd344ef7d3cd48deb04e207c034ccb7, type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MaskTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _NoiseTex
second:
m_Texture: {fileID: 2800000, guid: 87e2a5102f952174eb7505e5cff15bda, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _OutlineTex
second:
m_Texture: {fileID: 2800000, guid: 083315c2119934ed6ba70936e2dc07ee, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _Ambient
second: 0.5
- first:
name: _Bevel
second: 0.461
- first:
name: _BevelClamp
second: 0
- first:
name: _BevelOffset
second: -0.09
- first:
name: _BevelRoundness
second: 0.615
- first:
name: _BevelWidth
second: 0.001
- first:
name: _BumpFace
second: 0
- first:
name: _BumpOutline
second: 0
- first:
name: _ColorMask
second: 15
- first:
name: _Diffuse
second: 0.5
- first:
name: _FaceDilate
second: 0.2
- first:
name: _FaceUVSpeedX
second: 0
- first:
name: _FaceUVSpeedY
second: 0
- first:
name: _GlowInner
second: 0.076
- first:
name: _GlowOffset
second: 0.354
- first:
name: _GlowOuter
second: 0.336
- first:
name: _GlowPower
second: 0.75
- first:
name: _GradientScale
second: 11
- first:
name: _LightAngle
second: 3.1416
- first:
name: _MaskSoftnessX
second: 0
- first:
name: _MaskSoftnessY
second: 0
- first:
name: _OutlineSoftness
second: 0
- first:
name: _OutlineUVSpeedX
second: 0
- first:
name: _OutlineUVSpeedY
second: 0
- first:
name: _OutlineWidth
second: 0.4
- first:
name: _PerspectiveFilter
second: 0.875
- first:
name: _Reflectivity
second: 10
- first:
name: _ScaleRatioA
second: 0.90909094
- first:
name: _ScaleRatioB
second: 0.6136364
- first:
name: _ScaleRatioC
second: 0.6136364
- first:
name: _ScaleX
second: 1
- first:
name: _ScaleY
second: 1
- first:
name: _ShaderFlags
second: 0
- first:
name: _SpecularPower
second: 2
- first:
name: _Stencil
second: 0
- first:
name: _StencilComp
second: 8
- first:
name: _StencilOp
second: 0
- first:
name: _StencilReadMask
second: 255
- first:
name: _StencilWriteMask
second: 255
- first:
name: _TextureHeight
second: 1024
- first:
name: _TextureWidth
second: 1024
- first:
name: _UnderlayDilate
second: 0
- first:
name: _UnderlayOffsetX
second: 0
- first:
name: _UnderlayOffsetY
second: 0
- first:
name: _UnderlaySoftness
second: 0
- first:
name: _VertexOffsetX
second: 0
- first:
name: _VertexOffsetY
second: 0
- first:
name: _WeightBold
second: 0.5
- first:
name: _WeightNormal
second: 0
m_Colors:
- first:
name: _ClipRect
second: {r: -10000, g: -10000, b: 10000, a: 10000}
- first:
name: _EnvMatrixRotation
second: {r: 0, g: 0, b: 0, a: 0}
- first:
name: _FaceColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _GlowColor
second: {r: 1, g: 0.6344826, b: 0, a: 0.5019608}
- first:
name: _MaskCoord
second: {r: 0, g: 0, b: 100000, a: 100000}
- first:
name: _OutlineColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _ReflectFaceColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _ReflectOutlineColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _SpecularColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _UnderlayColor
second: {r: 0, g: 0, b: 0, a: 0.5}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 8095a67764b3e4631b9fd9b785a3025b
timeCreated: 1548072854
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,238 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Bangers Logo SDF (UIEffect)
m_Shader: {fileID: 4800000, guid: fdc3d2db3815548ae9eea37e1be79f36, type: 3}
m_ShaderKeywords: DETAILBLUR FILL GLOW_ON GRAYSCALE
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _BumpMap
second:
m_Texture: {fileID: 2800000, guid: f3133098380a54154a6efe8ad05b5303, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _Cube
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _FaceTex
second:
m_Texture: {fileID: 2800000, guid: 05b6b2f208a9b485795b37fc99d07e64, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MainTex
second:
m_Texture: {fileID: 2800000, guid: bbd344ef7d3cd48deb04e207c034ccb7, type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MaskTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _NoiseTex
second:
m_Texture: {fileID: 2800000, guid: 3e04c247fb2604af186173fce0bc62de, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _OutlineTex
second:
m_Texture: {fileID: 2800000, guid: 083315c2119934ed6ba70936e2dc07ee, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _Ambient
second: 0.5
- first:
name: _Bevel
second: 0.461
- first:
name: _BevelClamp
second: 0
- first:
name: _BevelOffset
second: -0.09
- first:
name: _BevelRoundness
second: 0.615
- first:
name: _BevelWidth
second: 0.001
- first:
name: _BumpFace
second: 0
- first:
name: _BumpOutline
second: 0
- first:
name: _ColorMask
second: 15
- first:
name: _Diffuse
second: 0.5
- first:
name: _FaceDilate
second: 0.2
- first:
name: _FaceUVSpeedX
second: 0
- first:
name: _FaceUVSpeedY
second: 0
- first:
name: _GlowInner
second: 0.076
- first:
name: _GlowOffset
second: 0.354
- first:
name: _GlowOuter
second: 0.336
- first:
name: _GlowPower
second: 0.75
- first:
name: _GradientScale
second: 11
- first:
name: _LightAngle
second: 3.1416
- first:
name: _MaskSoftnessX
second: 0
- first:
name: _MaskSoftnessY
second: 0
- first:
name: _OutlineSoftness
second: 0
- first:
name: _OutlineUVSpeedX
second: 0
- first:
name: _OutlineUVSpeedY
second: 0
- first:
name: _OutlineWidth
second: 0.4
- first:
name: _PerspectiveFilter
second: 0.875
- first:
name: _Reflectivity
second: 10
- first:
name: _ScaleRatioA
second: 0.90909094
- first:
name: _ScaleRatioB
second: 0.6136364
- first:
name: _ScaleRatioC
second: 0.6136364
- first:
name: _ScaleX
second: 1
- first:
name: _ScaleY
second: 1
- first:
name: _ShaderFlags
second: 0
- first:
name: _SpecularPower
second: 2
- first:
name: _Stencil
second: 0
- first:
name: _StencilComp
second: 8
- first:
name: _StencilOp
second: 0
- first:
name: _StencilReadMask
second: 255
- first:
name: _StencilWriteMask
second: 255
- first:
name: _TextureHeight
second: 1024
- first:
name: _TextureWidth
second: 1024
- first:
name: _UnderlayDilate
second: 0
- first:
name: _UnderlayOffsetX
second: 0
- first:
name: _UnderlayOffsetY
second: 0
- first:
name: _UnderlaySoftness
second: 0
- first:
name: _VertexOffsetX
second: 0
- first:
name: _VertexOffsetY
second: 0
- first:
name: _WeightBold
second: 0.5
- first:
name: _WeightNormal
second: 0
m_Colors:
- first:
name: _ClipRect
second: {r: -10000, g: -10000, b: 10000, a: 10000}
- first:
name: _EnvMatrixRotation
second: {r: 0, g: 0, b: 0, a: 0}
- first:
name: _FaceColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _GlowColor
second: {r: 1, g: 0.6344826, b: 0, a: 0.5019608}
- first:
name: _MaskCoord
second: {r: 0, g: 0, b: 100000, a: 100000}
- first:
name: _OutlineColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _ReflectFaceColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _ReflectOutlineColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _SpecularColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _UnderlayColor
second: {r: 0, g: 0, b: 0, a: 0.5}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: fef03a901b15f4f5ea7fe7ffb3dc2f3f
timeCreated: 1551052302
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,238 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Bangers Logo SDF (UIHsvModifier)
m_Shader: {fileID: 4800000, guid: 58c5c12ea67b943f2bb08cdba8767f41, type: 3}
m_ShaderKeywords: GLOW_ON
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _BumpMap
second:
m_Texture: {fileID: 2800000, guid: f3133098380a54154a6efe8ad05b5303, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _Cube
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _FaceTex
second:
m_Texture: {fileID: 2800000, guid: 05b6b2f208a9b485795b37fc99d07e64, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MainTex
second:
m_Texture: {fileID: 2800000, guid: bbd344ef7d3cd48deb04e207c034ccb7, type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MaskTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _NoiseTex
second:
m_Texture: {fileID: 2800000, guid: 3e04c247fb2604af186173fce0bc62de, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _OutlineTex
second:
m_Texture: {fileID: 2800000, guid: 083315c2119934ed6ba70936e2dc07ee, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _Ambient
second: 0.5
- first:
name: _Bevel
second: 0.461
- first:
name: _BevelClamp
second: 0
- first:
name: _BevelOffset
second: -0.09
- first:
name: _BevelRoundness
second: 0.615
- first:
name: _BevelWidth
second: 0.001
- first:
name: _BumpFace
second: 0
- first:
name: _BumpOutline
second: 0
- first:
name: _ColorMask
second: 15
- first:
name: _Diffuse
second: 0.5
- first:
name: _FaceDilate
second: 0.2
- first:
name: _FaceUVSpeedX
second: 0
- first:
name: _FaceUVSpeedY
second: 0
- first:
name: _GlowInner
second: 0.076
- first:
name: _GlowOffset
second: 0.354
- first:
name: _GlowOuter
second: 0.336
- first:
name: _GlowPower
second: 0.75
- first:
name: _GradientScale
second: 11
- first:
name: _LightAngle
second: 3.1416
- first:
name: _MaskSoftnessX
second: 0
- first:
name: _MaskSoftnessY
second: 0
- first:
name: _OutlineSoftness
second: 0
- first:
name: _OutlineUVSpeedX
second: 0
- first:
name: _OutlineUVSpeedY
second: 0
- first:
name: _OutlineWidth
second: 0.4
- first:
name: _PerspectiveFilter
second: 0.875
- first:
name: _Reflectivity
second: 10
- first:
name: _ScaleRatioA
second: 0.90909094
- first:
name: _ScaleRatioB
second: 0.6136364
- first:
name: _ScaleRatioC
second: 0.6136364
- first:
name: _ScaleX
second: 1
- first:
name: _ScaleY
second: 1
- first:
name: _ShaderFlags
second: 0
- first:
name: _SpecularPower
second: 2
- first:
name: _Stencil
second: 0
- first:
name: _StencilComp
second: 8
- first:
name: _StencilOp
second: 0
- first:
name: _StencilReadMask
second: 255
- first:
name: _StencilWriteMask
second: 255
- first:
name: _TextureHeight
second: 1024
- first:
name: _TextureWidth
second: 1024
- first:
name: _UnderlayDilate
second: 0
- first:
name: _UnderlayOffsetX
second: 0
- first:
name: _UnderlayOffsetY
second: 0
- first:
name: _UnderlaySoftness
second: 0
- first:
name: _VertexOffsetX
second: 0
- first:
name: _VertexOffsetY
second: 0
- first:
name: _WeightBold
second: 0.5
- first:
name: _WeightNormal
second: 0
m_Colors:
- first:
name: _ClipRect
second: {r: -10000, g: -10000, b: 10000, a: 10000}
- first:
name: _EnvMatrixRotation
second: {r: 0, g: 0, b: 0, a: 0}
- first:
name: _FaceColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _GlowColor
second: {r: 1, g: 0.6344826, b: 0, a: 0.5019608}
- first:
name: _MaskCoord
second: {r: 0, g: 0, b: 100000, a: 100000}
- first:
name: _OutlineColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _ReflectFaceColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _ReflectOutlineColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _SpecularColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _UnderlayColor
second: {r: 0, g: 0, b: 0, a: 0.5}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: d39b9f54f01514aa484f7ccc871595c3
timeCreated: 1548073314
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,238 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Bangers Logo SDF (UIShiny)
m_Shader: {fileID: 4800000, guid: 7a9c01b59189f4a738528999fa0aa9fe, type: 3}
m_ShaderKeywords: GLOW_ON
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _BumpMap
second:
m_Texture: {fileID: 2800000, guid: f3133098380a54154a6efe8ad05b5303, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _Cube
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _FaceTex
second:
m_Texture: {fileID: 2800000, guid: 05b6b2f208a9b485795b37fc99d07e64, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MainTex
second:
m_Texture: {fileID: 2800000, guid: bbd344ef7d3cd48deb04e207c034ccb7, type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MaskTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _NoiseTex
second:
m_Texture: {fileID: 2800000, guid: 3e04c247fb2604af186173fce0bc62de, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _OutlineTex
second:
m_Texture: {fileID: 2800000, guid: 083315c2119934ed6ba70936e2dc07ee, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _Ambient
second: 0.5
- first:
name: _Bevel
second: 0.461
- first:
name: _BevelClamp
second: 0
- first:
name: _BevelOffset
second: -0.09
- first:
name: _BevelRoundness
second: 0.615
- first:
name: _BevelWidth
second: 0.001
- first:
name: _BumpFace
second: 0
- first:
name: _BumpOutline
second: 0
- first:
name: _ColorMask
second: 15
- first:
name: _Diffuse
second: 0.5
- first:
name: _FaceDilate
second: 0.2
- first:
name: _FaceUVSpeedX
second: 0
- first:
name: _FaceUVSpeedY
second: 0
- first:
name: _GlowInner
second: 0.076
- first:
name: _GlowOffset
second: 0.354
- first:
name: _GlowOuter
second: 0.336
- first:
name: _GlowPower
second: 0.75
- first:
name: _GradientScale
second: 11
- first:
name: _LightAngle
second: 3.1416
- first:
name: _MaskSoftnessX
second: 0
- first:
name: _MaskSoftnessY
second: 0
- first:
name: _OutlineSoftness
second: 0
- first:
name: _OutlineUVSpeedX
second: 0
- first:
name: _OutlineUVSpeedY
second: 0
- first:
name: _OutlineWidth
second: 0.4
- first:
name: _PerspectiveFilter
second: 0.875
- first:
name: _Reflectivity
second: 10
- first:
name: _ScaleRatioA
second: 0.90909094
- first:
name: _ScaleRatioB
second: 0.6136364
- first:
name: _ScaleRatioC
second: 0.6136364
- first:
name: _ScaleX
second: 1
- first:
name: _ScaleY
second: 1
- first:
name: _ShaderFlags
second: 0
- first:
name: _SpecularPower
second: 2
- first:
name: _Stencil
second: 0
- first:
name: _StencilComp
second: 8
- first:
name: _StencilOp
second: 0
- first:
name: _StencilReadMask
second: 255
- first:
name: _StencilWriteMask
second: 255
- first:
name: _TextureHeight
second: 1024
- first:
name: _TextureWidth
second: 1024
- first:
name: _UnderlayDilate
second: 0
- first:
name: _UnderlayOffsetX
second: 0
- first:
name: _UnderlayOffsetY
second: 0
- first:
name: _UnderlaySoftness
second: 0
- first:
name: _VertexOffsetX
second: 0
- first:
name: _VertexOffsetY
second: 0
- first:
name: _WeightBold
second: 0.5
- first:
name: _WeightNormal
second: 0
m_Colors:
- first:
name: _ClipRect
second: {r: -10000, g: -10000, b: 10000, a: 10000}
- first:
name: _EnvMatrixRotation
second: {r: 0, g: 0, b: 0, a: 0}
- first:
name: _FaceColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _GlowColor
second: {r: 1, g: 0.6344826, b: 0, a: 0.5019608}
- first:
name: _MaskCoord
second: {r: 0, g: 0, b: 100000, a: 100000}
- first:
name: _OutlineColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _ReflectFaceColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _ReflectOutlineColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _SpecularColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _UnderlayColor
second: {r: 0, g: 0, b: 0, a: 0.5}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 57627336be55f48c39b4355103768b0d
timeCreated: 1548073314
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,238 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2100000
Material:
serializedVersion: 6
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: Bangers Logo SDF (UITransitionEffect)
m_Shader: {fileID: 4800000, guid: fa7d8d6e393ae4a9b94b2331c7d0097c, type: 3}
m_ShaderKeywords: CUTOFF GLOW_ON
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _BumpMap
second:
m_Texture: {fileID: 2800000, guid: f3133098380a54154a6efe8ad05b5303, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _Cube
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _FaceTex
second:
m_Texture: {fileID: 2800000, guid: 05b6b2f208a9b485795b37fc99d07e64, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MainTex
second:
m_Texture: {fileID: 2800000, guid: bbd344ef7d3cd48deb04e207c034ccb7, type: 2}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MaskTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _NoiseTex
second:
m_Texture: {fileID: 2800000, guid: 3e04c247fb2604af186173fce0bc62de, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _OutlineTex
second:
m_Texture: {fileID: 2800000, guid: 083315c2119934ed6ba70936e2dc07ee, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _Ambient
second: 0.5
- first:
name: _Bevel
second: 0.461
- first:
name: _BevelClamp
second: 0
- first:
name: _BevelOffset
second: -0.09
- first:
name: _BevelRoundness
second: 0.615
- first:
name: _BevelWidth
second: 0.001
- first:
name: _BumpFace
second: 0
- first:
name: _BumpOutline
second: 0
- first:
name: _ColorMask
second: 15
- first:
name: _Diffuse
second: 0.5
- first:
name: _FaceDilate
second: 0.2
- first:
name: _FaceUVSpeedX
second: 0
- first:
name: _FaceUVSpeedY
second: 0
- first:
name: _GlowInner
second: 0.076
- first:
name: _GlowOffset
second: 0.354
- first:
name: _GlowOuter
second: 0.336
- first:
name: _GlowPower
second: 0.75
- first:
name: _GradientScale
second: 11
- first:
name: _LightAngle
second: 3.1416
- first:
name: _MaskSoftnessX
second: 0
- first:
name: _MaskSoftnessY
second: 0
- first:
name: _OutlineSoftness
second: 0
- first:
name: _OutlineUVSpeedX
second: 0
- first:
name: _OutlineUVSpeedY
second: 0
- first:
name: _OutlineWidth
second: 0.4
- first:
name: _PerspectiveFilter
second: 0.875
- first:
name: _Reflectivity
second: 10
- first:
name: _ScaleRatioA
second: 0.90909094
- first:
name: _ScaleRatioB
second: 0.6136364
- first:
name: _ScaleRatioC
second: 0.6136364
- first:
name: _ScaleX
second: 1
- first:
name: _ScaleY
second: 1
- first:
name: _ShaderFlags
second: 0
- first:
name: _SpecularPower
second: 2
- first:
name: _Stencil
second: 0
- first:
name: _StencilComp
second: 8
- first:
name: _StencilOp
second: 0
- first:
name: _StencilReadMask
second: 255
- first:
name: _StencilWriteMask
second: 255
- first:
name: _TextureHeight
second: 1024
- first:
name: _TextureWidth
second: 1024
- first:
name: _UnderlayDilate
second: 0
- first:
name: _UnderlayOffsetX
second: 0
- first:
name: _UnderlayOffsetY
second: 0
- first:
name: _UnderlaySoftness
second: 0
- first:
name: _VertexOffsetX
second: 0
- first:
name: _VertexOffsetY
second: 0
- first:
name: _WeightBold
second: 0.5
- first:
name: _WeightNormal
second: 0
m_Colors:
- first:
name: _ClipRect
second: {r: -10000, g: -10000, b: 10000, a: 10000}
- first:
name: _EnvMatrixRotation
second: {r: 0, g: 0, b: 0, a: 0}
- first:
name: _FaceColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _GlowColor
second: {r: 1, g: 0.6344826, b: 0, a: 0.5019608}
- first:
name: _MaskCoord
second: {r: 0, g: 0, b: 100000, a: 100000}
- first:
name: _OutlineColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _ReflectFaceColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _ReflectOutlineColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _SpecularColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _UnderlayColor
second: {r: 0, g: 0, b: 0, a: 0.5}
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 153ebf4ac9fce4ad9bb92b2184e6cfd0
timeCreated: 1548243985
licenseType: Pro
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
File diff suppressed because one or more lines are too long
@@ -0,0 +1,6 @@
fileFormatVersion: 2
guid: bbd344ef7d3cd48deb04e207c034ccb7
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,496 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2103686
Material:
serializedVersion: 6
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: TextMeshPro/Sprite (UIDissolve)
m_Shader: {fileID: 4800000, guid: 43184227f35f24905865f36834c4fea9, type: 3}
m_ShaderKeywords: ADD GLOW_ON
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _BumpMap
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _Cube
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _FaceTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _MainTex
second:
m_Texture: {fileID: 2800000, guid: 6ec706981a919c3489f0b061a40054e2, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _NoiseTex
second:
m_Texture: {fileID: 2800000, guid: 87e2a5102f952174eb7505e5cff15bda, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _OutlineTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _Ambient
second: 0.5
- first:
name: _Bevel
second: 0.5
- first:
name: _BevelClamp
second: 0
- first:
name: _BevelOffset
second: 0
- first:
name: _BevelRoundness
second: 0
- first:
name: _BevelWidth
second: 0
- first:
name: _BumpFace
second: 0
- first:
name: _BumpOutline
second: 0
- first:
name: _ColorMask
second: 15
- first:
name: _Diffuse
second: 0.5
- first:
name: _FaceDilate
second: 0
- first:
name: _FaceUVSpeedX
second: 0
- first:
name: _FaceUVSpeedY
second: 0
- first:
name: _GlowInner
second: 0.05
- first:
name: _GlowOffset
second: 0
- first:
name: _GlowOuter
second: 0.05
- first:
name: _GlowPower
second: 0.75
- first:
name: _GradientScale
second: 5
- first:
name: _LightAngle
second: 3.1416
- first:
name: _MaskSoftnessX
second: 0
- first:
name: _MaskSoftnessY
second: 0
- first:
name: _OutlineSoftness
second: 0
- first:
name: _OutlineUVSpeedX
second: 0
- first:
name: _OutlineUVSpeedY
second: 0
- first:
name: _OutlineWidth
second: 0
- first:
name: _PerspectiveFilter
second: 0.875
- first:
name: _Reflectivity
second: 10
- first:
name: _ScaleRatioA
second: 1
- first:
name: _ScaleRatioB
second: 1
- first:
name: _ScaleRatioC
second: 1
- first:
name: _ScaleX
second: 1
- first:
name: _ScaleY
second: 1
- first:
name: _ShaderFlags
second: 0
- first:
name: _SpecularPower
second: 2
- first:
name: _Stencil
second: 0
- first:
name: _StencilComp
second: 8
- first:
name: _StencilOp
second: 0
- first:
name: _StencilReadMask
second: 255
- first:
name: _StencilWriteMask
second: 255
- first:
name: _TextureHeight
second: 512
- first:
name: _TextureWidth
second: 512
- first:
name: _UnderlayDilate
second: 0
- first:
name: _UnderlayOffsetX
second: 0
- first:
name: _UnderlayOffsetY
second: 0
- first:
name: _UnderlaySoftness
second: 0
- first:
name: _UseUIAlphaClip
second: 0
- first:
name: _VertexOffsetX
second: 0
- first:
name: _VertexOffsetY
second: 0
- first:
name: _WeightBold
second: 0.5
- first:
name: _WeightNormal
second: 0
m_Colors:
- first:
name: _ClipRect
second: {r: -32767, g: -32767, b: 32767, a: 32767}
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _EnvMatrixRotation
second: {r: 0, g: 0, b: 0, a: 0}
- first:
name: _FaceColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _GlowColor
second: {r: 0, g: 1, b: 0, a: 0.5}
- first:
name: _MaskCoord
second: {r: 0, g: 0, b: 32767, a: 32767}
- first:
name: _OutlineColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _ReflectFaceColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _ReflectOutlineColor
second: {r: 0, g: 0, b: 0, a: 1}
- first:
name: _SpecularColor
second: {r: 1, g: 1, b: 1, a: 1}
- first:
name: _UnderlayColor
second: {r: 0, g: 0, b: 0, a: 0.5}
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 2019389346, guid: 89f0137620f6af44b9ba852b4190e64e, type: 3}
m_Name: EmojiOne (UIDissolve)
m_EditorClassIdentifier:
hashCode: -1836805472
material: {fileID: 2103686}
materialHashCode: 0
spriteSheet: {fileID: 2800000, guid: 6ec706981a919c3489f0b061a40054e2, type: 3}
spriteInfoList:
- id: 0
x: 0
y: 384
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 1f60a
hashCode: 57188336
unicode: 128522
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 1
x: 128
y: 384
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 1f60b
hashCode: 57188339
unicode: 128523
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 2
x: 256
y: 384
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 1f60d
hashCode: 57188341
unicode: 128525
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 3
x: 384
y: 384
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 1f60e
hashCode: 57188340
unicode: 128526
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 4
x: 0
y: 256
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 1f600
hashCode: 57188257
unicode: 128512
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 5
x: 128
y: 256
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 1f601
hashCode: 57188256
unicode: 128513
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 6
x: 256
y: 256
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 1f602
hashCode: 57188259
unicode: 128514
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 7
x: 384
y: 256
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 1f603
hashCode: 57188258
unicode: 128515
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 8
x: 0
y: 128
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 1f604
hashCode: 57188261
unicode: 128516
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 9
x: 128
y: 128
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 1f605
hashCode: 57188260
unicode: 128517
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 10
x: 256
y: 128
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 1f606
hashCode: 57188263
unicode: 128518
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 11
x: 384
y: 128
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 1f609
hashCode: 57188264
unicode: 128521
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 12
x: 0
y: 0
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 1f618
hashCode: 57188168
unicode: 128536
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 13
x: 128
y: 0
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 1f923
hashCode: 57200239
unicode: 129315
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 14
x: 256
y: 0
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 263a
hashCode: 1748406
unicode: 9786
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 15
x: 384
y: 0
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 2639
hashCode: 1748462
unicode: 9785
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
fallbackSpriteAssets: []
--- !u!21 &1369835458
Material:
serializedVersion: 6
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: TextMeshPro/Sprite
m_Shader: {fileID: 4800000, guid: 3a1c68c8292caf046bd21158886c5e40, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs: []
m_Floats: []
m_Colors: []
@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f9e27f43a535c4d9799ea436d3cefae0
timeCreated: 1480316912
licenseType: Store
NativeFormatImporter:
userData:
assetBundleName:
assetBundleVariant:
@@ -0,0 +1,316 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!21 &2103686
Material:
serializedVersion: 6
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: TextMeshPro/Sprite (UIEffect)
m_Shader: {fileID: 4800000, guid: 466007890ce83421082c2d58b0121dcd, type: 3}
m_ShaderKeywords: DETAILBLUR FILL GRAYSCALE
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs:
- first:
name: _MainTex
second:
m_Texture: {fileID: 2800000, guid: 6ec706981a919c3489f0b061a40054e2, type: 3}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- first:
name: _NoiseTex
second:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Floats:
- first:
name: _ColorMask
second: 15
- first:
name: _Stencil
second: 0
- first:
name: _StencilComp
second: 8
- first:
name: _StencilOp
second: 0
- first:
name: _StencilReadMask
second: 255
- first:
name: _StencilWriteMask
second: 255
- first:
name: _UseUIAlphaClip
second: 0
m_Colors:
- first:
name: _ClipRect
second: {r: -32767, g: -32767, b: 32767, a: 32767}
- first:
name: _Color
second: {r: 1, g: 1, b: 1, a: 1}
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 2019389346, guid: 89f0137620f6af44b9ba852b4190e64e, type: 3}
m_Name: EmojiOne (UIEffect)
m_EditorClassIdentifier:
hashCode: -1836805472
material: {fileID: 2103686}
materialHashCode: 0
spriteSheet: {fileID: 2800000, guid: 6ec706981a919c3489f0b061a40054e2, type: 3}
spriteInfoList:
- id: 0
x: 0
y: 384
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 1f60a
hashCode: 57188336
unicode: 128522
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 1
x: 128
y: 384
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 1f60b
hashCode: 57188339
unicode: 128523
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 2
x: 256
y: 384
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 1f60d
hashCode: 57188341
unicode: 128525
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 3
x: 384
y: 384
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 1f60e
hashCode: 57188340
unicode: 128526
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 4
x: 0
y: 256
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 1f600
hashCode: 57188257
unicode: 128512
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 5
x: 128
y: 256
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 1f601
hashCode: 57188256
unicode: 128513
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 6
x: 256
y: 256
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 1f602
hashCode: 57188259
unicode: 128514
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 7
x: 384
y: 256
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 1f603
hashCode: 57188258
unicode: 128515
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 8
x: 0
y: 128
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 1f604
hashCode: 57188261
unicode: 128516
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 9
x: 128
y: 128
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 1f605
hashCode: 57188260
unicode: 128517
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 10
x: 256
y: 128
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 1f606
hashCode: 57188263
unicode: 128518
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 11
x: 384
y: 128
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 1f609
hashCode: 57188264
unicode: 128521
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 12
x: 0
y: 0
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 1f618
hashCode: 57188168
unicode: 128536
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 13
x: 128
y: 0
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 1f923
hashCode: 57200239
unicode: 129315
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 14
x: 256
y: 0
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 263a
hashCode: 1748406
unicode: 9786
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
- id: 15
x: 384
y: 0
width: 128
height: 128
xOffset: 0
yOffset: 115.6
xAdvance: 128
scale: 1
name: 2639
hashCode: 1748462
unicode: 9785
pivot: {x: 0.5, y: 0.5}
sprite: {fileID: 0}
fallbackSpriteAssets: []
--- !u!21 &1369835458
Material:
serializedVersion: 6
m_ObjectHideFlags: 1
m_PrefabParentObject: {fileID: 0}
m_PrefabInternal: {fileID: 0}
m_Name: TextMeshPro/Sprite
m_Shader: {fileID: 4800000, guid: 3a1c68c8292caf046bd21158886c5e40, type: 3}
m_ShaderKeywords:
m_LightmapFlags: 5
m_CustomRenderQueue: -1
stringTagMap: {}
m_SavedProperties:
serializedVersion: 2
m_TexEnvs: []
m_Floats: []
m_Colors: []

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