diff --git a/.gitignore b/.gitignore
index f1f5e64..036465e 100644
--- a/.gitignore
+++ b/.gitignore
@@ -81,3 +81,6 @@ crashlytics-build.properties
/UI参考
/AGENTS.md
+/bin
+
+~$*.xlsx
diff --git a/Assets/GameFramework/Scripts/Editor/Inspector/BaseComponentInspector.cs b/Assets/GameFramework/Scripts/Editor/Inspector/BaseComponentInspector.cs
index 65d3792..328d8be 100644
--- a/Assets/GameFramework/Scripts/Editor/Inspector/BaseComponentInspector.cs
+++ b/Assets/GameFramework/Scripts/Editor/Inspector/BaseComponentInspector.cs
@@ -104,7 +104,7 @@ namespace UnityGameFramework.Editor
}
EditorGUI.EndDisabledGroup();
- int frameRate = EditorGUILayout.IntSlider("Frame Rate", m_FrameRate.intValue, 1, 120);
+ int frameRate = EditorGUILayout.IntSlider("Frame Rate", m_FrameRate.intValue, 1, 240);
if (frameRate != m_FrameRate.intValue)
{
if (EditorApplication.isPlaying)
diff --git a/Assets/GameFramework/Scripts/Runtime/Debugger/DebuggerComponent.ScreenInformationWindow.cs b/Assets/GameFramework/Scripts/Runtime/Debugger/DebuggerComponent.ScreenInformationWindow.cs
index 5c516c1..5f8b614 100644
--- a/Assets/GameFramework/Scripts/Runtime/Debugger/DebuggerComponent.ScreenInformationWindow.cs
+++ b/Assets/GameFramework/Scripts/Runtime/Debugger/DebuggerComponent.ScreenInformationWindow.cs
@@ -66,7 +66,7 @@ namespace UnityGameFramework.Runtime
private string GetResolutionString(Resolution resolution)
{
- return Utility.Text.Format("{0} x {1} @ {2}Hz", resolution.width, resolution.height, resolution.refreshRate);
+ return Utility.Text.Format("{0} x {1} @ {2}Hz", resolution.width, resolution.height, resolution.refreshRateRatio);
}
private string GetCutoutsString(Rect[] cutouts)
diff --git a/Assets/GameMain/Configs/ResourceBuilder.xml b/Assets/GameMain/Configs/ResourceBuilder.xml
index 8e0b951..2a0c5c7 100644
--- a/Assets/GameMain/Configs/ResourceBuilder.xml
+++ b/Assets/GameMain/Configs/ResourceBuilder.xml
@@ -2,14 +2,14 @@
- 0
- 1
+ 1
+ 33
1
UnityGameFramework.Runtime.DefaultCompressionHelper
True
False
StarForce.Editor.StarForceBuildEventHandler
-
+ D:/Learn/GameLearn/UnityProjects/VampireLike/bin/AssetBundles
True
True
True
diff --git a/Assets/GameMain/Configs/ResourceCollection.xml b/Assets/GameMain/Configs/ResourceCollection.xml
index b5987c3..5ad3660 100644
--- a/Assets/GameMain/Configs/ResourceCollection.xml
+++ b/Assets/GameMain/Configs/ResourceCollection.xml
@@ -16,43 +16,56 @@
+
+
+
+
+
-
-
+
+
-
-
+
+
+
+
+
+
-
+
+
+
+
+
@@ -62,97 +75,120 @@
+
+
+
-
+
-
+
+
+
-
+
+
+
+
+
+
-
+
-
+
+
+
+
-
-
-
-
-
+
+
+
-
+
-
-
-
+
-
+
+
+
+
+
-
-
+
-
-
+
+
+
+
+
+
+
-
+
+
+
+
+
+
-
+
+
+
+
-
-
\ No newline at end of file
diff --git a/Assets/GameMain/DataTables/Enemy.txt b/Assets/GameMain/DataTables/Enemy.txt
index 7ca14d2..2bcad84 100644
--- a/Assets/GameMain/DataTables/Enemy.txt
+++ b/Assets/GameMain/DataTables/Enemy.txt
@@ -1,5 +1,5 @@
-# 敌人基础属性表
-# Id MaxHealth Speed CoinDrop ExpDrop DropPercent
-# int int float int int float
-# 实体编号 策划备注 最大生命 移动速度 金币掉落 经验掉落 掉落概率
- 101 近战敌人 20 3 2 1 0.3
+# 敌人基础属性表
+# Id MaxHealth HpAddPerLevel Speed CoinDrop ExpDrop DropPercent
+# int int int float int int float
+# 实体编号 策划备注 最大生命 每关卡增加生命 移动速度 金币掉落 经验掉落 掉落概率
+ 101 近战敌人 50 50 3 5 1 0.3
diff --git a/Assets/GameMain/DataTables/LevelRarity.txt b/Assets/GameMain/DataTables/LevelRarity.txt
new file mode 100644
index 0000000..6cc8c8f
--- /dev/null
+++ b/Assets/GameMain/DataTables/LevelRarity.txt
@@ -0,0 +1,7 @@
+# 关卡道具品质掉落概率表
+# Id LevelMin LevelMax WhiteWeight GreenWeight BlueWeight PurpleWeight RedWeight SumWeight
+# int float float float float float float float float
+# 概率编号 策划备注 关卡左区间 关卡右区间 白色掉落率 绿色掉落率 蓝色掉落率 紫色掉落率 红色掉落率 总掉落率(不需要读取)
+ 1 1 3 75 20 4 1 0 100
+ 2 4 5 30 50 15 4 1 100
+ 3 6 10 10 20 40 20 10 100
diff --git a/Assets/GameMain/DataTables/LevelRarity.txt.meta b/Assets/GameMain/DataTables/LevelRarity.txt.meta
new file mode 100644
index 0000000..422c335
--- /dev/null
+++ b/Assets/GameMain/DataTables/LevelRarity.txt.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 0080b46050fc460cb6d6c7fc8d4e8c27
+TextScriptImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/GameMain/DataTables/LevelUpReward.txt b/Assets/GameMain/DataTables/LevelUpReward.txt
index b2eb50e..a746f00 100644
--- a/Assets/GameMain/DataTables/LevelUpReward.txt
+++ b/Assets/GameMain/DataTables/LevelUpReward.txt
@@ -1,8 +1,22 @@
-# 道具表
-# Id Title IconAssetName Modifiers
-# int string string StatModifier[]
-# 奖励编号 策划备注 奖励名 图标资源名 道具属性
- 101 测试道具 肌肉 Almighty_Icon [{"StatType":"Attack","Value":0.05,"IsPercent":true}]
- 102 牙齿 Almighty_Icon [{"StatType":"Attack","Value":0.05,"IsPercent":true}]
- 103 脑 Almighty_Icon [{"StatType":"Attack","Value":0.05,"IsPercent":true}]
- 104 鼻子 Almighty_Icon [{"StatType":"Attack","Value":0.05,"IsPercent":true}]
+# 道具表
+# Id Title IconAssetName Rarity Modifiers
+# int string string RarityType StatModifier[]
+# 奖励编号 策划备注 奖励名 图标资源名 道具品质 道具属性
+ 101 测试道具 肌肉 Almighty_Icon White [{"StatType":"Attack","Value":0.05,"IsPercent":true}]
+ 102 牙齿 Almighty_Icon White [{"StatType":"Attack","Value":0.05,"IsPercent":true}]
+ 103 脑 Almighty_Icon White [{"StatType":"Critical","Value":0.05,"IsPercent":true}]
+ 104 鼻子 Almighty_Icon White [{"StatType":"AbsorbRange","Value":0.05,"IsPercent":true}]
+ 105 腿 Almighty_Icon White [{"StatType":"MovementSpeed","Value":0.05,"IsPercent":true}]
+ 106 眼睛 Almighty_Icon White [{"StatType":"MaxHealth","Value":0.05,"IsPercent":true}]
+ 107 肌肉 Almighty_Icon Green [{"StatType":"Attack","Value":0.15,"IsPercent":true}]
+ 108 牙齿 Almighty_Icon Green [{"StatType":"Attack","Value":0.15,"IsPercent":true}]
+ 109 脑 Almighty_Icon Green [{"StatType":"Critical","Value":0.15,"IsPercent":true}]
+ 110 鼻子 Almighty_Icon Green [{"StatType":"AbsorbRange","Value":0.15,"IsPercent":true}]
+ 111 腿 Almighty_Icon Green [{"StatType":"MovementSpeed","Value":0.15,"IsPercent":true}]
+ 112 眼睛 Almighty_Icon Green [{"StatType":"MaxHealth","Value":0.15,"IsPercent":true}]
+ 113 肌肉 Almighty_Icon Blue [{"StatType":"Attack","Value":0.3,"IsPercent":true}]
+ 114 牙齿 Almighty_Icon Blue [{"StatType":"Attack","Value":0.3,"IsPercent":true}]
+ 115 脑 Almighty_Icon Blue [{"StatType":"Critical","Value":0.3,"IsPercent":true}]
+ 116 鼻子 Almighty_Icon Blue [{"StatType":"AbsorbRange","Value":0.3,"IsPercent":true}]
+ 117 腿 Almighty_Icon Blue [{"StatType":"MovementSpeed","Value":0.3,"IsPercent":true}]
+ 118 眼睛 Almighty_Icon Blue [{"StatType":"MaxHealth","Value":0.3,"IsPercent":true}]
diff --git a/Assets/GameMain/DataTables/Weapon.txt b/Assets/GameMain/DataTables/Weapon.txt
index 8e6d608..9e072dd 100644
--- a/Assets/GameMain/DataTables/Weapon.txt
+++ b/Assets/GameMain/DataTables/Weapon.txt
@@ -2,5 +2,5 @@
# Id Title IconAssetName Rarity Price PriceRandomPercent Attack Cooldown AttackRange AttackSoundId Pramas Modifiers
# int string string RarityType int float int float float int string[] StatModifier[]
# 武器编号 策划备注 武器名 图标资源名 道具品质 武器价格 价格浮动 伤害 冷却 范围 攻击音效编号 额外参数 额外属性
- 201 玩家武器 小刀 Almighty_Icon White 120 0.05 100 1.5 3 10000 [] []
- 202 手枪 Almighty_Icon White 130 0.05 120 1 10 10000 [] []
+ 201 玩家武器 小刀 Almighty_Icon White 120 0.05 100 1.5 5 10000 [] []
+ 202 手枪 Almighty_Icon White 130 0.05 120 1 15 10000 [] []
diff --git a/Assets/GameMain/Entities/MeleeEnemy.prefab b/Assets/GameMain/Entities/MeleeEnemy.prefab
index d1f7662..4c3a5ed 100644
--- a/Assets/GameMain/Entities/MeleeEnemy.prefab
+++ b/Assets/GameMain/Entities/MeleeEnemy.prefab
@@ -65,7 +65,7 @@ MeshRenderer:
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- - {fileID: 2100000, guid: 28c42f88cfe56e84e95c0d7545db8c1b, type: 2}
+ - {fileID: 2100000, guid: 83e5fce2d1e5b3e4ab6551de03cc9c22, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
diff --git a/Assets/GameMain/Entities/Player.prefab b/Assets/GameMain/Entities/Player.prefab
index aeeb24a..a260094 100644
--- a/Assets/GameMain/Entities/Player.prefab
+++ b/Assets/GameMain/Entities/Player.prefab
@@ -369,6 +369,7 @@ GameObject:
- component: {fileID: 582203051508165858}
- component: {fileID: 4988822728923805024}
- component: {fileID: 4321355627424240428}
+ - component: {fileID: 7894423710682551789}
m_Layer: 7
m_Name: Player
m_TagString: Player
@@ -421,7 +422,7 @@ MeshRenderer:
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- - {fileID: 2100000, guid: 31321ba15b8f8eb4c954353edc038b1d, type: 2}
+ - {fileID: 2100000, guid: c4f37184fcb9306428d7d002f7dca96d, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
@@ -566,3 +567,22 @@ MonoBehaviour:
- {fileID: 4149661712638700245}
- {fileID: 5429551983429523606}
- {fileID: 2395797268595685132}
+--- !u!114 &7894423710682551789
+MonoBehaviour:
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 8198962528757305497}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: 46f46350fed64d8389ebb4ae72b65796, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ _absorbRangeBase: 3
+ _absorbSpeed: 8
+ _collectDistance: 0.35
+ _maxDetectCount: 64
+ _detectLayerMask:
+ serializedVersion: 2
+ m_Bits: 8192
diff --git a/Assets/GameMain/Entities/RemoteEnemy.prefab b/Assets/GameMain/Entities/RemoteEnemy.prefab
index 7bdd32a..06f7b4b 100644
--- a/Assets/GameMain/Entities/RemoteEnemy.prefab
+++ b/Assets/GameMain/Entities/RemoteEnemy.prefab
@@ -64,7 +64,7 @@ MeshRenderer:
m_RenderingLayerMask: 1
m_RendererPriority: 0
m_Materials:
- - {fileID: 2100000, guid: 2257393dd6ed51a49a6c3fd178382b59, type: 2}
+ - {fileID: 2100000, guid: 429ed03405bf8854eab46552b7470ac0, type: 2}
m_StaticBatchInfo:
firstSubMesh: 0
subMeshCount: 0
diff --git a/Assets/GameMain/Scenes/StressTest.meta b/Assets/GameMain/Fonts/Shaders.meta
similarity index 77%
rename from Assets/GameMain/Scenes/StressTest.meta
rename to Assets/GameMain/Fonts/Shaders.meta
index a8221dc..e6d5003 100644
--- a/Assets/GameMain/Scenes/StressTest.meta
+++ b/Assets/GameMain/Fonts/Shaders.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: d278c30ab68ad1e4b8c981c2ffe9473e
+guid: 9dc75a5d11c10e94c9d5ed1176388036
folderAsset: yes
DefaultImporter:
externalObjects: {}
diff --git a/Assets/GameMain/Fonts/Shaders/TMP_Bitmap-Custom-Atlas.shader b/Assets/GameMain/Fonts/Shaders/TMP_Bitmap-Custom-Atlas.shader
new file mode 100644
index 0000000..bab2b2c
--- /dev/null
+++ b/Assets/GameMain/Fonts/Shaders/TMP_Bitmap-Custom-Atlas.shader
@@ -0,0 +1,143 @@
+Shader "TextMeshPro/Bitmap Custom Atlas" {
+
+Properties {
+ _MainTex ("Font Atlas", 2D) = "white" {}
+ _FaceTex ("Font Texture", 2D) = "white" {}
+ [HDR]_FaceColor ("Text Color", Color) = (1,1,1,1)
+
+ _VertexOffsetX ("Vertex OffsetX", float) = 0
+ _VertexOffsetY ("Vertex OffsetY", float) = 0
+ _MaskSoftnessX ("Mask SoftnessX", float) = 0
+ _MaskSoftnessY ("Mask SoftnessY", float) = 0
+
+ _ClipRect("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
+ _Padding ("Padding", float) = 0
+
+ _StencilComp("Stencil Comparison", Float) = 8
+ _Stencil("Stencil ID", Float) = 0
+ _StencilOp("Stencil Operation", Float) = 0
+ _StencilWriteMask("Stencil Write Mask", Float) = 255
+ _StencilReadMask("Stencil Read Mask", Float) = 255
+
+ _CullMode("Cull Mode", Float) = 0
+ _ColorMask("Color Mask", Float) = 15
+}
+
+SubShader{
+
+ Tags { "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" }
+
+ Stencil
+ {
+ Ref[_Stencil]
+ Comp[_StencilComp]
+ Pass[_StencilOp]
+ ReadMask[_StencilReadMask]
+ WriteMask[_StencilWriteMask]
+ }
+
+
+ Lighting Off
+ Cull [_CullMode]
+ ZTest [unity_GUIZTestMode]
+ ZWrite Off
+ Fog { Mode Off }
+ Blend SrcAlpha OneMinusSrcAlpha
+ ColorMask[_ColorMask]
+
+ Pass {
+ CGPROGRAM
+ #pragma vertex vert
+ #pragma fragment frag
+
+ #pragma multi_compile __ UNITY_UI_CLIP_RECT
+ #pragma multi_compile __ UNITY_UI_ALPHACLIP
+
+
+ #include "UnityCG.cginc"
+
+ struct appdata_t {
+ float4 vertex : POSITION;
+ fixed4 color : COLOR;
+ float2 texcoord0 : TEXCOORD0;
+ float2 texcoord1 : TEXCOORD1;
+ };
+
+ struct v2f {
+ float4 vertex : SV_POSITION;
+ fixed4 color : COLOR;
+ float2 texcoord0 : TEXCOORD0;
+ float2 texcoord1 : TEXCOORD1;
+ float4 mask : TEXCOORD2;
+ };
+
+ uniform sampler2D _MainTex;
+ uniform sampler2D _FaceTex;
+ uniform float4 _FaceTex_ST;
+ uniform fixed4 _FaceColor;
+
+ uniform float _VertexOffsetX;
+ uniform float _VertexOffsetY;
+ uniform float4 _ClipRect;
+ uniform float _MaskSoftnessX;
+ uniform float _MaskSoftnessY;
+
+ float2 UnpackUV(float uv)
+ {
+ float2 output;
+ output.x = floor(uv / 4096);
+ output.y = uv - 4096 * output.x;
+
+ return output * 0.001953125;
+ }
+
+ v2f vert (appdata_t v)
+ {
+ float4 vert = v.vertex;
+ vert.x += _VertexOffsetX;
+ vert.y += _VertexOffsetY;
+
+ vert.xy += (vert.w * 0.5) / _ScreenParams.xy;
+
+ float4 vPosition = UnityPixelSnap(UnityObjectToClipPos(vert));
+
+ fixed4 faceColor = v.color;
+ faceColor *= _FaceColor;
+
+ v2f OUT;
+ OUT.vertex = vPosition;
+ OUT.color = faceColor;
+ OUT.texcoord0 = v.texcoord0;
+ OUT.texcoord1 = TRANSFORM_TEX(UnpackUV(v.texcoord1), _FaceTex);
+ float2 pixelSize = vPosition.w;
+ pixelSize /= abs(float2(_ScreenParams.x * UNITY_MATRIX_P[0][0], _ScreenParams.y * UNITY_MATRIX_P[1][1]));
+
+ // Clamp _ClipRect to 16bit.
+ float4 clampedRect = clamp(_ClipRect, -2e10, 2e10);
+ OUT.mask = float4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy));
+
+ return OUT;
+ }
+
+ fixed4 frag (v2f IN) : SV_Target
+ {
+ fixed4 color = tex2D(_MainTex, IN.texcoord0) * tex2D(_FaceTex, IN.texcoord1) * IN.color;
+
+ // Alternative implementation to UnityGet2DClipping with support for softness.
+ #if UNITY_UI_CLIP_RECT
+ half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(IN.mask.xy)) * IN.mask.zw);
+ color *= m.x * m.y;
+ #endif
+
+ #if UNITY_UI_ALPHACLIP
+ clip(color.a - 0.001);
+ #endif
+
+ return color;
+ }
+ ENDCG
+ }
+}
+
+ CustomEditor "TMPro.EditorUtilities.TMP_BitmapShaderGUI"
+}
diff --git a/Assets/GameMain/Fonts/Shaders/TMP_Bitmap-Custom-Atlas.shader.meta b/Assets/GameMain/Fonts/Shaders/TMP_Bitmap-Custom-Atlas.shader.meta
new file mode 100644
index 0000000..a0e6fef
--- /dev/null
+++ b/Assets/GameMain/Fonts/Shaders/TMP_Bitmap-Custom-Atlas.shader.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: b6539f2b0fa989d4fb7e057799b9260d
+ShaderImporter:
+ externalObjects: {}
+ defaultTextures: []
+ nonModifiableTextures: []
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/GameMain/Fonts/Shaders/TMP_Bitmap-Mobile.shader b/Assets/GameMain/Fonts/Shaders/TMP_Bitmap-Mobile.shader
new file mode 100644
index 0000000..006a271
--- /dev/null
+++ b/Assets/GameMain/Fonts/Shaders/TMP_Bitmap-Mobile.shader
@@ -0,0 +1,145 @@
+Shader "TextMeshPro/Mobile/Bitmap" {
+
+Properties {
+ _MainTex ("Font Atlas", 2D) = "white" {}
+ [HDR]_Color ("Text Color", Color) = (1,1,1,1)
+ _DiffusePower ("Diffuse Power", Range(1.0,4.0)) = 1.0
+
+ _VertexOffsetX("Vertex OffsetX", float) = 0
+ _VertexOffsetY("Vertex OffsetY", float) = 0
+ _MaskSoftnessX("Mask SoftnessX", float) = 0
+ _MaskSoftnessY("Mask SoftnessY", float) = 0
+
+ _ClipRect("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
+
+ _StencilComp("Stencil Comparison", Float) = 8
+ _Stencil("Stencil ID", Float) = 0
+ _StencilOp("Stencil Operation", Float) = 0
+ _StencilWriteMask("Stencil Write Mask", Float) = 255
+ _StencilReadMask("Stencil Read Mask", Float) = 255
+
+ _CullMode("Cull Mode", Float) = 0
+ _ColorMask("Color Mask", Float) = 15
+}
+
+SubShader {
+
+ Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
+
+ Stencil
+ {
+ Ref[_Stencil]
+ Comp[_StencilComp]
+ Pass[_StencilOp]
+ ReadMask[_StencilReadMask]
+ WriteMask[_StencilWriteMask]
+ }
+
+
+ Lighting Off
+ Cull [_CullMode]
+ ZTest [unity_GUIZTestMode]
+ ZWrite Off
+ Fog { Mode Off }
+ Blend SrcAlpha OneMinusSrcAlpha
+ ColorMask[_ColorMask]
+
+ Pass {
+ CGPROGRAM
+ #pragma vertex vert
+ #pragma fragment frag
+ #pragma fragmentoption ARB_precision_hint_fastest
+
+ #pragma multi_compile __ UNITY_UI_CLIP_RECT
+ #pragma multi_compile __ UNITY_UI_ALPHACLIP
+
+
+ #include "UnityCG.cginc"
+
+ struct appdata_t {
+ float4 vertex : POSITION;
+ fixed4 color : COLOR;
+ float2 texcoord0 : TEXCOORD0;
+ float2 texcoord1 : TEXCOORD1;
+ };
+
+ struct v2f {
+ float4 vertex : POSITION;
+ fixed4 color : COLOR;
+ float2 texcoord0 : TEXCOORD0;
+ float4 mask : TEXCOORD2;
+ };
+
+ sampler2D _MainTex;
+ fixed4 _Color;
+ float _DiffusePower;
+
+ uniform float _VertexOffsetX;
+ uniform float _VertexOffsetY;
+ uniform float4 _ClipRect;
+ uniform float _MaskSoftnessX;
+ uniform float _MaskSoftnessY;
+
+ v2f vert (appdata_t v)
+ {
+ v2f OUT;
+ float4 vert = v.vertex;
+ vert.x += _VertexOffsetX;
+ vert.y += _VertexOffsetY;
+
+ vert.xy += (vert.w * 0.5) / _ScreenParams.xy;
+
+ OUT.vertex = UnityPixelSnap(UnityObjectToClipPos(vert));
+ OUT.color = v.color;
+ OUT.color *= _Color;
+ OUT.color.rgb *= _DiffusePower;
+ OUT.texcoord0 = v.texcoord0;
+
+ float2 pixelSize = OUT.vertex.w;
+ //pixelSize /= abs(float2(_ScreenParams.x * UNITY_MATRIX_P[0][0], _ScreenParams.y * UNITY_MATRIX_P[1][1]));
+
+ // Clamp _ClipRect to 16bit.
+ float4 clampedRect = clamp(_ClipRect, -2e10, 2e10);
+ OUT.mask = float4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy));
+
+ return OUT;
+ }
+
+ fixed4 frag (v2f IN) : COLOR
+ {
+ fixed4 color = fixed4(IN.color.rgb, IN.color.a * tex2D(_MainTex, IN.texcoord0).a);
+
+ // Alternative implementation to UnityGet2DClipping with support for softness.
+ #if UNITY_UI_CLIP_RECT
+ half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(IN.mask.xy)) * IN.mask.zw);
+ color *= m.x * m.y;
+ #endif
+
+ #if UNITY_UI_ALPHACLIP
+ clip(color.a - 0.001);
+ #endif
+
+ return color;
+ }
+ ENDCG
+ }
+}
+
+SubShader {
+ Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
+ Lighting Off Cull Off ZTest Always ZWrite Off Fog { Mode Off }
+ Blend SrcAlpha OneMinusSrcAlpha
+ BindChannels {
+ Bind "Color", color
+ Bind "Vertex", vertex
+ Bind "TexCoord", texcoord0
+ }
+ Pass {
+ SetTexture [_MainTex] {
+ constantColor [_Color] combine constant * primary, constant * texture
+ }
+ }
+}
+
+CustomEditor "TMPro.EditorUtilities.TMP_BitmapShaderGUI"
+}
diff --git a/Assets/GameMain/Fonts/Shaders/TMP_Bitmap-Mobile.shader.meta b/Assets/GameMain/Fonts/Shaders/TMP_Bitmap-Mobile.shader.meta
new file mode 100644
index 0000000..51ef45d
--- /dev/null
+++ b/Assets/GameMain/Fonts/Shaders/TMP_Bitmap-Mobile.shader.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: f06c2627a191cc1468383483fbafca04
+ShaderImporter:
+ externalObjects: {}
+ defaultTextures: []
+ nonModifiableTextures: []
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/GameMain/Fonts/Shaders/TMP_Bitmap.shader b/Assets/GameMain/Fonts/Shaders/TMP_Bitmap.shader
new file mode 100644
index 0000000..8ce4937
--- /dev/null
+++ b/Assets/GameMain/Fonts/Shaders/TMP_Bitmap.shader
@@ -0,0 +1,143 @@
+Shader "TextMeshPro/Bitmap" {
+
+Properties {
+ _MainTex ("Font Atlas", 2D) = "white" {}
+ _FaceTex ("Font Texture", 2D) = "white" {}
+ [HDR]_FaceColor ("Text Color", Color) = (1,1,1,1)
+
+ _VertexOffsetX ("Vertex OffsetX", float) = 0
+ _VertexOffsetY ("Vertex OffsetY", float) = 0
+ _MaskSoftnessX ("Mask SoftnessX", float) = 0
+ _MaskSoftnessY ("Mask SoftnessY", float) = 0
+
+ _ClipRect("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
+
+ _StencilComp("Stencil Comparison", Float) = 8
+ _Stencil("Stencil ID", Float) = 0
+ _StencilOp("Stencil Operation", Float) = 0
+ _StencilWriteMask("Stencil Write Mask", Float) = 255
+ _StencilReadMask("Stencil Read Mask", Float) = 255
+
+ _CullMode("Cull Mode", Float) = 0
+ _ColorMask("Color Mask", Float) = 15
+}
+
+SubShader{
+
+ Tags { "Queue" = "Transparent" "IgnoreProjector" = "True" "RenderType" = "Transparent" }
+
+ Stencil
+ {
+ Ref[_Stencil]
+ Comp[_StencilComp]
+ Pass[_StencilOp]
+ ReadMask[_StencilReadMask]
+ WriteMask[_StencilWriteMask]
+ }
+
+
+ Lighting Off
+ Cull [_CullMode]
+ ZTest [unity_GUIZTestMode]
+ ZWrite Off
+ Fog { Mode Off }
+ Blend SrcAlpha OneMinusSrcAlpha
+ ColorMask[_ColorMask]
+
+ Pass {
+ CGPROGRAM
+ #pragma vertex vert
+ #pragma fragment frag
+
+ #pragma multi_compile __ UNITY_UI_CLIP_RECT
+ #pragma multi_compile __ UNITY_UI_ALPHACLIP
+
+
+ #include "UnityCG.cginc"
+
+ struct appdata_t {
+ float4 vertex : POSITION;
+ fixed4 color : COLOR;
+ float2 texcoord0 : TEXCOORD0;
+ float2 texcoord1 : TEXCOORD1;
+ };
+
+ struct v2f {
+ float4 vertex : SV_POSITION;
+ fixed4 color : COLOR;
+ float2 texcoord0 : TEXCOORD0;
+ float2 texcoord1 : TEXCOORD1;
+ float4 mask : TEXCOORD2;
+ };
+
+ uniform sampler2D _MainTex;
+ uniform sampler2D _FaceTex;
+ uniform float4 _FaceTex_ST;
+ uniform fixed4 _FaceColor;
+
+ uniform float _VertexOffsetX;
+ uniform float _VertexOffsetY;
+ uniform float4 _ClipRect;
+ uniform float _MaskSoftnessX;
+ uniform float _MaskSoftnessY;
+
+ float2 UnpackUV(float uv)
+ {
+ float2 output;
+ output.x = floor(uv / 4096);
+ output.y = uv - 4096 * output.x;
+
+ return output * 0.001953125;
+ }
+
+ v2f vert (appdata_t v)
+ {
+ float4 vert = v.vertex;
+ vert.x += _VertexOffsetX;
+ vert.y += _VertexOffsetY;
+
+ vert.xy += (vert.w * 0.5) / _ScreenParams.xy;
+
+ float4 vPosition = UnityPixelSnap(UnityObjectToClipPos(vert));
+
+ fixed4 faceColor = v.color;
+ faceColor *= _FaceColor;
+
+ v2f OUT;
+ OUT.vertex = vPosition;
+ OUT.color = faceColor;
+ OUT.texcoord0 = v.texcoord0;
+ OUT.texcoord1 = TRANSFORM_TEX(UnpackUV(v.texcoord1), _FaceTex);
+ float2 pixelSize = vPosition.w;
+ pixelSize /= abs(float2(_ScreenParams.x * UNITY_MATRIX_P[0][0], _ScreenParams.y * UNITY_MATRIX_P[1][1]));
+
+ // Clamp _ClipRect to 16bit.
+ float4 clampedRect = clamp(_ClipRect, -2e10, 2e10);
+ OUT.mask = float4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy));
+
+ return OUT;
+ }
+
+ fixed4 frag (v2f IN) : SV_Target
+ {
+ fixed4 color = tex2D(_MainTex, IN.texcoord0);
+ color = fixed4 (tex2D(_FaceTex, IN.texcoord1).rgb * IN.color.rgb, IN.color.a * color.a);
+
+ // Alternative implementation to UnityGet2DClipping with support for softness.
+ #if UNITY_UI_CLIP_RECT
+ half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(IN.mask.xy)) * IN.mask.zw);
+ color *= m.x * m.y;
+ #endif
+
+ #if UNITY_UI_ALPHACLIP
+ clip(color.a - 0.001);
+ #endif
+
+ return color;
+ }
+ ENDCG
+ }
+}
+
+ CustomEditor "TMPro.EditorUtilities.TMP_BitmapShaderGUI"
+}
diff --git a/Assets/GameMain/Fonts/Shaders/TMP_Bitmap.shader.meta b/Assets/GameMain/Fonts/Shaders/TMP_Bitmap.shader.meta
new file mode 100644
index 0000000..f1e8c9b
--- /dev/null
+++ b/Assets/GameMain/Fonts/Shaders/TMP_Bitmap.shader.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 6a58ea03d3bd54e428d969b85afa5680
+ShaderImporter:
+ externalObjects: {}
+ defaultTextures: []
+ nonModifiableTextures: []
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/GameMain/Fonts/Shaders/TMP_SDF Overlay.shader b/Assets/GameMain/Fonts/Shaders/TMP_SDF Overlay.shader
new file mode 100644
index 0000000..c50c593
--- /dev/null
+++ b/Assets/GameMain/Fonts/Shaders/TMP_SDF Overlay.shader
@@ -0,0 +1,317 @@
+Shader "TextMeshPro/Distance Field Overlay" {
+
+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
+ [HDR]_FaceColor ("Face Color", Color) = (1,1,1,1)
+ _FaceDilate ("Face Dilate", Range(-1,1)) = 0
+
+ [HDR]_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(0,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
+ [HDR]_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)
+
+
+ [HDR]_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
+
+ [HDR]_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
+ _Sharpness ("Sharpness", Range(-1,1)) = 0
+
+ _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
+
+ _CullMode ("Cull Mode", Float) = 0
+ _ColorMask ("Color Mask", Float) = 15
+}
+
+SubShader {
+
+ Tags
+ {
+ "Queue"="Overlay"
+ "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 Always
+ Blend One OneMinusSrcAlpha
+ ColorMask [_ColorMask]
+
+ Pass {
+ CGPROGRAM
+ #pragma target 3.0
+ #pragma vertex VertShader
+ #pragma fragment PixShader
+ #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 "TMPro_Properties.cginc"
+ #include "TMPro.cginc"
+
+ struct vertex_t {
+ UNITY_VERTEX_INPUT_INSTANCE_ID
+ float4 position : POSITION;
+ float3 normal : NORMAL;
+ fixed4 color : COLOR;
+ float2 texcoord0 : TEXCOORD0;
+ float2 texcoord1 : TEXCOORD1;
+ };
+
+
+ struct pixel_t {
+ UNITY_VERTEX_INPUT_INSTANCE_ID
+ UNITY_VERTEX_OUTPUT_STEREO
+ 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;
+ };
+
+ // Used by Unity internally to handle Texture Tiling and Offset.
+ float4 _FaceTex_ST;
+ float4 _OutlineTex_ST;
+
+ pixel_t VertShader(vertex_t input)
+ {
+ pixel_t output;
+
+ UNITY_INITIALIZE_OUTPUT(pixel_t, output);
+ UNITY_SETUP_INSTANCE_ID(input);
+ UNITY_TRANSFER_INSTANCE_ID(input,output);
+ UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
+
+ 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 * (_Sharpness + 1);
+ 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);
+
+
+ output.position = vPosition;
+ output.color = input.color;
+ output.atlas = input.texcoord0;
+ output.param = float4(alphaClip, scale, bias, weight);
+ output.mask = half4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy));
+ output.viewDir = mul((float3x3)_EnvMatrix, _WorldSpaceCameraPos.xyz - mul(unity_ObjectToWorld, vert).xyz);
+ #if (UNDERLAY_ON || UNDERLAY_INNER)
+ output.texcoord2 = float4(input.texcoord0 + bOffset, bScale, bBias);
+ output.underlayColor = underlayColor;
+ #endif
+ output.textures = float4(faceUV, outlineUV);
+
+ return output;
+ }
+
+
+ fixed4 PixShader(pixel_t input) : SV_Target
+ {
+ UNITY_SETUP_INSTANCE_ID(input);
+
+ 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 * input.color.a;
+ }
+
+ ENDCG
+ }
+}
+
+Fallback "TextMeshPro/Mobile/Distance Field"
+CustomEditor "TMPro.EditorUtilities.TMP_SDFShaderGUI"
+}
diff --git a/Assets/GameMain/Fonts/Shaders/TMP_SDF Overlay.shader.meta b/Assets/GameMain/Fonts/Shaders/TMP_SDF Overlay.shader.meta
new file mode 100644
index 0000000..4a454e0
--- /dev/null
+++ b/Assets/GameMain/Fonts/Shaders/TMP_SDF Overlay.shader.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 1be7b5c5ed8a01f49b26f30ee2146240
+ShaderImporter:
+ externalObjects: {}
+ defaultTextures: []
+ nonModifiableTextures: []
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/GameMain/Fonts/Shaders/TMP_SDF SSD.shader b/Assets/GameMain/Fonts/Shaders/TMP_SDF SSD.shader
new file mode 100644
index 0000000..ed48574
--- /dev/null
+++ b/Assets/GameMain/Fonts/Shaders/TMP_SDF SSD.shader
@@ -0,0 +1,310 @@
+Shader "TextMeshPro/Distance Field SSD" {
+
+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
+ [HDR]_FaceColor ("Face Color", Color) = (1,1,1,1)
+ _FaceDilate ("Face Dilate", Range(-1,1)) = 0
+
+ [HDR]_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(0,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
+ [HDR]_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)
+
+
+ [HDR]_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
+
+ [HDR]_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
+ _Sharpness ("Sharpness", Range(-1,1)) = 0
+
+ _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
+
+ _CullMode ("Cull Mode", Float) = 0
+ _ColorMask ("Color Mask", Float) = 15
+}
+
+SubShader {
+ Tags
+ {
+ "Queue" = "Transparent"
+ "IgnoreProjector" = "True"
+ "RenderType" = "Transparent"
+ }
+
+ Stencil
+ {
+ Ref[_Stencil]
+ Comp[_StencilComp]
+ Pass[_StencilOp]
+ ReadMask[_StencilReadMask]
+ WriteMask[_StencilWriteMask]
+ }
+
+ Cull[_CullMode]
+ ZWrite Off
+ Lighting Off
+ Fog { Mode Off }
+ ZTest[unity_GUIZTestMode]
+ Blend One OneMinusSrcAlpha
+ ColorMask[_ColorMask]
+
+ Pass {
+ CGPROGRAM
+ #pragma target 3.0
+ #pragma vertex VertShader
+ #pragma fragment PixShader
+ #pragma shader_feature __ BEVEL_ON
+ #pragma shader_feature __ UNDERLAY_ON UNDERLAY_INNER
+ #pragma shader_feature __ GLOW_ON
+ #pragma shader_feature __ FORCE_LINEAR
+
+ #pragma multi_compile __ UNITY_UI_CLIP_RECT
+ #pragma multi_compile __ UNITY_UI_ALPHACLIP
+
+ #include "UnityCG.cginc"
+ #include "UnityUI.cginc"
+ #include "TMPro_Properties.cginc"
+ #include "TMPro.cginc"
+
+ struct vertex_t {
+ UNITY_VERTEX_INPUT_INSTANCE_ID
+ float4 position : POSITION;
+ float3 normal : NORMAL;
+ float4 color : COLOR;
+ float2 texcoord0 : TEXCOORD0;
+ float2 texcoord1 : TEXCOORD1;
+ };
+
+
+ struct pixel_t {
+ UNITY_VERTEX_INPUT_INSTANCE_ID
+ UNITY_VERTEX_OUTPUT_STEREO
+ float4 position : SV_POSITION;
+ float4 color : COLOR;
+ float2 atlas : TEXCOORD0;
+ float weight : TEXCOORD1;
+ float2 mask : TEXCOORD2; // Position in object space(xy)
+ float3 viewDir : TEXCOORD3;
+
+ #if (UNDERLAY_ON || UNDERLAY_INNER)
+ float2 texcoord2 : TEXCOORD4;
+ float4 underlayColor : COLOR1;
+ #endif
+ float4 textures : TEXCOORD5;
+ };
+
+ // Used by Unity internally to handle Texture Tiling and Offset.
+ float4 _FaceTex_ST;
+ float4 _OutlineTex_ST;
+
+ float4 SRGBToLinear(float4 rgba) {
+ return float4(lerp(rgba.rgb / 12.92f, pow((rgba.rgb + 0.055f) / 1.055f, 2.4f), step(0.04045f, rgba.rgb)), rgba.a);
+ }
+
+ pixel_t VertShader(vertex_t input)
+ {
+ pixel_t output;
+
+ UNITY_INITIALIZE_OUTPUT(pixel_t, output);
+ UNITY_SETUP_INSTANCE_ID(input);
+ UNITY_TRANSFER_INSTANCE_ID(input,output);
+ UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
+
+ float bold = step(input.texcoord1.y, 0);
+
+ float4 vert = input.position;
+ vert.x += _VertexOffsetX;
+ vert.y += _VertexOffsetY;
+
+ float4 vPosition = UnityObjectToClipPos(vert);
+
+ float weight = lerp(_WeightNormal, _WeightBold, bold) / 4.0;
+ weight = (weight + _FaceDilate) * _ScaleRatioA * 0.5;
+
+ #if (UNDERLAY_ON || UNDERLAY_INNER)
+ float4 underlayColor = _UnderlayColor;
+ underlayColor.rgb *= underlayColor.a;
+
+ 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);
+
+ // Support for texture tiling and offset
+ float2 textureUV = UnpackUV(input.texcoord1.x);
+ float2 faceUV = TRANSFORM_TEX(textureUV, _FaceTex);
+ float2 outlineUV = TRANSFORM_TEX(textureUV, _OutlineTex);
+
+ float4 color = input.color;
+ #if (FORCE_LINEAR && !UNITY_COLORSPACE_GAMMA)
+ color = SRGBToLinear(input.color);
+ #endif
+
+ output.position = vPosition;
+ output.color = color;
+ output.atlas = input.texcoord0;
+ output.weight = weight;
+ output.mask = half2(vert.xy * 2 - clampedRect.xy - clampedRect.zw);
+ output.viewDir = mul((float3x3)_EnvMatrix, _WorldSpaceCameraPos.xyz - mul(unity_ObjectToWorld, vert).xyz);
+ #if (UNDERLAY_ON || UNDERLAY_INNER)
+ output.texcoord2 = input.texcoord0 + bOffset;
+ output.underlayColor = underlayColor;
+ #endif
+ output.textures = float4(faceUV, outlineUV);
+
+ return output;
+ }
+
+
+ fixed4 PixShader(pixel_t input) : SV_Target
+ {
+ UNITY_SETUP_INSTANCE_ID(input);
+
+ float c = tex2D(_MainTex, input.atlas).a;
+
+ float2 pixelSize = float2(ddx(input.atlas.y), ddy(input.atlas.y));
+ pixelSize *= _TextureWidth * .75;
+ float scale = rsqrt(dot(pixelSize, pixelSize)) * _GradientScale * (_Sharpness + 1);
+
+ float weight = input.weight;
+ float bias = (.5 - weight) + (.5 / scale);
+ 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 || UNDERLAY_INNER)
+ float bScale = scale;
+ bScale /= 1 + ((_UnderlaySoftness * _ScaleRatioC) * bScale);
+ float bBias = (0.5 - weight) * bScale - 0.5 - ((_UnderlayDilate * _ScaleRatioC) * 0.5 * bScale);
+ #endif
+
+ #if UNDERLAY_ON
+ float d = tex2D(_MainTex, input.texcoord2.xy).a * bScale;
+ faceColor += input.underlayColor * saturate(d - bBias) * (1 - faceColor.a);
+ #endif
+
+ #if UNDERLAY_INNER
+ float d = tex2D(_MainTex, input.texcoord2.xy).a * bScale;
+ faceColor += input.underlayColor * (1 - saturate(d - bBias)) * 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
+ float2 maskZW = 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + (1 / scale));
+ half2 m = saturate((_ClipRect.zw - _ClipRect.xy - abs(input.mask.xy)) * maskZW);
+ faceColor *= m.x * m.y;
+ #endif
+
+ #if UNITY_UI_ALPHACLIP
+ clip(faceColor.a - 0.001);
+ #endif
+
+ return faceColor * input.color.a;
+ }
+
+ ENDCG
+ }
+}
+
+Fallback "TextMeshPro/Mobile/Distance Field"
+CustomEditor "TMPro.EditorUtilities.TMP_SDFShaderGUI"
+}
diff --git a/Assets/GameMain/Fonts/Shaders/TMP_SDF SSD.shader.meta b/Assets/GameMain/Fonts/Shaders/TMP_SDF SSD.shader.meta
new file mode 100644
index 0000000..97facd0
--- /dev/null
+++ b/Assets/GameMain/Fonts/Shaders/TMP_SDF SSD.shader.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: f9ef7b3e3b869a348bce0a7852d93e79
+ShaderImporter:
+ externalObjects: {}
+ defaultTextures: []
+ nonModifiableTextures: []
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/GameMain/Fonts/Shaders/TMP_SDF-Mobile Masking.shader b/Assets/GameMain/Fonts/Shaders/TMP_SDF-Mobile Masking.shader
new file mode 100644
index 0000000..7019aaf
--- /dev/null
+++ b/Assets/GameMain/Fonts/Shaders/TMP_SDF-Mobile Masking.shader
@@ -0,0 +1,247 @@
+// 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 - Masking" {
+
+Properties {
+ [HDR]_FaceColor ("Face Color", Color) = (1,1,1,1)
+ _FaceDilate ("Face Dilate", Range(-1,1)) = 0
+
+ [HDR]_OutlineColor ("Outline Color", Color) = (0,0,0,1)
+ _OutlineWidth ("Outline Thickness", Range(0,1)) = 0
+ _OutlineSoftness ("Outline Softness", Range(0,1)) = 0
+
+ [HDR]_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
+ _Sharpness ("Sharpness", Range(-1,1)) = 0
+
+ _VertexOffsetX ("Vertex OffsetX", float) = 0
+ _VertexOffsetY ("Vertex OffsetY", float) = 0
+
+ _ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
+ _MaskSoftnessX ("Mask SoftnessX", float) = 0
+ _MaskSoftnessY ("Mask SoftnessY", float) = 0
+ _MaskTex ("Mask Texture", 2D) = "white" {}
+ _MaskInverse ("Inverse", float) = 0
+ _MaskEdgeColor ("Edge Color", Color) = (1,1,1,1)
+ _MaskEdgeSoftness ("Edge Softness", Range(0, 1)) = 0.01
+ _MaskWipeControl ("Wipe Position", Range(0, 1)) = 0.5
+
+ _StencilComp ("Stencil Comparison", Float) = 8
+ _Stencil ("Stencil ID", Float) = 0
+ _StencilOp ("Stencil Operation", Float) = 0
+ _StencilWriteMask ("Stencil Write Mask", Float) = 255
+ _StencilReadMask ("Stencil Read Mask", Float) = 255
+
+ _CullMode ("Cull Mode", Float) = 0
+ _ColorMask ("Color Mask", Float) = 15
+}
+
+SubShader {
+ Tags
+ {
+ "Queue"="Transparent"
+ "IgnoreProjector"="True"
+ "RenderType"="Transparent"
+ }
+
+
+ Stencil
+ {
+ Ref [_Stencil]
+ Comp [_StencilComp]
+ Pass [_StencilOp]
+ ReadMask [_StencilReadMask]
+ WriteMask [_StencilWriteMask]
+ }
+
+ Cull [_CullMode]
+ ZWrite Off
+ Lighting Off
+ Fog { Mode Off }
+ ZTest [unity_GUIZTestMode]
+ Blend One OneMinusSrcAlpha
+ ColorMask [_ColorMask]
+
+ Pass {
+ CGPROGRAM
+ #pragma vertex VertShader
+ #pragma fragment PixShader
+ #pragma shader_feature __ OUTLINE_ON
+ #pragma shader_feature __ UNDERLAY_ON UNDERLAY_INNER
+
+ #pragma multi_compile __ UNITY_UI_CLIP_RECT
+ #pragma multi_compile __ UNITY_UI_ALPHACLIP
+
+
+ #include "UnityCG.cginc"
+ #include "UnityUI.cginc"
+ #include "TMPro_Properties.cginc"
+
+ struct vertex_t {
+ float4 vertex : POSITION;
+ float3 normal : NORMAL;
+ fixed4 color : COLOR;
+ float2 texcoord0 : TEXCOORD0;
+ float2 texcoord1 : TEXCOORD1;
+ };
+
+ 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
+ };
+
+ float _MaskWipeControl;
+ float _MaskEdgeSoftness;
+ fixed4 _MaskEdgeColor;
+ bool _MaskInverse;
+
+ 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 * (_Sharpness + 1);
+ 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 = 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
+ pixel_t output = {
+ vPosition,
+ faceColor,
+ outlineColor,
+ float4(input.texcoord0.x, input.texcoord0.y, 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
+ };
+
+ 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
+
+ float a = abs(_MaskInverse - tex2D(_MaskTex, input.texcoord0.zw).a);
+ float t = a + (1 - _MaskWipeControl) * _MaskEdgeSoftness - _MaskWipeControl;
+ a = saturate(t / _MaskEdgeSoftness);
+ c.rgb = lerp(_MaskEdgeColor.rgb*c.a, c.rgb, a);
+ c *= a;
+
+ #if (UNDERLAY_ON | UNDERLAY_INNER)
+ c *= input.texcoord1.z;
+ #endif
+
+ #if UNITY_UI_ALPHACLIP
+ clip(c.a - 0.001);
+ #endif
+
+ return c;
+ }
+ ENDCG
+ }
+}
+
+CustomEditor "TMPro.EditorUtilities.TMP_SDFShaderGUI"
+}
diff --git a/Assets/GameMain/Fonts/Shaders/TMP_SDF-Mobile Masking.shader.meta b/Assets/GameMain/Fonts/Shaders/TMP_SDF-Mobile Masking.shader.meta
new file mode 100644
index 0000000..c47e690
--- /dev/null
+++ b/Assets/GameMain/Fonts/Shaders/TMP_SDF-Mobile Masking.shader.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 25229adaac96caa42a737b60465f3229
+ShaderImporter:
+ externalObjects: {}
+ defaultTextures: []
+ nonModifiableTextures: []
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/GameMain/Fonts/Shaders/TMP_SDF-Mobile Overlay.shader b/Assets/GameMain/Fonts/Shaders/TMP_SDF-Mobile Overlay.shader
new file mode 100644
index 0000000..ce82bed
--- /dev/null
+++ b/Assets/GameMain/Fonts/Shaders/TMP_SDF-Mobile Overlay.shader
@@ -0,0 +1,240 @@
+// 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 Overlay" {
+
+Properties {
+ [HDR]_FaceColor ("Face Color", Color) = (1,1,1,1)
+ _FaceDilate ("Face Dilate", Range(-1,1)) = 0
+
+ [HDR]_OutlineColor ("Outline Color", Color) = (0,0,0,1)
+ _OutlineWidth ("Outline Thickness", Range(0,1)) = 0
+ _OutlineSoftness ("Outline Softness", Range(0,1)) = 0
+
+ [HDR]_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
+ _Sharpness ("Sharpness", Range(-1,1)) = 0
+
+ _VertexOffsetX ("Vertex OffsetX", float) = 0
+ _VertexOffsetY ("Vertex OffsetY", float) = 0
+
+ _ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
+ _MaskSoftnessX ("Mask SoftnessX", float) = 0
+ _MaskSoftnessY ("Mask SoftnessY", float) = 0
+
+ _StencilComp ("Stencil Comparison", Float) = 8
+ _Stencil ("Stencil ID", Float) = 0
+ _StencilOp ("Stencil Operation", Float) = 0
+ _StencilWriteMask ("Stencil Write Mask", Float) = 255
+ _StencilReadMask ("Stencil Read Mask", Float) = 255
+
+ _CullMode ("Cull Mode", Float) = 0
+ _ColorMask ("Color Mask", Float) = 15
+}
+
+SubShader {
+ Tags
+ {
+ "Queue"="Overlay"
+ "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 Always
+ Blend One OneMinusSrcAlpha
+ ColorMask [_ColorMask]
+
+ Pass {
+ CGPROGRAM
+ #pragma vertex VertShader
+ #pragma fragment PixShader
+ #pragma shader_feature __ OUTLINE_ON
+ #pragma shader_feature __ UNDERLAY_ON UNDERLAY_INNER
+
+ #pragma multi_compile __ UNITY_UI_CLIP_RECT
+ #pragma multi_compile __ UNITY_UI_ALPHACLIP
+
+ #include "UnityCG.cginc"
+ #include "UnityUI.cginc"
+ #include "TMPro_Properties.cginc"
+
+ struct vertex_t {
+ UNITY_VERTEX_INPUT_INSTANCE_ID
+ float4 vertex : POSITION;
+ float3 normal : NORMAL;
+ fixed4 color : COLOR;
+ float2 texcoord0 : TEXCOORD0;
+ float2 texcoord1 : TEXCOORD1;
+ };
+
+ struct pixel_t {
+ UNITY_VERTEX_INPUT_INSTANCE_ID
+ UNITY_VERTEX_OUTPUT_STEREO
+ 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
+ };
+
+
+ pixel_t VertShader(vertex_t input)
+ {
+ pixel_t output;
+
+ UNITY_INITIALIZE_OUTPUT(pixel_t, output);
+ UNITY_SETUP_INSTANCE_ID(input);
+ UNITY_TRANSFER_INSTANCE_ID(input, output);
+ UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
+
+ 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 * (_Sharpness + 1);
+ 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 = 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);
+
+ // Populate structure for pixel shader
+ output.vertex = vPosition;
+ output.faceColor = faceColor;
+ output.outlineColor = outlineColor;
+ output.texcoord0 = float4(input.texcoord0.x, input.texcoord0.y, maskUV.x, maskUV.y);
+ output.param = half4(scale, bias - outline, bias + outline, bias);
+ output.mask = half4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy));
+ #if (UNDERLAY_ON || UNDERLAY_INNER)
+ output.texcoord1 = float4(input.texcoord0 + layerOffset, input.color.a, 0);
+ output.underlayParam = half2(layerScale, layerBias);
+ #endif
+
+ return output;
+ }
+
+
+ // PIXEL SHADER
+ fixed4 PixShader(pixel_t input) : SV_Target
+ {
+ UNITY_SETUP_INSTANCE_ID(input);
+
+ 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
+
+ #if UNITY_UI_ALPHACLIP
+ clip(c.a - 0.001);
+ #endif
+
+ return c;
+ }
+ ENDCG
+ }
+}
+
+CustomEditor "TMPro.EditorUtilities.TMP_SDFShaderGUI"
+}
diff --git a/Assets/GameMain/Fonts/Shaders/TMP_SDF-Mobile Overlay.shader.meta b/Assets/GameMain/Fonts/Shaders/TMP_SDF-Mobile Overlay.shader.meta
new file mode 100644
index 0000000..0f0213f
--- /dev/null
+++ b/Assets/GameMain/Fonts/Shaders/TMP_SDF-Mobile Overlay.shader.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 7f1361f834115be4ea4ec2387c67334e
+ShaderImporter:
+ externalObjects: {}
+ defaultTextures: []
+ nonModifiableTextures: []
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/GameMain/Fonts/Shaders/TMP_SDF-Mobile SSD.shader b/Assets/GameMain/Fonts/Shaders/TMP_SDF-Mobile SSD.shader
new file mode 100644
index 0000000..df4d5b0
--- /dev/null
+++ b/Assets/GameMain/Fonts/Shaders/TMP_SDF-Mobile SSD.shader
@@ -0,0 +1,106 @@
+// 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 SSD" {
+
+Properties {
+ [HDR]_FaceColor ("Face Color", Color) = (1,1,1,1)
+ _FaceDilate ("Face Dilate", Range(-1,1)) = 0
+
+ [HDR]_OutlineColor ("Outline Color", Color) = (0,0,0,1)
+ _OutlineWidth ("Outline Thickness", Range(0,1)) = 0
+ _OutlineSoftness ("Outline Softness", Range(0,1)) = 0
+
+ [HDR]_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
+ _Sharpness ("Sharpness", Range(-1,1)) = 0
+
+ _VertexOffsetX ("Vertex OffsetX", float) = 0
+ _VertexOffsetY ("Vertex OffsetY", float) = 0
+
+ _ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
+ _MaskSoftnessX ("Mask SoftnessX", float) = 0
+ _MaskSoftnessY ("Mask SoftnessY", float) = 0
+ _MaskTex ("Mask Texture", 2D) = "white" {}
+ _MaskInverse ("Inverse", float) = 0
+ _MaskEdgeColor ("Edge Color", Color) = (1,1,1,1)
+ _MaskEdgeSoftness ("Edge Softness", Range(0, 1)) = 0.01
+ _MaskWipeControl ("Wipe Position", Range(0, 1)) = 0.5
+
+ _StencilComp ("Stencil Comparison", Float) = 8
+ _Stencil ("Stencil ID", Float) = 0
+ _StencilOp ("Stencil Operation", Float) = 0
+ _StencilWriteMask ("Stencil Write Mask", Float) = 255
+ _StencilReadMask ("Stencil Read Mask", Float) = 255
+
+ _CullMode ("Cull Mode", Float) = 0
+ _ColorMask ("Color Mask", Float) = 15
+}
+
+SubShader {
+ Tags {
+ "Queue"="Transparent"
+ "IgnoreProjector"="True"
+ "RenderType"="Transparent"
+ }
+
+ Stencil
+ {
+ Ref [_Stencil]
+ Comp [_StencilComp]
+ Pass [_StencilOp]
+ ReadMask [_StencilReadMask]
+ WriteMask [_StencilWriteMask]
+ }
+
+ Cull [_CullMode]
+ ZWrite Off
+ Lighting Off
+ Fog { Mode Off }
+ ZTest [unity_GUIZTestMode]
+ Blend One OneMinusSrcAlpha
+ ColorMask [_ColorMask]
+
+ Pass {
+ CGPROGRAM
+ #pragma vertex VertShader
+ #pragma fragment PixShader
+ #pragma shader_feature __ OUTLINE_ON
+ #pragma shader_feature __ UNDERLAY_ON UNDERLAY_INNER
+
+ #pragma multi_compile __ UNITY_UI_CLIP_RECT
+ #pragma multi_compile __ UNITY_UI_ALPHACLIP
+
+ #include "UnityCG.cginc"
+ #include "UnityUI.cginc"
+ #include "TMPro_Properties.cginc"
+
+ #include "TMPro_Mobile.cginc"
+
+ ENDCG
+ }
+}
+
+CustomEditor "TMPro.EditorUtilities.TMP_SDFShaderGUI"
+}
diff --git a/Assets/GameMain/Fonts/Shaders/TMP_SDF-Mobile SSD.shader.meta b/Assets/GameMain/Fonts/Shaders/TMP_SDF-Mobile SSD.shader.meta
new file mode 100644
index 0000000..b2b0403
--- /dev/null
+++ b/Assets/GameMain/Fonts/Shaders/TMP_SDF-Mobile SSD.shader.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 1aeec1235e121cb46ba8ea88d1025009
+ShaderImporter:
+ externalObjects: {}
+ defaultTextures: []
+ nonModifiableTextures: []
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/GameMain/Fonts/Shaders/TMP_SDF-Mobile.shader b/Assets/GameMain/Fonts/Shaders/TMP_SDF-Mobile.shader
new file mode 100644
index 0000000..d3f5866
--- /dev/null
+++ b/Assets/GameMain/Fonts/Shaders/TMP_SDF-Mobile.shader
@@ -0,0 +1,240 @@
+// 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" {
+
+Properties {
+ [HDR]_FaceColor ("Face Color", Color) = (1,1,1,1)
+ _FaceDilate ("Face Dilate", Range(-1,1)) = 0
+
+ [HDR]_OutlineColor ("Outline Color", Color) = (0,0,0,1)
+ _OutlineWidth ("Outline Thickness", Range(0,1)) = 0
+ _OutlineSoftness ("Outline Softness", Range(0,1)) = 0
+
+ [HDR]_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
+ _Sharpness ("Sharpness", Range(-1,1)) = 0
+
+ _VertexOffsetX ("Vertex OffsetX", float) = 0
+ _VertexOffsetY ("Vertex OffsetY", float) = 0
+
+ _ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
+ _MaskSoftnessX ("Mask SoftnessX", float) = 0
+ _MaskSoftnessY ("Mask SoftnessY", float) = 0
+
+ _StencilComp ("Stencil Comparison", Float) = 8
+ _Stencil ("Stencil ID", Float) = 0
+ _StencilOp ("Stencil Operation", Float) = 0
+ _StencilWriteMask ("Stencil Write Mask", Float) = 255
+ _StencilReadMask ("Stencil Read Mask", Float) = 255
+
+ _CullMode ("Cull Mode", Float) = 0
+ _ColorMask ("Color Mask", Float) = 15
+}
+
+SubShader {
+ Tags
+ {
+ "Queue"="Transparent"
+ "IgnoreProjector"="True"
+ "RenderType"="Transparent"
+ }
+
+
+ Stencil
+ {
+ Ref [_Stencil]
+ Comp [_StencilComp]
+ Pass [_StencilOp]
+ ReadMask [_StencilReadMask]
+ WriteMask [_StencilWriteMask]
+ }
+
+ Cull [_CullMode]
+ ZWrite Off
+ Lighting Off
+ Fog { Mode Off }
+ ZTest [unity_GUIZTestMode]
+ Blend One OneMinusSrcAlpha
+ ColorMask [_ColorMask]
+
+ Pass {
+ CGPROGRAM
+ #pragma vertex VertShader
+ #pragma fragment PixShader
+ #pragma shader_feature __ OUTLINE_ON
+ #pragma shader_feature __ UNDERLAY_ON UNDERLAY_INNER
+
+ #pragma multi_compile __ UNITY_UI_CLIP_RECT
+ #pragma multi_compile __ UNITY_UI_ALPHACLIP
+
+ #include "UnityCG.cginc"
+ #include "UnityUI.cginc"
+ #include "TMPro_Properties.cginc"
+
+ struct vertex_t {
+ UNITY_VERTEX_INPUT_INSTANCE_ID
+ float4 vertex : POSITION;
+ float3 normal : NORMAL;
+ fixed4 color : COLOR;
+ float2 texcoord0 : TEXCOORD0;
+ float2 texcoord1 : TEXCOORD1;
+ };
+
+ struct pixel_t {
+ UNITY_VERTEX_INPUT_INSTANCE_ID
+ UNITY_VERTEX_OUTPUT_STEREO
+ 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
+ };
+
+
+ pixel_t VertShader(vertex_t input)
+ {
+ pixel_t output;
+
+ UNITY_INITIALIZE_OUTPUT(pixel_t, output);
+ UNITY_SETUP_INSTANCE_ID(input);
+ UNITY_TRANSFER_INSTANCE_ID(input, output);
+ UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
+
+ 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 * (_Sharpness + 1);
+ 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 = 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);
+
+ // Populate structure for pixel shader
+ output.vertex = vPosition;
+ output.faceColor = faceColor;
+ output.outlineColor = outlineColor;
+ output.texcoord0 = float4(input.texcoord0.x, input.texcoord0.y, maskUV.x, maskUV.y);
+ output.param = half4(scale, bias - outline, bias + outline, bias);
+ output.mask = half4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy));
+ #if (UNDERLAY_ON || UNDERLAY_INNER)
+ output.texcoord1 = float4(input.texcoord0 + layerOffset, input.color.a, 0);
+ output.underlayParam = half2(layerScale, layerBias);
+ #endif
+
+ return output;
+ }
+
+
+ // PIXEL SHADER
+ fixed4 PixShader(pixel_t input) : SV_Target
+ {
+ UNITY_SETUP_INSTANCE_ID(input);
+
+ 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
+
+ #if UNITY_UI_ALPHACLIP
+ clip(c.a - 0.001);
+ #endif
+
+ return c;
+ }
+ ENDCG
+ }
+}
+
+CustomEditor "TMPro.EditorUtilities.TMP_SDFShaderGUI"
+}
diff --git a/Assets/GameMain/Fonts/Shaders/TMP_SDF-Mobile.shader.meta b/Assets/GameMain/Fonts/Shaders/TMP_SDF-Mobile.shader.meta
new file mode 100644
index 0000000..335e0fd
--- /dev/null
+++ b/Assets/GameMain/Fonts/Shaders/TMP_SDF-Mobile.shader.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: fb171366644152948b39e5c17f4b1f39
+ShaderImporter:
+ externalObjects: {}
+ defaultTextures: []
+ nonModifiableTextures: []
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/GameMain/Fonts/Shaders/TMP_SDF-Surface-Mobile.shader b/Assets/GameMain/Fonts/Shaders/TMP_SDF-Surface-Mobile.shader
new file mode 100644
index 0000000..be764ae
--- /dev/null
+++ b/Assets/GameMain/Fonts/Shaders/TMP_SDF-Surface-Mobile.shader
@@ -0,0 +1,138 @@
+// Simplified version of the SDF Surface shader :
+// - No support for Bevel, Bump or envmap
+// - Diffuse only lighting
+// - Fully supports only 1 directional light. Other lights can affect it, but it will be per-vertex/SH.
+
+Shader "TextMeshPro/Mobile/Distance Field (Surface)" {
+
+Properties {
+ _FaceTex ("Fill Texture", 2D) = "white" {}
+ [HDR]_FaceColor ("Fill Color", Color) = (1,1,1,1)
+ _FaceDilate ("Face Dilate", Range(-1,1)) = 0
+
+ [HDR]_OutlineColor ("Outline Color", Color) = (0,0,0,1)
+ _OutlineTex ("Outline Texture", 2D) = "white" {}
+ _OutlineWidth ("Outline Thickness", Range(0, 1)) = 0
+ _OutlineSoftness ("Outline Softness", Range(0,1)) = 0
+
+ [HDR]_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
+
+ // Should not be directly exposed to the user
+ _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
+ _Sharpness ("Sharpness", Range(-1,1)) = 0
+
+ _VertexOffsetX ("Vertex OffsetX", float) = 0
+ _VertexOffsetY ("Vertex OffsetY", float) = 0
+
+ _CullMode ("Cull Mode", Float) = 0
+ //_MaskCoord ("Mask Coords", vector) = (0,0,0,0)
+ //_MaskSoftness ("Mask Softness", float) = 0
+}
+
+SubShader {
+
+ Tags {
+ "Queue"="Transparent"
+ "IgnoreProjector"="True"
+ "RenderType"="Transparent"
+ }
+
+ LOD 300
+ Cull [_CullMode]
+
+ CGPROGRAM
+ #pragma surface PixShader Lambert alpha:blend vertex:VertShader noforwardadd nolightmap nodirlightmap
+ #pragma target 3.0
+ #pragma shader_feature __ GLOW_ON
+
+ #include "TMPro_Properties.cginc"
+ #include "TMPro.cginc"
+
+ half _FaceShininess;
+ half _OutlineShininess;
+
+ struct Input
+ {
+ fixed4 color : COLOR;
+ float2 uv_MainTex;
+ float2 uv2_FaceTex;
+ float2 uv2_OutlineTex;
+ float2 param; // Weight, Scale
+ float3 viewDirEnv;
+ };
+
+ #include "TMPro_Surface.cginc"
+
+ ENDCG
+
+ // Pass to render object as a shadow caster
+ Pass
+ {
+ Name "Caster"
+ Tags { "LightMode" = "ShadowCaster" }
+ Offset 1, 1
+
+ Fog {Mode Off}
+ ZWrite On ZTest LEqual Cull Off
+
+ CGPROGRAM
+ #pragma vertex vert
+ #pragma fragment frag
+ #pragma multi_compile_shadowcaster
+ #include "UnityCG.cginc"
+
+ struct v2f {
+ V2F_SHADOW_CASTER;
+ float2 uv : TEXCOORD1;
+ float2 uv2 : TEXCOORD3;
+ float alphaClip : TEXCOORD2;
+ };
+
+ uniform float4 _MainTex_ST;
+ uniform float4 _OutlineTex_ST;
+ float _OutlineWidth;
+ float _FaceDilate;
+ float _ScaleRatioA;
+
+ v2f vert( appdata_base v )
+ {
+ v2f o;
+ TRANSFER_SHADOW_CASTER(o)
+ o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);
+ o.uv2 = TRANSFORM_TEX(v.texcoord, _OutlineTex);
+ o.alphaClip = o.alphaClip = (1.0 - _OutlineWidth * _ScaleRatioA - _FaceDilate * _ScaleRatioA) / 2;
+ return o;
+ }
+
+ uniform sampler2D _MainTex;
+
+ float4 frag(v2f i) : COLOR
+ {
+ fixed4 texcol = tex2D(_MainTex, i.uv).a;
+ clip(texcol.a - i.alphaClip);
+ SHADOW_CASTER_FRAGMENT(i)
+ }
+ ENDCG
+ }
+}
+
+CustomEditor "TMPro.EditorUtilities.TMP_SDFShaderGUI"
+}
diff --git a/Assets/GameMain/Fonts/Shaders/TMP_SDF-Surface-Mobile.shader.meta b/Assets/GameMain/Fonts/Shaders/TMP_SDF-Surface-Mobile.shader.meta
new file mode 100644
index 0000000..a663819
--- /dev/null
+++ b/Assets/GameMain/Fonts/Shaders/TMP_SDF-Surface-Mobile.shader.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 4ca22ae3bc068c84eb7858d5b9bdf3e2
+ShaderImporter:
+ externalObjects: {}
+ defaultTextures: []
+ nonModifiableTextures: []
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/GameMain/Fonts/Shaders/TMP_SDF-Surface.shader b/Assets/GameMain/Fonts/Shaders/TMP_SDF-Surface.shader
new file mode 100644
index 0000000..bcb2bb2
--- /dev/null
+++ b/Assets/GameMain/Fonts/Shaders/TMP_SDF-Surface.shader
@@ -0,0 +1,158 @@
+Shader "TextMeshPro/Distance Field (Surface)" {
+
+Properties {
+ _FaceTex ("Fill Texture", 2D) = "white" {}
+ _FaceUVSpeedX ("Face UV Speed X", Range(-5, 5)) = 0.0
+ _FaceUVSpeedY ("Face UV Speed Y", Range(-5, 5)) = 0.0
+ [HDR]_FaceColor ("Fill Color", Color) = (1,1,1,1)
+ _FaceDilate ("Face Dilate", Range(-1,1)) = 0
+
+ [HDR]_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(0,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
+
+ _BumpMap ("Normalmap", 2D) = "bump" {}
+ _BumpOutline ("Bump Outline", Range(0,1)) = 0.5
+ _BumpFace ("Bump Face", Range(0,1)) = 0.5
+
+ _ReflectFaceColor ("Face Color", Color) = (0,0,0,1)
+ _ReflectOutlineColor ("Outline Color", Color) = (0,0,0,1)
+ _Cube ("Reflection Cubemap", Cube) = "black" { /* TexGen CubeReflect */ }
+ _EnvMatrixRotation ("Texture Rotation", vector) = (0, 0, 0, 0)
+ [HDR]_SpecColor ("Specular Color", Color) = (0,0,0,1)
+
+ _FaceShininess ("Face Shininess", Range(0,1)) = 0
+ _OutlineShininess ("Outline Shininess", Range(0,1)) = 0
+
+ [HDR]_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
+
+ // Should not be directly exposed to the user
+ _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
+ _Sharpness ("Sharpness", Range(-1,1)) = 0
+
+ _VertexOffsetX ("Vertex OffsetX", float) = 0
+ _VertexOffsetY ("Vertex OffsetY", float) = 0
+
+ _CullMode ("Cull Mode", Float) = 0
+ //_MaskCoord ("Mask Coords", vector) = (0,0,0,0)
+ //_MaskSoftness ("Mask Softness", float) = 0
+}
+
+SubShader {
+
+ Tags { "Queue"="Transparent" "IgnoreProjector"="True" "RenderType"="Transparent" }
+
+ LOD 300
+ Cull [_CullMode]
+
+ CGPROGRAM
+ #pragma surface PixShader BlinnPhong alpha:blend vertex:VertShader nolightmap nodirlightmap
+ #pragma target 3.0
+ #pragma shader_feature __ GLOW_ON
+ #pragma glsl
+
+ #include "TMPro_Properties.cginc"
+ #include "TMPro.cginc"
+
+ half _FaceShininess;
+ half _OutlineShininess;
+
+ struct Input
+ {
+ fixed4 color : COLOR;
+ float2 uv_MainTex;
+ float2 uv2_FaceTex;
+ float2 uv2_OutlineTex;
+ float2 param; // Weight, Scale
+ float3 viewDirEnv;
+ };
+
+
+ #define BEVEL_ON 1
+ #include "TMPro_Surface.cginc"
+
+ ENDCG
+
+ // Pass to render object as a shadow caster
+ Pass
+ {
+ Name "Caster"
+ Tags { "LightMode" = "ShadowCaster" }
+ Offset 1, 1
+
+ Fog {Mode Off}
+ ZWrite On
+ ZTest LEqual
+ Cull Off
+
+ CGPROGRAM
+ #pragma vertex vert
+ #pragma fragment frag
+ #pragma multi_compile_shadowcaster
+ #include "UnityCG.cginc"
+
+ struct v2f {
+ V2F_SHADOW_CASTER;
+ float2 uv : TEXCOORD1;
+ float2 uv2 : TEXCOORD3;
+ float alphaClip : TEXCOORD2;
+ };
+
+ uniform float4 _MainTex_ST;
+ uniform float4 _OutlineTex_ST;
+ float _OutlineWidth;
+ float _FaceDilate;
+ float _ScaleRatioA;
+
+ v2f vert( appdata_base v )
+ {
+ v2f o;
+ TRANSFER_SHADOW_CASTER(o)
+ o.uv = TRANSFORM_TEX(v.texcoord, _MainTex);
+ o.uv2 = TRANSFORM_TEX(v.texcoord, _OutlineTex);
+ o.alphaClip = (1.0 - _OutlineWidth * _ScaleRatioA - _FaceDilate * _ScaleRatioA) / 2;
+ return o;
+ }
+
+ uniform sampler2D _MainTex;
+
+ float4 frag(v2f i) : COLOR
+ {
+ fixed4 texcol = tex2D(_MainTex, i.uv).a;
+ clip(texcol.a - i.alphaClip);
+ SHADOW_CASTER_FRAGMENT(i)
+ }
+ ENDCG
+ }
+}
+
+CustomEditor "TMPro.EditorUtilities.TMP_SDFShaderGUI"
+}
+
diff --git a/Assets/GameMain/Fonts/Shaders/TMP_SDF-Surface.shader.meta b/Assets/GameMain/Fonts/Shaders/TMP_SDF-Surface.shader.meta
new file mode 100644
index 0000000..261e4a6
--- /dev/null
+++ b/Assets/GameMain/Fonts/Shaders/TMP_SDF-Surface.shader.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: f5b2cc6c7ce8cc5408ad507a4f40af49
+ShaderImporter:
+ externalObjects: {}
+ defaultTextures: []
+ nonModifiableTextures: []
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/GameMain/Fonts/Shaders/TMP_SDF.shader b/Assets/GameMain/Fonts/Shaders/TMP_SDF.shader
new file mode 100644
index 0000000..011ee19
--- /dev/null
+++ b/Assets/GameMain/Fonts/Shaders/TMP_SDF.shader
@@ -0,0 +1,317 @@
+Shader "TextMeshPro/Distance Field" {
+
+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
+ [HDR]_FaceColor ("Face Color", Color) = (1,1,1,1)
+ _FaceDilate ("Face Dilate", Range(-1,1)) = 0
+
+ [HDR]_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(0,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
+ [HDR]_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)
+
+
+ [HDR]_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
+
+ [HDR]_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
+ _Sharpness ("Sharpness", Range(-1,1)) = 0
+
+ _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
+
+ _CullMode ("Cull Mode", Float) = 0
+ _ColorMask ("Color Mask", Float) = 15
+}
+
+SubShader {
+
+ Tags
+ {
+ "Queue"="Transparent"
+ "IgnoreProjector"="True"
+ "RenderType"="Transparent"
+ }
+
+ Stencil
+ {
+ Ref [_Stencil]
+ Comp [_StencilComp]
+ Pass [_StencilOp]
+ ReadMask [_StencilReadMask]
+ WriteMask [_StencilWriteMask]
+ }
+
+ Cull [_CullMode]
+ ZWrite Off
+ Lighting Off
+ Fog { Mode Off }
+ ZTest [unity_GUIZTestMode]
+ Blend One OneMinusSrcAlpha
+ ColorMask [_ColorMask]
+
+ Pass {
+ CGPROGRAM
+ #pragma target 3.0
+ #pragma vertex VertShader
+ #pragma fragment PixShader
+ #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 "TMPro_Properties.cginc"
+ #include "TMPro.cginc"
+
+ struct vertex_t {
+ UNITY_VERTEX_INPUT_INSTANCE_ID
+ float4 position : POSITION;
+ float3 normal : NORMAL;
+ fixed4 color : COLOR;
+ float2 texcoord0 : TEXCOORD0;
+ float2 texcoord1 : TEXCOORD1;
+ };
+
+
+ struct pixel_t {
+ UNITY_VERTEX_INPUT_INSTANCE_ID
+ UNITY_VERTEX_OUTPUT_STEREO
+ 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;
+ };
+
+ // Used by Unity internally to handle Texture Tiling and Offset.
+ float4 _FaceTex_ST;
+ float4 _OutlineTex_ST;
+
+ pixel_t VertShader(vertex_t input)
+ {
+ pixel_t output;
+
+ UNITY_INITIALIZE_OUTPUT(pixel_t, output);
+ UNITY_SETUP_INSTANCE_ID(input);
+ UNITY_TRANSFER_INSTANCE_ID(input,output);
+ UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(output);
+
+ 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 * (_Sharpness + 1);
+ 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);
+
+
+ output.position = vPosition;
+ output.color = input.color;
+ output.atlas = input.texcoord0;
+ output.param = float4(alphaClip, scale, bias, weight);
+ output.mask = half4(vert.xy * 2 - clampedRect.xy - clampedRect.zw, 0.25 / (0.25 * half2(_MaskSoftnessX, _MaskSoftnessY) + pixelSize.xy));
+ output.viewDir = mul((float3x3)_EnvMatrix, _WorldSpaceCameraPos.xyz - mul(unity_ObjectToWorld, vert).xyz);
+ #if (UNDERLAY_ON || UNDERLAY_INNER)
+ output.texcoord2 = float4(input.texcoord0 + bOffset, bScale, bBias);
+ output.underlayColor = underlayColor;
+ #endif
+ output.textures = float4(faceUV, outlineUV);
+
+ return output;
+ }
+
+
+ fixed4 PixShader(pixel_t input) : SV_Target
+ {
+ UNITY_SETUP_INSTANCE_ID(input);
+
+ 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 * input.color.a;
+ }
+
+ ENDCG
+ }
+}
+
+Fallback "TextMeshPro/Mobile/Distance Field"
+CustomEditor "TMPro.EditorUtilities.TMP_SDFShaderGUI"
+}
diff --git a/Assets/GameMain/Fonts/Shaders/TMP_SDF.shader.meta b/Assets/GameMain/Fonts/Shaders/TMP_SDF.shader.meta
new file mode 100644
index 0000000..693dc09
--- /dev/null
+++ b/Assets/GameMain/Fonts/Shaders/TMP_SDF.shader.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: 5b5a6a737c460eb4abc105d6583d405e
+ShaderImporter:
+ externalObjects: {}
+ defaultTextures: []
+ nonModifiableTextures: []
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/GameMain/Fonts/Shaders/TMP_Sprite.shader b/Assets/GameMain/Fonts/Shaders/TMP_Sprite.shader
new file mode 100644
index 0000000..e8283a7
--- /dev/null
+++ b/Assets/GameMain/Fonts/Shaders/TMP_Sprite.shader
@@ -0,0 +1,116 @@
+Shader "TextMeshPro/Sprite"
+{
+ Properties
+ {
+ [PerRendererData] _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
+
+ _CullMode ("Cull Mode", Float) = 0
+ _ColorMask ("Color Mask", Float) = 15
+ _ClipRect ("Clip Rect", vector) = (-32767, -32767, 32767, 32767)
+
+ [Toggle(UNITY_UI_ALPHACLIP)] _UseUIAlphaClip ("Use Alpha Clip", Float) = 0
+ }
+
+ SubShader
+ {
+ Tags
+ {
+ "Queue"="Transparent"
+ "IgnoreProjector"="True"
+ "RenderType"="Transparent"
+ "PreviewType"="Plane"
+ "CanUseSpriteAtlas"="True"
+ }
+
+ Stencil
+ {
+ Ref [_Stencil]
+ Comp [_StencilComp]
+ Pass [_StencilOp]
+ ReadMask [_StencilReadMask]
+ WriteMask [_StencilWriteMask]
+ }
+
+ Cull [_CullMode]
+ Lighting Off
+ ZWrite Off
+ ZTest [unity_GUIZTestMode]
+ Blend SrcAlpha OneMinusSrcAlpha
+ ColorMask [_ColorMask]
+
+ Pass
+ {
+ Name "Default"
+ CGPROGRAM
+ #pragma vertex vert
+ #pragma fragment frag
+ #pragma target 2.0
+
+ #include "UnityCG.cginc"
+ #include "UnityUI.cginc"
+
+ #pragma multi_compile __ UNITY_UI_CLIP_RECT
+ #pragma multi_compile __ UNITY_UI_ALPHACLIP
+
+ 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
+ };
+
+ sampler2D _MainTex;
+ fixed4 _Color;
+ fixed4 _TextureSampleAdd;
+ float4 _ClipRect;
+ float4 _MainTex_ST;
+
+ v2f vert(appdata_t v)
+ {
+ v2f OUT;
+ UNITY_SETUP_INSTANCE_ID(v);
+ UNITY_INITIALIZE_VERTEX_OUTPUT_STEREO(OUT);
+ OUT.worldPosition = v.vertex;
+ OUT.vertex = UnityObjectToClipPos(OUT.worldPosition);
+
+ OUT.texcoord = TRANSFORM_TEX(v.texcoord, _MainTex);
+
+ OUT.color = v.color * _Color;
+ return OUT;
+ }
+
+ fixed4 frag(v2f IN) : SV_Target
+ {
+ half4 color = (tex2D(_MainTex, IN.texcoord) + _TextureSampleAdd) * IN.color;
+
+ #ifdef UNITY_UI_CLIP_RECT
+ color.a *= UnityGet2DClipping(IN.worldPosition.xy, _ClipRect);
+ #endif
+
+ #ifdef UNITY_UI_ALPHACLIP
+ clip (color.a - 0.001);
+ #endif
+
+ return color;
+ }
+ ENDCG
+ }
+ }
+}
diff --git a/Assets/GameMain/Fonts/Shaders/TMP_Sprite.shader.meta b/Assets/GameMain/Fonts/Shaders/TMP_Sprite.shader.meta
new file mode 100644
index 0000000..1c5a1fc
--- /dev/null
+++ b/Assets/GameMain/Fonts/Shaders/TMP_Sprite.shader.meta
@@ -0,0 +1,9 @@
+fileFormatVersion: 2
+guid: ab1c66f8a301fe043930c9f0c23716cf
+ShaderImporter:
+ externalObjects: {}
+ defaultTextures: []
+ nonModifiableTextures: []
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/TextMesh Pro/Resources/Sprite Assets/coin.asset b/Assets/GameMain/Fonts/coin.asset
similarity index 100%
rename from Assets/TextMesh Pro/Resources/Sprite Assets/coin.asset
rename to Assets/GameMain/Fonts/coin.asset
diff --git a/Assets/TextMesh Pro/Resources/Sprite Assets/coin.asset.meta b/Assets/GameMain/Fonts/coin.asset.meta
similarity index 100%
rename from Assets/TextMesh Pro/Resources/Sprite Assets/coin.asset.meta
rename to Assets/GameMain/Fonts/coin.asset.meta
diff --git a/Assets/GameMain/Materials/Blue.mat b/Assets/GameMain/Materials/Blue.mat
new file mode 100644
index 0000000..4dea6ad
--- /dev/null
+++ b/Assets/GameMain/Materials/Blue.mat
@@ -0,0 +1,137 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!21 &2100000
+Material:
+ serializedVersion: 8
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_Name: Blue
+ m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
+ m_Parent: {fileID: 0}
+ m_ModifiedSerializedProperties: 0
+ m_ValidKeywords: []
+ m_InvalidKeywords: []
+ m_LightmapFlags: 4
+ m_EnableInstancingVariants: 1
+ m_DoubleSidedGI: 0
+ m_CustomRenderQueue: -1
+ stringTagMap:
+ RenderType: Opaque
+ disabledShaderPasses: []
+ m_LockedProperties:
+ m_SavedProperties:
+ serializedVersion: 3
+ m_TexEnvs:
+ - _BaseMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _BumpMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _DetailAlbedoMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _DetailMask:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _DetailNormalMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _EmissionMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _MainTex:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _MetallicGlossMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _OcclusionMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _ParallaxMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _SpecGlossMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - unity_Lightmaps:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - unity_LightmapsInd:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - unity_ShadowMasks:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ m_Ints: []
+ m_Floats:
+ - _AlphaClip: 0
+ - _AlphaToMask: 0
+ - _Blend: 0
+ - _BlendModePreserveSpecular: 1
+ - _BlendOp: 0
+ - _BumpScale: 1
+ - _ClearCoatMask: 0
+ - _ClearCoatSmoothness: 0
+ - _Cull: 2
+ - _Cutoff: 0.5
+ - _DetailAlbedoMapScale: 1
+ - _DetailNormalMapScale: 1
+ - _DstBlend: 0
+ - _DstBlendAlpha: 0
+ - _EnvironmentReflections: 1
+ - _FlashAmount: 0
+ - _GlossMapScale: 0
+ - _Glossiness: 0
+ - _GlossyReflections: 0
+ - _Metallic: 0
+ - _OcclusionStrength: 1
+ - _Parallax: 0.005
+ - _QueueOffset: 0
+ - _ReceiveShadows: 1
+ - _SampleGI: 0
+ - _Smoothness: 0.5
+ - _SmoothnessTextureChannel: 0
+ - _SpecularHighlights: 1
+ - _SrcBlend: 1
+ - _SrcBlendAlpha: 1
+ - _Surface: 0
+ - _WorkflowMode: 1
+ - _ZWrite: 1
+ m_Colors:
+ - _BaseColor: {r: 0.1, g: 1, b: 0.9, a: 1}
+ - _Color: {r: 0.09999997, g: 1, b: 0.9, a: 1}
+ - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
+ - _FlashColor: {r: 1, g: 1, b: 1, a: 1}
+ - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
+ m_BuildTextureStacks: []
+--- !u!114 &4582237545370899445
+MonoBehaviour:
+ m_ObjectHideFlags: 11
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ version: 7
diff --git a/Assets/GameMain/Scenes/StressTest/GlobalVolumeProfile.asset.meta b/Assets/GameMain/Materials/Blue.mat.meta
similarity index 64%
rename from Assets/GameMain/Scenes/StressTest/GlobalVolumeProfile.asset.meta
rename to Assets/GameMain/Materials/Blue.mat.meta
index 06bddd4..9b5ed68 100644
--- a/Assets/GameMain/Scenes/StressTest/GlobalVolumeProfile.asset.meta
+++ b/Assets/GameMain/Materials/Blue.mat.meta
@@ -1,8 +1,8 @@
fileFormatVersion: 2
-guid: 94ca859a535c2074392c01285b2754e0
+guid: c4f37184fcb9306428d7d002f7dca96d
NativeFormatImporter:
externalObjects: {}
- mainObjectFileID: 11400000
+ mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
diff --git a/Assets/GameMain/Materials/Green.mat b/Assets/GameMain/Materials/InstancingGreen.mat
similarity index 99%
rename from Assets/GameMain/Materials/Green.mat
rename to Assets/GameMain/Materials/InstancingGreen.mat
index 1b10d11..ea4f2b0 100644
--- a/Assets/GameMain/Materials/Green.mat
+++ b/Assets/GameMain/Materials/InstancingGreen.mat
@@ -7,7 +7,7 @@ Material:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
- m_Name: Green
+ m_Name: InstancingGreen
m_Shader: {fileID: 4800000, guid: f17bc7e2694233349a8b22e96c5c43de, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
diff --git a/Assets/GameMain/Materials/Green.mat.meta b/Assets/GameMain/Materials/InstancingGreen.mat.meta
similarity index 100%
rename from Assets/GameMain/Materials/Green.mat.meta
rename to Assets/GameMain/Materials/InstancingGreen.mat.meta
diff --git a/Assets/GameMain/Materials/InstancingGrey.mat b/Assets/GameMain/Materials/InstancingGrey.mat
new file mode 100644
index 0000000..87cc500
--- /dev/null
+++ b/Assets/GameMain/Materials/InstancingGrey.mat
@@ -0,0 +1,136 @@
+%YAML 1.1
+%TAG !u! tag:unity3d.com,2011:
+--- !u!21 &2100000
+Material:
+ serializedVersion: 8
+ m_ObjectHideFlags: 0
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_Name: InstancingGrey
+ m_Shader: {fileID: 4800000, guid: f17bc7e2694233349a8b22e96c5c43de, type: 3}
+ m_Parent: {fileID: 0}
+ m_ModifiedSerializedProperties: 0
+ m_ValidKeywords: []
+ m_InvalidKeywords: []
+ m_LightmapFlags: 4
+ m_EnableInstancingVariants: 1
+ m_DoubleSidedGI: 0
+ m_CustomRenderQueue: -1
+ stringTagMap: {}
+ disabledShaderPasses: []
+ m_LockedProperties:
+ m_SavedProperties:
+ serializedVersion: 3
+ m_TexEnvs:
+ - _BaseMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _BumpMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _DetailAlbedoMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _DetailMask:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _DetailNormalMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _EmissionMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _MainTex:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _MetallicGlossMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _OcclusionMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _ParallaxMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - _SpecGlossMap:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - unity_Lightmaps:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - unity_LightmapsInd:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ - unity_ShadowMasks:
+ m_Texture: {fileID: 0}
+ m_Scale: {x: 1, y: 1}
+ m_Offset: {x: 0, y: 0}
+ m_Ints: []
+ m_Floats:
+ - _AlphaClip: 0
+ - _AlphaToMask: 0
+ - _Blend: 0
+ - _BlendModePreserveSpecular: 1
+ - _BlendOp: 0
+ - _BumpScale: 1
+ - _ClearCoatMask: 0
+ - _ClearCoatSmoothness: 0
+ - _Cull: 2
+ - _Cutoff: 0.5
+ - _DetailAlbedoMapScale: 1
+ - _DetailNormalMapScale: 1
+ - _DstBlend: 0
+ - _DstBlendAlpha: 0
+ - _EnvironmentReflections: 1
+ - _FlashAmount: 0
+ - _GlossMapScale: 0
+ - _Glossiness: 0
+ - _GlossyReflections: 0
+ - _Metallic: 0
+ - _OcclusionStrength: 1
+ - _Parallax: 0.005
+ - _QueueOffset: 0
+ - _ReceiveShadows: 1
+ - _SampleGI: 0
+ - _Smoothness: 0.5
+ - _SmoothnessTextureChannel: 0
+ - _SpecularHighlights: 1
+ - _SrcBlend: 1
+ - _SrcBlendAlpha: 1
+ - _Surface: 0
+ - _WorkflowMode: 1
+ - _ZWrite: 1
+ m_Colors:
+ - _BaseColor: {r: 0.5, g: 0.5, b: 0.5, a: 1}
+ - _Color: {r: 1, g: 0.29245266, b: 0.29245266, a: 1}
+ - _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
+ - _FlashColor: {r: 1, g: 1, b: 1, a: 1}
+ - _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
+ m_BuildTextureStacks: []
+--- !u!114 &4582237545370899445
+MonoBehaviour:
+ m_ObjectHideFlags: 11
+ m_CorrespondingSourceObject: {fileID: 0}
+ m_PrefabInstance: {fileID: 0}
+ m_PrefabAsset: {fileID: 0}
+ m_GameObject: {fileID: 0}
+ m_Enabled: 1
+ m_EditorHideFlags: 0
+ m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
+ m_Name:
+ m_EditorClassIdentifier:
+ version: 7
diff --git a/Assets/GameMain/Scenes/MainSettings.lighting.meta b/Assets/GameMain/Materials/InstancingGrey.mat.meta
similarity index 60%
rename from Assets/GameMain/Scenes/MainSettings.lighting.meta
rename to Assets/GameMain/Materials/InstancingGrey.mat.meta
index 6d5e4b0..ab4237d 100644
--- a/Assets/GameMain/Scenes/MainSettings.lighting.meta
+++ b/Assets/GameMain/Materials/InstancingGrey.mat.meta
@@ -1,8 +1,8 @@
fileFormatVersion: 2
-guid: bd0dcd203508e774b84313644b9fad2c
+guid: 83e5fce2d1e5b3e4ab6551de03cc9c22
NativeFormatImporter:
externalObjects: {}
- mainObjectFileID: 4890085278179872738
+ mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:
diff --git a/Assets/GameMain/Materials/Red.mat b/Assets/GameMain/Materials/InstancingRed.mat
similarity index 99%
rename from Assets/GameMain/Materials/Red.mat
rename to Assets/GameMain/Materials/InstancingRed.mat
index 390f724..e590da2 100644
--- a/Assets/GameMain/Materials/Red.mat
+++ b/Assets/GameMain/Materials/InstancingRed.mat
@@ -7,7 +7,7 @@ Material:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
- m_Name: Red
+ m_Name: InstancingRed
m_Shader: {fileID: 4800000, guid: f17bc7e2694233349a8b22e96c5c43de, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
diff --git a/Assets/GameMain/Materials/Red.mat.meta b/Assets/GameMain/Materials/InstancingRed.mat.meta
similarity index 100%
rename from Assets/GameMain/Materials/Red.mat.meta
rename to Assets/GameMain/Materials/InstancingRed.mat.meta
diff --git a/Assets/GameMain/Materials/Yellow.mat b/Assets/GameMain/Materials/InstancingYellow.mat
similarity index 99%
rename from Assets/GameMain/Materials/Yellow.mat
rename to Assets/GameMain/Materials/InstancingYellow.mat
index 0c94059..ff98550 100644
--- a/Assets/GameMain/Materials/Yellow.mat
+++ b/Assets/GameMain/Materials/InstancingYellow.mat
@@ -7,7 +7,7 @@ Material:
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
- m_Name: Yellow
+ m_Name: InstancingYellow
m_Shader: {fileID: 4800000, guid: f17bc7e2694233349a8b22e96c5c43de, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
diff --git a/Assets/GameMain/Materials/Yellow.mat.meta b/Assets/GameMain/Materials/InstancingYellow.mat.meta
similarity index 100%
rename from Assets/GameMain/Materials/Yellow.mat.meta
rename to Assets/GameMain/Materials/InstancingYellow.mat.meta
diff --git a/Assets/GameMain/Scripts/Editor/DataTableGenerator.meta b/Assets/GameMain/Scenes/Game.meta
similarity index 77%
rename from Assets/GameMain/Scripts/Editor/DataTableGenerator.meta
rename to Assets/GameMain/Scenes/Game.meta
index 4c9a657..4daa879 100644
--- a/Assets/GameMain/Scripts/Editor/DataTableGenerator.meta
+++ b/Assets/GameMain/Scenes/Game.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 051868bff0e1df3498c100dc5a9f027d
+guid: 1e2a290aa42884640815cb6fd552deac
folderAsset: yes
DefaultImporter:
externalObjects: {}
diff --git a/Assets/GameMain/Scenes/Game.unity b/Assets/GameMain/Scenes/Game.unity
index b4db875..42b3eee 100644
--- a/Assets/GameMain/Scenes/Game.unity
+++ b/Assets/GameMain/Scenes/Game.unity
@@ -96,7 +96,8 @@ LightmapSettings:
m_ExportTrainingData: 0
m_TrainingDataDestination: TrainingData
m_LightProbeSampleCountMultiplier: 4
- m_LightingDataAsset: {fileID: 0}
+ m_LightingDataAsset: {fileID: 112000000, guid: fb9bd70ff25fcde4e954a6f3ec6ca2cd,
+ type: 2}
m_LightingSettings: {fileID: 0}
--- !u!196 &4
NavMeshSettings:
diff --git a/Assets/GameMain/Scenes/Game/LightingData.asset b/Assets/GameMain/Scenes/Game/LightingData.asset
new file mode 100644
index 0000000..f058418
Binary files /dev/null and b/Assets/GameMain/Scenes/Game/LightingData.asset differ
diff --git a/Assets/GameMain/Scenes/Game/LightingData.asset.meta b/Assets/GameMain/Scenes/Game/LightingData.asset.meta
new file mode 100644
index 0000000..86c47b1
--- /dev/null
+++ b/Assets/GameMain/Scenes/Game/LightingData.asset.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: fb9bd70ff25fcde4e954a6f3ec6ca2cd
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 112000000
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/GameMain/Scenes/Game/ReflectionProbe-0.exr b/Assets/GameMain/Scenes/Game/ReflectionProbe-0.exr
new file mode 100644
index 0000000..f38e702
Binary files /dev/null and b/Assets/GameMain/Scenes/Game/ReflectionProbe-0.exr differ
diff --git a/Assets/GameMain/Scenes/Game/ReflectionProbe-0.exr.meta b/Assets/GameMain/Scenes/Game/ReflectionProbe-0.exr.meta
new file mode 100644
index 0000000..821a177
--- /dev/null
+++ b/Assets/GameMain/Scenes/Game/ReflectionProbe-0.exr.meta
@@ -0,0 +1,127 @@
+fileFormatVersion: 2
+guid: 0e45b8557b1831845a6e03fce7b5aa2b
+TextureImporter:
+ internalIDToNameTable: []
+ externalObjects: {}
+ serializedVersion: 13
+ mipmaps:
+ mipMapMode: 0
+ enableMipMap: 1
+ sRGBTexture: 1
+ linearTexture: 0
+ fadeOut: 0
+ borderMipMap: 0
+ mipMapsPreserveCoverage: 0
+ alphaTestReferenceValue: 0.5
+ mipMapFadeDistanceStart: 1
+ mipMapFadeDistanceEnd: 3
+ bumpmap:
+ convertToNormalMap: 0
+ externalNormalMap: 0
+ heightScale: 0.25
+ normalMapFilter: 0
+ flipGreenChannel: 0
+ isReadable: 0
+ streamingMipmaps: 0
+ streamingMipmapsPriority: 0
+ vTOnly: 0
+ ignoreMipmapLimit: 0
+ grayScaleToAlpha: 0
+ generateCubemap: 6
+ cubemapConvolution: 1
+ seamlessCubemap: 1
+ textureFormat: 1
+ maxTextureSize: 2048
+ textureSettings:
+ serializedVersion: 2
+ filterMode: 2
+ aniso: 0
+ mipBias: 0
+ wrapU: 1
+ wrapV: 1
+ wrapW: 1
+ nPOTScale: 1
+ lightmap: 0
+ compressionQuality: 50
+ spriteMode: 0
+ spriteExtrude: 1
+ spriteMeshType: 1
+ alignment: 0
+ spritePivot: {x: 0.5, y: 0.5}
+ spritePixelsToUnits: 100
+ spriteBorder: {x: 0, y: 0, z: 0, w: 0}
+ spriteGenerateFallbackPhysicsShape: 1
+ alphaUsage: 1
+ alphaIsTransparency: 0
+ spriteTessellationDetail: -1
+ textureType: 0
+ textureShape: 2
+ singleChannelComponent: 0
+ flipbookRows: 1
+ flipbookColumns: 1
+ maxTextureSizeSet: 0
+ compressionQualitySet: 0
+ textureFormatSet: 0
+ ignorePngGamma: 0
+ applyGammaDecoding: 0
+ swizzle: 50462976
+ cookieLightType: 0
+ platformSettings:
+ - serializedVersion: 3
+ buildTarget: DefaultTexturePlatform
+ maxTextureSize: 2048
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 100
+ crunchedCompression: 0
+ allowsAlphaSplitting: 0
+ overridden: 0
+ ignorePlatformSupport: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ - serializedVersion: 3
+ buildTarget: Standalone
+ maxTextureSize: 2048
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 0
+ allowsAlphaSplitting: 0
+ overridden: 0
+ ignorePlatformSupport: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ - serializedVersion: 3
+ buildTarget: Android
+ maxTextureSize: 2048
+ resizeAlgorithm: 0
+ textureFormat: -1
+ textureCompression: 1
+ compressionQuality: 50
+ crunchedCompression: 0
+ allowsAlphaSplitting: 0
+ overridden: 0
+ ignorePlatformSupport: 0
+ androidETC2FallbackOverride: 0
+ forceMaximumCompressionQuality_BC6H_BC7: 0
+ spriteSheet:
+ serializedVersion: 2
+ sprites: []
+ outline: []
+ physicsShape: []
+ bones: []
+ spriteID:
+ internalID: 0
+ vertices: []
+ indices:
+ edges: []
+ weights: []
+ secondaryTextures: []
+ nameFileIdTable: {}
+ mipmapLimitGroupName:
+ pSDRemoveMatte: 0
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/GameMain/Scenes/MainSettings.lighting b/Assets/GameMain/Scenes/MainSettings.lighting
deleted file mode 100644
index fdc42a1..0000000
--- a/Assets/GameMain/Scenes/MainSettings.lighting
+++ /dev/null
@@ -1,66 +0,0 @@
-%YAML 1.1
-%TAG !u! tag:unity3d.com,2011:
---- !u!850595691 &4890085278179872738
-LightingSettings:
- m_ObjectHideFlags: 0
- m_CorrespondingSourceObject: {fileID: 0}
- m_PrefabInstance: {fileID: 0}
- m_PrefabAsset: {fileID: 0}
- m_Name: MainSettings
- serializedVersion: 6
- m_GIWorkflowMode: 1
- m_EnableBakedLightmaps: 1
- m_EnableRealtimeLightmaps: 0
- m_RealtimeEnvironmentLighting: 1
- m_BounceScale: 1
- m_AlbedoBoost: 1
- m_IndirectOutputScale: 1
- m_UsingShadowmask: 0
- m_BakeBackend: 0
- m_LightmapMaxSize: 1024
- m_BakeResolution: 50
- m_Padding: 2
- m_LightmapCompression: 0
- m_AO: 0
- m_AOMaxDistance: 1
- m_CompAOExponent: 0
- m_CompAOExponentDirect: 0
- m_ExtractAO: 0
- m_MixedBakeMode: 1
- m_LightmapsBakeMode: 1
- m_FilterMode: 1
- m_LightmapParameters: {fileID: 15204, guid: 0000000000000000f000000000000000, type: 0}
- m_ExportTrainingData: 0
- m_TrainingDataDestination: TrainingData
- m_RealtimeResolution: 1
- m_ForceWhiteAlbedo: 0
- m_ForceUpdates: 0
- m_FinalGather: 0
- m_FinalGatherRayCount: 1024
- m_FinalGatherFiltering: 1
- m_PVRCulling: 1
- m_PVRSampling: 1
- m_PVRDirectSampleCount: 32
- m_PVRSampleCount: 512
- m_PVREnvironmentSampleCount: 512
- m_PVREnvironmentReferencePointCount: 2048
- m_LightProbeSampleCountMultiplier: 4
- m_PVRBounces: 2
- m_PVRMinBounces: 2
- m_PVREnvironmentImportanceSampling: 0
- m_PVRFilteringMode: 0
- m_PVRDenoiserTypeDirect: 0
- m_PVRDenoiserTypeIndirect: 0
- m_PVRDenoiserTypeAO: 0
- m_PVRFilterTypeDirect: 0
- m_PVRFilterTypeIndirect: 0
- m_PVRFilterTypeAO: 0
- m_PVRFilteringGaussRadiusDirect: 1
- m_PVRFilteringGaussRadiusIndirect: 5
- m_PVRFilteringGaussRadiusAO: 2
- m_PVRFilteringAtrousPositionSigmaDirect: 0.5
- m_PVRFilteringAtrousPositionSigmaIndirect: 2
- m_PVRFilteringAtrousPositionSigmaAO: 1
- m_PVRTiledBaking: 0
- m_NumRaysToShootPerTexel: -1
- m_RespectSceneVisibilityWhenBakingGI: 0
diff --git a/Assets/GameMain/Scenes/Menu.meta b/Assets/GameMain/Scenes/Menu.meta
new file mode 100644
index 0000000..256b42b
--- /dev/null
+++ b/Assets/GameMain/Scenes/Menu.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 29930de0f940628418fed89e3808746f
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/GameMain/Scenes/Menu/LightingData.asset b/Assets/GameMain/Scenes/Menu/LightingData.asset
new file mode 100644
index 0000000..7f85015
Binary files /dev/null and b/Assets/GameMain/Scenes/Menu/LightingData.asset differ
diff --git a/Assets/GameMain/Scenes/Menu/LightingData.asset.meta b/Assets/GameMain/Scenes/Menu/LightingData.asset.meta
new file mode 100644
index 0000000..48b1d34
--- /dev/null
+++ b/Assets/GameMain/Scenes/Menu/LightingData.asset.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 6756a079a4ef9c6428b0209b454e1241
+NativeFormatImporter:
+ externalObjects: {}
+ mainObjectFileID: 112000000
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/GameMain/Scenes/StressTest/GlobalVolumeProfile.asset b/Assets/GameMain/Scenes/StressTest/GlobalVolumeProfile.asset
deleted file mode 100644
index c76f07b..0000000
--- a/Assets/GameMain/Scenes/StressTest/GlobalVolumeProfile.asset
+++ /dev/null
@@ -1,104 +0,0 @@
-%YAML 1.1
-%TAG !u! tag:unity3d.com,2011:
---- !u!114 &-32820517437979890
-MonoBehaviour:
- m_ObjectHideFlags: 3
- m_CorrespondingSourceObject: {fileID: 0}
- m_PrefabInstance: {fileID: 0}
- m_PrefabAsset: {fileID: 0}
- m_GameObject: {fileID: 0}
- m_Enabled: 1
- m_EditorHideFlags: 0
- m_Script: {fileID: 11500000, guid: 0b2db86121404754db890f4c8dfe81b2, type: 3}
- m_Name: Bloom
- m_EditorClassIdentifier:
- active: 1
- skipIterations:
- m_OverrideState: 0
- m_Value: 1
- threshold:
- m_OverrideState: 0
- m_Value: 0.9
- intensity:
- m_OverrideState: 1
- m_Value: 1
- scatter:
- m_OverrideState: 0
- m_Value: 0.7
- clamp:
- m_OverrideState: 0
- m_Value: 65472
- tint:
- m_OverrideState: 0
- m_Value: {r: 1, g: 1, b: 1, a: 1}
- highQualityFiltering:
- m_OverrideState: 0
- m_Value: 0
- downscale:
- m_OverrideState: 0
- m_Value: 0
- maxIterations:
- m_OverrideState: 0
- m_Value: 6
- dirtTexture:
- m_OverrideState: 0
- m_Value: {fileID: 0}
- dimension: 1
- dirtIntensity:
- m_OverrideState: 0
- m_Value: 0
---- !u!114 &11400000
-MonoBehaviour:
- m_ObjectHideFlags: 0
- m_CorrespondingSourceObject: {fileID: 0}
- m_PrefabInstance: {fileID: 0}
- m_PrefabAsset: {fileID: 0}
- m_GameObject: {fileID: 0}
- m_Enabled: 1
- m_EditorHideFlags: 0
- m_Script: {fileID: 11500000, guid: d7fd9488000d3734a9e00ee676215985, type: 3}
- m_Name: GlobalVolumeProfile
- m_EditorClassIdentifier:
- components:
- - {fileID: 1881579288749618558}
- - {fileID: -32820517437979890}
---- !u!114 &1881579288749618558
-MonoBehaviour:
- m_ObjectHideFlags: 3
- m_CorrespondingSourceObject: {fileID: 0}
- m_PrefabInstance: {fileID: 0}
- m_PrefabAsset: {fileID: 0}
- m_GameObject: {fileID: 0}
- m_Enabled: 1
- m_EditorHideFlags: 0
- m_Script: {fileID: 11500000, guid: 97c23e3b12dc18c42a140437e53d3951, type: 3}
- m_Name: Tonemapping
- m_EditorClassIdentifier:
- active: 1
- mode:
- m_OverrideState: 1
- m_Value: 1
- neutralHDRRangeReductionMode:
- m_OverrideState: 0
- m_Value: 2
- acesPreset:
- m_OverrideState: 0
- m_Value: 3
- hueShiftAmount:
- m_OverrideState: 0
- m_Value: 0
- detectPaperWhite:
- m_OverrideState: 0
- m_Value: 0
- paperWhite:
- m_OverrideState: 0
- m_Value: 300
- detectBrightnessLimits:
- m_OverrideState: 0
- m_Value: 1
- minNits:
- m_OverrideState: 0
- m_Value: 0.005
- maxNits:
- m_OverrideState: 0
- m_Value: 1000
diff --git a/Assets/GameMain/Scripts/Base/GameEntry.Custom.cs b/Assets/GameMain/Scripts/Base/GameEntry.Custom.cs
index d70f028..456e71c 100644
--- a/Assets/GameMain/Scripts/Base/GameEntry.Custom.cs
+++ b/Assets/GameMain/Scripts/Base/GameEntry.Custom.cs
@@ -18,6 +18,11 @@ public partial class GameEntry : MonoBehaviour
public static BuiltinDataComponent BuiltinData { get; private set; }
public static HPBarComponent HPBar { get; private set; }
+
+ public static DamageTextComponent DamageText { get; private set; }
+#if UNITY_EDITOR || DEVELOPMENT_BUILD
+ public static RuntimeDebugPanelComponent RuntimeDebugPanel { get; private set; }
+#endif
public static EnemyManagerComponent EnemyManager { get; private set; }
@@ -29,6 +34,18 @@ public partial class GameEntry : MonoBehaviour
{
BuiltinData = UnityGameFramework.Runtime.GameEntry.GetComponent();
HPBar = UnityGameFramework.Runtime.GameEntry.GetComponent();
+ DamageText = UnityGameFramework.Runtime.GameEntry.GetComponent();
+ if (DamageText == null && Base != null)
+ {
+ DamageText = Base.gameObject.AddComponent();
+ }
+#if UNITY_EDITOR || DEVELOPMENT_BUILD
+ RuntimeDebugPanel = UnityGameFramework.Runtime.GameEntry.GetComponent();
+ if (RuntimeDebugPanel == null && Base != null)
+ {
+ RuntimeDebugPanel = Base.gameObject.AddComponent();
+ }
+#endif
EnemyManager = UnityGameFramework.Runtime.GameEntry.GetComponent();
SpriteCache = UnityGameFramework.Runtime.GameEntry.GetComponent();
UIRouter = UnityGameFramework.Runtime.GameEntry.GetComponent();
diff --git a/Assets/GameMain/Scripts/Components/AbsorbComponent.cs b/Assets/GameMain/Scripts/Components/AbsorbComponent.cs
new file mode 100644
index 0000000..6c6bc7b
--- /dev/null
+++ b/Assets/GameMain/Scripts/Components/AbsorbComponent.cs
@@ -0,0 +1,101 @@
+using System;
+using Definition.DataStruct;
+using Definition.Enum;
+using Entity;
+using UnityEngine;
+
+namespace Components
+{
+ public class AbsorbComponent : MonoBehaviour
+ {
+ [SerializeField] private float _absorbRangeBase = 3f;
+ [SerializeField] private float _absorbSpeed = 15f;
+ [SerializeField] private float _collectDistance = 0.35f;
+ [SerializeField] private int _maxDetectCount = 64;
+ [SerializeField] private LayerMask _detectLayerMask = ~0;
+
+ private Player _player;
+ private Transform _target;
+ private StatComponent _statComponent;
+ private Collider[] _buffer;
+
+ private StatProperty _absorbRangeStat;
+ private Action _absorbRangeStatCallback;
+
+ private float AbsorbRange => Mathf.Max(0f, (_absorbRangeBase + _absorbRangeStat.Value) * _absorbRangeStat.Percent);
+
+ public void OnInit(Player player, StatComponent statComponent = null)
+ {
+ _player = player;
+ _target = player != null ? player.CachedTransform : null;
+ _statComponent = statComponent;
+ _buffer = new Collider[Mathf.Max(1, _maxDetectCount)];
+
+ if (_statComponent != null)
+ {
+ _absorbRangeStat = _statComponent.GetStat(StatType.AbsorbRange);
+ _absorbRangeStatCallback = (modifier, isApply) =>
+ _statComponent.UpdateStat(_absorbRangeStat, modifier, isApply);
+ _statComponent.Subscribe(StatType.AbsorbRange, _absorbRangeStatCallback);
+ }
+ else
+ {
+ _absorbRangeStat = new StatProperty();
+ }
+ }
+
+ public void OnUpdate(float elapseSeconds, float realElapseSeconds)
+ {
+ if (_player == null || !_player.Available || _target == null || _buffer == null) return;
+
+ int hitCount = Physics.OverlapSphereNonAlloc(
+ _target.position,
+ AbsorbRange,
+ _buffer,
+ _detectLayerMask,
+ QueryTriggerInteraction.Collide
+ );
+
+ for (int i = 0; i < hitCount; i++)
+ {
+ Collider hit = _buffer[i];
+ if (hit == null) continue;
+
+ CoinEntity coin = hit.GetComponent();
+ if (coin != null && coin.Available)
+ {
+ AbsorbDrop(coin.CachedTransform, elapseSeconds);
+ coin.TryCollect(_player, _collectDistance);
+ continue;
+ }
+
+ ExpEntity exp = hit.GetComponent();
+ if (exp != null && exp.Available)
+ {
+ AbsorbDrop(exp.CachedTransform, elapseSeconds);
+ exp.TryCollect(_player, _collectDistance);
+ }
+ }
+ }
+
+ public void OnReset()
+ {
+ if (_statComponent != null)
+ {
+ _statComponent.Unsubscribe(StatType.AbsorbRange, _absorbRangeStatCallback);
+ _absorbRangeStatCallback = null;
+ }
+
+ _statComponent = null;
+ _target = null;
+ _player = null;
+ _buffer = null;
+ }
+
+ private void AbsorbDrop(Transform drop, float deltaTime)
+ {
+ if (drop == null || _target == null) return;
+ drop.position = Vector3.MoveTowards(drop.position, _target.position, _absorbSpeed * deltaTime);
+ }
+ }
+}
diff --git a/Assets/GameMain/Scripts/Editor/DataTableGenerator/DataTableCodeGenerator.cs.meta b/Assets/GameMain/Scripts/Components/AbsorbComponent.cs.meta
similarity index 83%
rename from Assets/GameMain/Scripts/Editor/DataTableGenerator/DataTableCodeGenerator.cs.meta
rename to Assets/GameMain/Scripts/Components/AbsorbComponent.cs.meta
index 9c867cf..0d15fec 100644
--- a/Assets/GameMain/Scripts/Editor/DataTableGenerator/DataTableCodeGenerator.cs.meta
+++ b/Assets/GameMain/Scripts/Components/AbsorbComponent.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 40941eb45ca7d284f8a806370b88fa78
+guid: 46f46350fed64d8389ebb4ae72b65796
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Assets/GameMain/Scripts/Components/HealthComponent.cs b/Assets/GameMain/Scripts/Components/HealthComponent.cs
index 26aca1e..5aad635 100644
--- a/Assets/GameMain/Scripts/Components/HealthComponent.cs
+++ b/Assets/GameMain/Scripts/Components/HealthComponent.cs
@@ -1,4 +1,4 @@
-using System;
+using System;
using CustomEvent;
using Definition.DataStruct;
using Definition.Enum;
@@ -119,7 +119,9 @@ namespace Components
private void CauseDamage(int damage)
{
- //TODO:受击效果:跳字、粒子
+ if (damage <= 0 || GameEntry.DamageText == null) return;
+ GameEntry.DamageText.ShowDamage(transform.position + Vector3.up * 1.1f, damage);
}
}
-}
\ No newline at end of file
+}
+
diff --git a/Assets/GameMain/Scripts/CustomComponent/DamageText.meta b/Assets/GameMain/Scripts/CustomComponent/DamageText.meta
new file mode 100644
index 0000000..814975c
--- /dev/null
+++ b/Assets/GameMain/Scripts/CustomComponent/DamageText.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: 6befdfdd5f3e430a864a90bf445000e8
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/GameMain/Scripts/CustomComponent/DamageText/DamageTextComponent.cs b/Assets/GameMain/Scripts/CustomComponent/DamageText/DamageTextComponent.cs
new file mode 100644
index 0000000..86efb80
--- /dev/null
+++ b/Assets/GameMain/Scripts/CustomComponent/DamageText/DamageTextComponent.cs
@@ -0,0 +1,67 @@
+using System.Collections.Generic;
+using GameFramework.ObjectPool;
+using TMPro;
+using UnityEngine;
+using UnityEngine.UI;
+using UnityGameFramework.Runtime;
+
+namespace CustomComponent
+{
+ public class DamageTextComponent : GameFrameworkComponent
+ {
+ [SerializeField] private int _instancePoolCapacity = 32;
+
+ [SerializeField] private string _poolName = "DamageTextItem";
+
+ [SerializeField] private RectTransform _instanceRoot;
+
+ [SerializeField] private Canvas _canvas;
+
+ [SerializeField] private GameObject _damageTextItemPrefab;
+
+ private IObjectPool _damageTextItemPool;
+
+ private readonly List _activeDamageTextItems = new();
+
+ private void Start()
+ {
+ _damageTextItemPool =
+ GameEntry.ObjectPool.CreateSingleSpawnObjectPool(_poolName,
+ _instancePoolCapacity);
+ }
+
+ public void ShowDamage(Vector3 worldPosition, int damage)
+ {
+ if (damage <= 0 || _damageTextItemPool == null || _canvas == null) return;
+
+ DamageTextItem item = CreateDamageTextItem();
+ if (item == null) return;
+
+ item.Show(worldPosition, damage, _canvas, OnItemComplete);
+ _activeDamageTextItems.Add(item);
+ }
+
+ private DamageTextItem CreateDamageTextItem()
+ {
+ DamageTextItemObject itemObject = _damageTextItemPool.Spawn();
+ if (itemObject != null)
+ {
+ return (DamageTextItem)itemObject.Target;
+ }
+
+ GameObject itemGo = Instantiate(_damageTextItemPrefab, _instanceRoot, false);
+
+ DamageTextItem item = itemGo.GetComponent();
+ _damageTextItemPool.Register(DamageTextItemObject.Create(item), true);
+ return item;
+ }
+
+ private void OnItemComplete(DamageTextItem item)
+ {
+ if (item == null) return;
+ item.ResetItem();
+ _activeDamageTextItems.Remove(item);
+ _damageTextItemPool.Unspawn(item);
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/GameMain/Scripts/Editor/DataTableGenerator/DataTableGenerator.cs.meta b/Assets/GameMain/Scripts/CustomComponent/DamageText/DamageTextComponent.cs.meta
similarity index 83%
rename from Assets/GameMain/Scripts/Editor/DataTableGenerator/DataTableGenerator.cs.meta
rename to Assets/GameMain/Scripts/CustomComponent/DamageText/DamageTextComponent.cs.meta
index 37a8f2f..ff14999 100644
--- a/Assets/GameMain/Scripts/Editor/DataTableGenerator/DataTableGenerator.cs.meta
+++ b/Assets/GameMain/Scripts/CustomComponent/DamageText/DamageTextComponent.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: f91ec109eb6c73a408325960701b4c94
+guid: 366eb88b821a4048891b7fb01a1b8d42
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Assets/GameMain/Scripts/CustomComponent/DamageText/DamageTextItem.cs b/Assets/GameMain/Scripts/CustomComponent/DamageText/DamageTextItem.cs
new file mode 100644
index 0000000..21ea3c4
--- /dev/null
+++ b/Assets/GameMain/Scripts/CustomComponent/DamageText/DamageTextItem.cs
@@ -0,0 +1,80 @@
+using System;
+using DG.Tweening;
+using TMPro;
+using UnityEngine;
+
+namespace CustomComponent
+{
+ public class DamageTextItem : MonoBehaviour
+ {
+ private const float RiseDistance = 80f;
+ private const float RiseDuration = 0.55f;
+ private const float FadeDelay = 0.2f;
+ private const float FadeDuration = 0.35f;
+ private static readonly Color NormalColor = new Color(1f, 0.32f, 0.23f, 1f);
+
+ [SerializeField] private RectTransform _cachedTransform;
+
+ [SerializeField] private CanvasGroup _canvasGroup;
+
+ [SerializeField] private TMP_Text _text;
+
+ private Sequence _sequence;
+ private Action _onComplete;
+
+ private void Awake()
+ {
+ if (_cachedTransform == null) _cachedTransform = GetComponent();
+ if (_canvasGroup == null) _canvasGroup = GetComponent();
+ if (_text == null) _text = GetComponent();
+ }
+
+ public void Show(Vector3 worldPosition, int damage, Canvas canvas, Action onComplete)
+ {
+ if (canvas == null || GameEntry.Scene.MainCamera == null) return;
+
+ _onComplete = onComplete;
+ gameObject.SetActive(true);
+ KillSequence();
+
+ _canvasGroup.alpha = 1f;
+ _cachedTransform.localScale = Vector3.one;
+ _text.color = NormalColor;
+ _text.text = damage.ToString();
+
+ Vector3 screenPos = GameEntry.Scene.MainCamera.WorldToScreenPoint(worldPosition);
+ RectTransformUtility.ScreenPointToLocalPointInRectangle((RectTransform)canvas.transform, screenPos,
+ canvas.worldCamera, out Vector2 localPos);
+ localPos.x += UnityEngine.Random.Range(-24f, 24f);
+ _cachedTransform.anchoredPosition = localPos;
+
+ _sequence = DOTween.Sequence();
+ _sequence.Append(_cachedTransform.DOAnchorPosY(localPos.y + RiseDistance, RiseDuration)
+ .SetEase(Ease.OutQuad));
+ _sequence.Join(_cachedTransform.DOPunchScale(new Vector3(0.15f, 0.15f, 0f), 0.18f, 6, 0.75f));
+ _sequence.Join(_canvasGroup.DOFade(0f, FadeDuration).SetDelay(FadeDelay));
+ _sequence.OnComplete(() => _onComplete?.Invoke(this));
+ }
+
+ public void ResetItem()
+ {
+ KillSequence();
+ _onComplete = null;
+ _canvasGroup.alpha = 1f;
+ _text.text = string.Empty;
+ gameObject.SetActive(false);
+ }
+
+ private void OnDestroy()
+ {
+ KillSequence();
+ }
+
+ private void KillSequence()
+ {
+ if (_sequence == null) return;
+ _sequence.Kill();
+ _sequence = null;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Assets/GameMain/Scripts/Editor/DataTableGenerator/DataTableGeneratorMenu.cs.meta b/Assets/GameMain/Scripts/CustomComponent/DamageText/DamageTextItem.cs.meta
similarity index 83%
rename from Assets/GameMain/Scripts/Editor/DataTableGenerator/DataTableGeneratorMenu.cs.meta
rename to Assets/GameMain/Scripts/CustomComponent/DamageText/DamageTextItem.cs.meta
index 9c5322f..552af7c 100644
--- a/Assets/GameMain/Scripts/Editor/DataTableGenerator/DataTableGeneratorMenu.cs.meta
+++ b/Assets/GameMain/Scripts/CustomComponent/DamageText/DamageTextItem.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 7ddc8f13b2516c643a67d92a319dbf72
+guid: 501e678f9cb14af6ac45e8d2050388d3
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Assets/GameMain/Scripts/CustomComponent/DamageText/DamageTextItemObject.cs b/Assets/GameMain/Scripts/CustomComponent/DamageText/DamageTextItemObject.cs
new file mode 100644
index 0000000..3ff5800
--- /dev/null
+++ b/Assets/GameMain/Scripts/CustomComponent/DamageText/DamageTextItemObject.cs
@@ -0,0 +1,23 @@
+using GameFramework;
+using GameFramework.ObjectPool;
+using UnityEngine;
+
+namespace CustomComponent
+{
+ public class DamageTextItemObject : ObjectBase
+ {
+ public static DamageTextItemObject Create(object target)
+ {
+ DamageTextItemObject itemObject = ReferencePool.Acquire();
+ itemObject.Initialize(target);
+ return itemObject;
+ }
+
+ protected override void Release(bool isShutdown)
+ {
+ DamageTextItem item = (DamageTextItem)Target;
+ if (item == null) return;
+ Object.Destroy(item.gameObject);
+ }
+ }
+}
diff --git a/Assets/GameMain/Scripts/Editor/DataTableGenerator/DataTableProcessor.BooleanProcessor.cs.meta b/Assets/GameMain/Scripts/CustomComponent/DamageText/DamageTextItemObject.cs.meta
similarity index 83%
rename from Assets/GameMain/Scripts/Editor/DataTableGenerator/DataTableProcessor.BooleanProcessor.cs.meta
rename to Assets/GameMain/Scripts/CustomComponent/DamageText/DamageTextItemObject.cs.meta
index 1c86b4f..8fb6ccb 100644
--- a/Assets/GameMain/Scripts/Editor/DataTableGenerator/DataTableProcessor.BooleanProcessor.cs.meta
+++ b/Assets/GameMain/Scripts/CustomComponent/DamageText/DamageTextItemObject.cs.meta
@@ -1,5 +1,5 @@
fileFormatVersion: 2
-guid: 00bc8bc968fa2134095a36a43f326d56
+guid: 4aba1230dece448eba1fa7579ca7a13d
MonoImporter:
externalObjects: {}
serializedVersion: 2
diff --git a/Assets/GameMain/Scripts/CustomComponent/DebugPanel.meta b/Assets/GameMain/Scripts/CustomComponent/DebugPanel.meta
new file mode 100644
index 0000000..38c84e7
--- /dev/null
+++ b/Assets/GameMain/Scripts/CustomComponent/DebugPanel.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: a11ef2e359b24bfdb6c9120cc2ec81b8
+folderAsset: yes
+DefaultImporter:
+ externalObjects: {}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/GameMain/Scripts/CustomComponent/DebugPanel/RuntimeDebugPanelComponent.cs b/Assets/GameMain/Scripts/CustomComponent/DebugPanel/RuntimeDebugPanelComponent.cs
new file mode 100644
index 0000000..06228ed
--- /dev/null
+++ b/Assets/GameMain/Scripts/CustomComponent/DebugPanel/RuntimeDebugPanelComponent.cs
@@ -0,0 +1,349 @@
+#if UNITY_EDITOR || DEVELOPMENT_BUILD
+using System;
+using System.Linq;
+using DataTable;
+using Definition.DataStruct;
+using Entity;
+using Game.Utility;
+using UnityEngine;
+using UnityGameFramework.Runtime;
+#if ENABLE_INPUT_SYSTEM
+using UnityEngine.InputSystem;
+#endif
+
+namespace CustomComponent
+{
+ public class RuntimeDebugPanelComponent : GameFrameworkComponent
+ {
+ private const float MinSpawnRate = 0.1f;
+ private const float CornerTapWindow = 0.6f;
+ private const int RequiredCornerTapCount = 3;
+
+ private Rect _windowRect = new Rect(20f, 60f, 460f, 620f);
+ private bool _isPanelVisible;
+ private int _windowId;
+
+ private string _searchText = string.Empty;
+ private int _selectedIndex;
+ private int _addCount = 1;
+ private Vector2 _buffScroll;
+
+ private float _spawnRateScaleInput = 1f;
+ private float _extendDurationSeconds = 30f;
+
+ private DRProp[] _allProps = Array.Empty();
+ private DRProp[] _filteredProps = Array.Empty();
+ private string[] _displayNames = Array.Empty();
+
+ private int _cornerTapCount;
+ private float _lastCornerTapTime = -10f;
+
+ protected override void Awake()
+ {
+ base.Awake();
+
+ _windowId = GetInstanceID();
+ }
+
+ private void Update()
+ {
+ if (IsTogglePressed())
+ {
+ _isPanelVisible = !_isPanelVisible;
+ }
+
+ HandleCornerTapGesture();
+ }
+
+ private void OnGUI()
+ {
+ DrawToggleButton();
+ if (!_isPanelVisible) return;
+
+ _windowRect = GUI.Window(_windowId, _windowRect, DrawWindow, "Runtime Debug Panel");
+ }
+
+ private void DrawToggleButton()
+ {
+ const float width = 64f;
+ const float height = 30f;
+ Rect buttonRect = new Rect(Screen.width - width - 12f, 10f, width, height);
+ if (GUI.Button(buttonRect, "DEBUG"))
+ {
+ _isPanelVisible = !_isPanelVisible;
+ }
+ }
+
+ private void DrawWindow(int windowId)
+ {
+ EnsurePropList();
+
+ GUILayout.BeginVertical();
+
+ DrawBuffSection();
+
+ GUILayout.Space(8f);
+ GUILayout.Label(string.Empty, GUI.skin.horizontalSlider);
+ GUILayout.Space(8f);
+
+ DrawBattleSection();
+
+ GUILayout.Space(8f);
+ GUILayout.Label("Tips: press `F8` or tap top-left corner 3 times to toggle.", GUILayout.Height(20f));
+
+ GUILayout.EndVertical();
+ GUI.DragWindow(new Rect(0, 0, 10000, 22));
+ }
+
+ private void DrawBuffSection()
+ {
+ GUILayout.Label("Buff Debug");
+ GUILayout.BeginHorizontal();
+ GUILayout.Label("Search", GUILayout.Width(52f));
+ _searchText = GUILayout.TextField(_searchText);
+ if (GUILayout.Button("Refresh", GUILayout.Width(80f)))
+ {
+ EnsurePropList(true);
+ }
+ GUILayout.EndHorizontal();
+
+ ApplyFilter(_searchText);
+ if (_displayNames.Length == 0)
+ {
+ GUILayout.Label("No Buff data. Enter battle and try again.");
+ return;
+ }
+
+ _selectedIndex = Mathf.Clamp(_selectedIndex, 0, _displayNames.Length - 1);
+ _buffScroll = GUILayout.BeginScrollView(_buffScroll, GUILayout.Height(120f));
+ _selectedIndex = GUILayout.SelectionGrid(_selectedIndex, _displayNames, 1);
+ GUILayout.EndScrollView();
+
+ DRProp selectedProp = GetSelectedProp();
+ if (selectedProp == null) return;
+
+ GUILayout.Label($"Selected: {selectedProp.Title} ({selectedProp.Rarity})");
+ GUILayout.Label(ItemDescUtility.CreatePropDescription(selectedProp.Modifiers), GUILayout.Height(40f));
+
+ GUILayout.BeginHorizontal();
+ GUILayout.Label("Count", GUILayout.Width(52f));
+ string addCountText = GUILayout.TextField(_addCount.ToString(), GUILayout.Width(60f));
+ if (!int.TryParse(addCountText, out _addCount)) _addCount = 1;
+ _addCount = Mathf.Clamp(_addCount, 1, 99);
+
+ if (GUILayout.Button("Add Buff To Player", GUILayout.Height(24f)))
+ {
+ AddSelectedBuffToPlayer(selectedProp, _addCount);
+ }
+ GUILayout.EndHorizontal();
+ }
+
+ private void DrawBattleSection()
+ {
+ GUILayout.Label("Battle Debug");
+ EnemyManagerComponent enemyManager = GameEntry.EnemyManager;
+ Player player = FindPlayer();
+
+ if (enemyManager == null)
+ {
+ GUILayout.Label("EnemyManager unavailable.");
+ return;
+ }
+
+ GUILayout.Label($"Spawn Rate: {enemyManager.SpawnRateScale:F2}");
+ GUILayout.Label($"Battle Time: {enemyManager.ElapsedBattleTime:F1}s / {enemyManager.BattleDuration:F1}s");
+
+ GUILayout.BeginHorizontal();
+ GUILayout.Label("Rate", GUILayout.Width(52f));
+ string rateText = GUILayout.TextField(_spawnRateScaleInput.ToString("F2"), GUILayout.Width(60f));
+ if (float.TryParse(rateText, out float parsedRate))
+ {
+ _spawnRateScaleInput = Mathf.Clamp(parsedRate, MinSpawnRate, 50f);
+ }
+
+ if (GUILayout.Button("Apply", GUILayout.Width(70f)))
+ {
+ enemyManager.SetSpawnRateScale(_spawnRateScaleInput);
+ }
+ if (GUILayout.Button("x0.5", GUILayout.Width(60f)))
+ {
+ _spawnRateScaleInput = Mathf.Max(MinSpawnRate, enemyManager.SpawnRateScale * 0.5f);
+ enemyManager.SetSpawnRateScale(_spawnRateScaleInput);
+ }
+ if (GUILayout.Button("x2", GUILayout.Width(60f)))
+ {
+ _spawnRateScaleInput = enemyManager.SpawnRateScale * 2f;
+ enemyManager.SetSpawnRateScale(_spawnRateScaleInput);
+ }
+ GUILayout.EndHorizontal();
+
+ GUILayout.BeginHorizontal();
+ GUILayout.Label("Add Sec", GUILayout.Width(52f));
+ string durationText = GUILayout.TextField(_extendDurationSeconds.ToString("F0"), GUILayout.Width(60f));
+ if (float.TryParse(durationText, out float parsedDuration))
+ {
+ _extendDurationSeconds = Mathf.Clamp(parsedDuration, 1f, 3600f);
+ }
+
+ if (GUILayout.Button("Extend Battle", GUILayout.Height(24f)))
+ {
+ enemyManager.AddBattleDuration(_extendDurationSeconds);
+ }
+ GUILayout.EndHorizontal();
+
+ GUILayout.Label($"Player Weapon: {(player == null ? "Player not found" : (player.WeaponEnabled ? "Enabled" : "Disabled"))}");
+ GUILayout.BeginHorizontal();
+ GUI.enabled = player != null;
+ if (GUILayout.Button("Disable Weapons", GUILayout.Height(24f)))
+ {
+ player.SetWeaponEnabled(false);
+ }
+ if (GUILayout.Button("Enable Weapons", GUILayout.Height(24f)))
+ {
+ player.SetWeaponEnabled(true);
+ }
+ GUI.enabled = true;
+ GUILayout.EndHorizontal();
+ }
+
+ private void EnsurePropList(bool force = false)
+ {
+ if (!force && _allProps != null && _allProps.Length > 0) return;
+
+ if (GameEntry.DataTable == null)
+ {
+ _allProps = Array.Empty();
+ _filteredProps = Array.Empty();
+ _displayNames = Array.Empty();
+ return;
+ }
+
+ var table = GameEntry.DataTable.GetDataTable();
+ _allProps = table != null ? table.ToArray() : Array.Empty();
+ _selectedIndex = Mathf.Clamp(_selectedIndex, 0, Mathf.Max(0, _allProps.Length - 1));
+ ApplyFilter(_searchText);
+ }
+
+ private void ApplyFilter(string keyword)
+ {
+ if (_allProps == null || _allProps.Length == 0)
+ {
+ _filteredProps = Array.Empty();
+ _displayNames = Array.Empty();
+ return;
+ }
+
+ if (string.IsNullOrWhiteSpace(keyword))
+ {
+ _filteredProps = _allProps;
+ }
+ else
+ {
+ string search = keyword.Trim();
+ _filteredProps = _allProps.Where(p =>
+ p != null &&
+ (p.Title?.IndexOf(search, StringComparison.OrdinalIgnoreCase) >= 0 ||
+ p.Id.ToString().Contains(search))).ToArray();
+ }
+
+ _displayNames = _filteredProps.Select(p => $"[{p.Id}] {p.Title} ({p.Rarity})").ToArray();
+ if (_displayNames.Length == 0) _selectedIndex = 0;
+ else _selectedIndex = Mathf.Clamp(_selectedIndex, 0, _displayNames.Length - 1);
+ }
+
+ private DRProp GetSelectedProp()
+ {
+ if (_filteredProps == null || _filteredProps.Length == 0) return null;
+ _selectedIndex = Mathf.Clamp(_selectedIndex, 0, _filteredProps.Length - 1);
+ return _filteredProps[_selectedIndex];
+ }
+
+ private static Player FindPlayer()
+ {
+ return UnityEngine.Object.FindObjectOfType();
+ }
+
+ private static void AddSelectedBuffToPlayer(DRProp prop, int count)
+ {
+ Player player = FindPlayer();
+ if (player == null || prop == null || prop.Modifiers == null) return;
+
+ int applyCount = Mathf.Clamp(count, 1, 99);
+ for (int i = 0; i < applyCount; i++)
+ {
+ player.AddProp(new PropItem(prop.Modifiers, prop.Rarity, prop.Title, prop.IconAssetName));
+ }
+ }
+
+ private void HandleCornerTapGesture()
+ {
+ if (!TryGetTouchReleased(out Vector2 touchPosition)) return;
+ if (touchPosition.x > 80f || touchPosition.y < Screen.height - 80f) return;
+
+ float now = Time.unscaledTime;
+ if (now - _lastCornerTapTime > CornerTapWindow)
+ {
+ _cornerTapCount = 0;
+ }
+
+ _lastCornerTapTime = now;
+ _cornerTapCount++;
+
+ if (_cornerTapCount >= RequiredCornerTapCount)
+ {
+ _cornerTapCount = 0;
+ _isPanelVisible = !_isPanelVisible;
+ }
+ }
+
+ private static bool IsTogglePressed()
+ {
+#if ENABLE_INPUT_SYSTEM
+ Keyboard keyboard = Keyboard.current;
+ if (keyboard == null) return false;
+ return keyboard.backquoteKey.wasPressedThisFrame || keyboard.f8Key.wasPressedThisFrame;
+#else
+ return Input.GetKeyDown(KeyCode.BackQuote) || Input.GetKeyDown(KeyCode.F8);
+#endif
+ }
+
+ private static bool TryGetTouchReleased(out Vector2 touchPosition)
+ {
+#if ENABLE_INPUT_SYSTEM
+ Touchscreen touchscreen = Touchscreen.current;
+ if (touchscreen == null)
+ {
+ touchPosition = default;
+ return false;
+ }
+
+ var touch = touchscreen.primaryTouch;
+ if (!touch.press.wasReleasedThisFrame)
+ {
+ touchPosition = default;
+ return false;
+ }
+
+ touchPosition = touch.position.ReadValue();
+ return true;
+#else
+ if (Input.touchCount <= 0)
+ {
+ touchPosition = default;
+ return false;
+ }
+
+ Touch touch = Input.GetTouch(0);
+ if (touch.phase != TouchPhase.Ended)
+ {
+ touchPosition = default;
+ return false;
+ }
+
+ touchPosition = touch.position;
+ return true;
+#endif
+ }
+ }
+}
+#endif
diff --git a/Assets/GameMain/Scripts/CustomComponent/DebugPanel/RuntimeDebugPanelComponent.cs.meta b/Assets/GameMain/Scripts/CustomComponent/DebugPanel/RuntimeDebugPanelComponent.cs.meta
new file mode 100644
index 0000000..c9a928c
--- /dev/null
+++ b/Assets/GameMain/Scripts/CustomComponent/DebugPanel/RuntimeDebugPanelComponent.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1d8ada5157a04921a6e543a040e57960
+MonoImporter:
+ externalObjects: {}
+ serializedVersion: 2
+ defaultReferences: []
+ executionOrder: 0
+ icon: {instanceID: 0}
+ userData:
+ assetBundleName:
+ assetBundleVariant:
diff --git a/Assets/GameMain/Scripts/CustomComponent/EnemyManager/EnemyManagerComponent.cs b/Assets/GameMain/Scripts/CustomComponent/EnemyManager/EnemyManagerComponent.cs
index 0110d03..b6e81a4 100644
--- a/Assets/GameMain/Scripts/CustomComponent/EnemyManager/EnemyManagerComponent.cs
+++ b/Assets/GameMain/Scripts/CustomComponent/EnemyManager/EnemyManagerComponent.cs
@@ -13,6 +13,8 @@ namespace CustomComponent
{
public class EnemyManagerComponent : GameFrameworkComponent
{
+ private const float MinSpawnRateScale = 0.1f;
+
private EntityComponent _entity;
private List _enemies;
@@ -20,23 +22,35 @@ namespace CustomComponent
public List Enemies => _enemies;
private float _spawnEnemyTimer;
+
private int _spawnEnemyMaxCount = 5000;
+
private int _currentEnemyCount;
+
private int _spawnDistanceFromPlayer = 20;
+
private int _currentSpawnEnemyId;
+
private int _currentLevel;
+ private float[] _baseSpawnEnemyIntervals;
private float[] _spawnEnemyIntervals;
private int[] _spawnEnemyIds;
private int[] _spawnEnemyCounts;
private float _duration;
+ private float _baseDuration;
private float[] _nextSpawnTimes;
+ private float _spawnRateScale = 1f;
private Transform _player;
private GameStateBattle _battle;
+ public float SpawnRateScale => _spawnRateScale;
+ public float BattleDuration => _duration;
+ public float ElapsedBattleTime => _spawnEnemyTimer;
+
#region FSM
private void Start()
@@ -64,12 +78,14 @@ namespace CustomComponent
_currentLevel = level;
DRLevel levelData = GameEntry.DataTable.GetDataTableRow(_currentLevel);
- _spawnEnemyIntervals = levelData.Intervals;
+ _baseSpawnEnemyIntervals = (float[])levelData.Intervals.Clone();
+ _spawnEnemyIntervals = (float[])_baseSpawnEnemyIntervals.Clone();
_spawnEnemyIds = levelData.EntityIds;
_spawnEnemyCounts = levelData.EntityCounts;
- _duration = levelData.Duration;
+ _baseDuration = levelData.Duration;
+ _duration = _baseDuration;
- _nextSpawnTimes = (float[])_spawnEnemyIntervals.Clone();
+ SetSpawnRateScale(_spawnRateScale);
_currentSpawnEnemyId = 0;
}
@@ -77,10 +93,7 @@ namespace CustomComponent
public void OnUpdate(float elapseSeconds, float realElapseSeconds)
{
_spawnEnemyTimer += elapseSeconds;
- // if (_spawnEnemyTimer < _spawnEnemyInterval) return;
- // SpawnEnemy();
- // _spawnEnemyTimer = 0;
- // _spawnEnemyInterval = Mathf.Max(0.1f, _spawnEnemyInterval - _spawnEnemyAccelerate);
+
if (_spawnEnemyTimer > _duration)
{
_battle.LevelOver();
@@ -108,9 +121,11 @@ namespace CustomComponent
_currentSpawnEnemyId = 0;
_currentLevel = 0;
+ _baseSpawnEnemyIntervals = null;
_spawnEnemyIntervals = null;
_spawnEnemyIds = null;
_spawnEnemyCounts = null;
+ _baseDuration = 0;
_duration = 0;
_nextSpawnTimes = null;
@@ -120,6 +135,57 @@ namespace CustomComponent
ClearEnemies();
}
+ public void SetSpawnRateScale(float scale)
+ {
+ float newScale = Mathf.Max(MinSpawnRateScale, scale);
+ if (_baseSpawnEnemyIntervals == null || _baseSpawnEnemyIntervals.Length == 0)
+ {
+ _spawnRateScale = newScale;
+ return;
+ }
+
+ bool hasRuntimeState = _nextSpawnTimes != null && _spawnEnemyIntervals != null &&
+ _nextSpawnTimes.Length == _baseSpawnEnemyIntervals.Length &&
+ _spawnEnemyIntervals.Length == _baseSpawnEnemyIntervals.Length;
+ float oldScale = _spawnRateScale;
+ _spawnRateScale = newScale;
+
+ if (!hasRuntimeState)
+ {
+ for (int i = 0; i < _baseSpawnEnemyIntervals.Length; i++)
+ {
+ _spawnEnemyIntervals[i] = GetScaledInterval(_baseSpawnEnemyIntervals[i], _spawnRateScale);
+ }
+
+ _nextSpawnTimes = (float[])_spawnEnemyIntervals.Clone();
+ return;
+ }
+
+ for (int i = 0; i < _baseSpawnEnemyIntervals.Length; i++)
+ {
+ float oldInterval = GetScaledInterval(_baseSpawnEnemyIntervals[i], oldScale);
+ float newInterval = GetScaledInterval(_baseSpawnEnemyIntervals[i], _spawnRateScale);
+
+ float remainTime = Mathf.Max(0f, _nextSpawnTimes[i] - _spawnEnemyTimer);
+ float remainRatio = oldInterval > Mathf.Epsilon ? Mathf.Clamp01(remainTime / oldInterval) : 0f;
+
+ _spawnEnemyIntervals[i] = newInterval;
+ _nextSpawnTimes[i] = _spawnEnemyTimer + newInterval * remainRatio;
+ }
+ }
+
+ public void AddBattleDuration(float seconds)
+ {
+ if (seconds <= 0f) return;
+ _duration += seconds;
+ }
+
+ private static float GetScaledInterval(float baseInterval, float scale)
+ {
+ float safeScale = Mathf.Max(MinSpawnRateScale, scale);
+ return baseInterval / safeScale;
+ }
+
#endregion
private void SpawnEnemy(int entityId)
@@ -128,7 +194,7 @@ namespace CustomComponent
if (_currentEnemyCount >= _spawnEnemyMaxCount) return;
int entityPoolId = _currentSpawnEnemyId % _spawnEnemyMaxCount;
- var enemyData = new EnemyData(entityPoolId, entityId)
+ var enemyData = new EnemyData(entityPoolId, entityId, _currentLevel)
{
Position = GetRandomPosition()
};
@@ -187,4 +253,4 @@ namespace CustomComponent
#endregion
}
-}
\ No newline at end of file
+}
diff --git a/Assets/GameMain/Scripts/CustomComponent/HPBar/HPBarComponent.cs b/Assets/GameMain/Scripts/CustomComponent/HPBar/HPBarComponent.cs
index ebc7833..dbcbc64 100644
--- a/Assets/GameMain/Scripts/CustomComponent/HPBar/HPBarComponent.cs
+++ b/Assets/GameMain/Scripts/CustomComponent/HPBar/HPBarComponent.cs
@@ -17,14 +17,11 @@ namespace CustomComponent
{
public class HPBarComponent : GameFrameworkComponent
{
- [FormerlySerializedAs("m_HPBarItemTemplate")] [SerializeField]
- private HPBarItem _hpBarItemTemplate = null;
+ [SerializeField] private HPBarItem _hpBarItemTemplate = null;
- [FormerlySerializedAs("m_HPBarInstanceRoot")] [SerializeField]
- private Transform _hpBarInstanceRoot = null;
+ [SerializeField] private Transform _hpBarInstanceRoot = null;
- [FormerlySerializedAs("m_InstancePoolCapacity")] [SerializeField]
- private int _instancePoolCapacity = 16;
+ [SerializeField] private int _instancePoolCapacity = 16;
private IObjectPool _hpBarItemObjectPool = null;
private List _activeHPBarItems = null;
@@ -39,7 +36,8 @@ namespace CustomComponent
}
_cachedCanvas = _hpBarInstanceRoot.GetComponent