优化背景shader表现

This commit is contained in:
ALIENJACK\alien 2024-11-14 19:25:44 +08:00
parent 4ca053f624
commit df32ff6a3a
7 changed files with 93 additions and 16 deletions

View File

@ -108,6 +108,8 @@ GameObject:
- component: {fileID: 1315151990470629735}
- component: {fileID: 5089554718053375447}
- component: {fileID: 7896211045508186424}
- component: {fileID: 46877084639177849}
- component: {fileID: 8225225246167167684}
m_Layer: 5
m_Name: bg
m_TagString: Untagged
@ -175,7 +177,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
m_Material: {fileID: 0}
m_Color: {r: 0, g: 0, b: 0, a: 0.5176471}
m_Color: {r: 1, g: 1, b: 1, a: 0.5019608}
m_RaycastTarget: 1
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
@ -192,6 +194,42 @@ MonoBehaviour:
m_FillOrigin: 0
m_UseSpriteMesh: 0
m_PixelsPerUnitMultiplier: 1
--- !u!114 &46877084639177849
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 793983410033291345}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 3fb48d82dc0e94a2b9246d17d04f8748, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Direction: 0
m_Color1: {r: 1, g: 1, b: 1, a: 1}
m_Color2: {r: 1, g: 1, b: 1, a: 1}
m_Color3: {r: 1, g: 1, b: 1, a: 1}
m_Color4: {r: 1, g: 1, b: 1, a: 1}
m_Rotation: 0
m_Offset1: 0
m_Offset2: 0
m_GradientStyle: 0
m_ColorSpace: -1
m_IgnoreAspectRatio: 1
--- !u!114 &8225225246167167684
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 793983410033291345}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 4a02adf5375469d4f8f18de467ab1deb, type: 3}
m_Name:
m_EditorClassIdentifier:
gradient: {fileID: 46877084639177849}
--- !u!1 &1731066637017514641
GameObject:
m_ObjectHideFlags: 0

View File

@ -13998,16 +13998,8 @@ PrefabInstance:
value: 0
objectReference: {fileID: 0}
- target: {fileID: 7896211045508186424, guid: d3c2508a55398a24db5d68f68d2702ea, type: 3}
propertyPath: m_Color.b
value: 0.3773585
objectReference: {fileID: 0}
- target: {fileID: 7896211045508186424, guid: d3c2508a55398a24db5d68f68d2702ea, type: 3}
propertyPath: m_Color.g
value: 0.16444026
objectReference: {fileID: 0}
- target: {fileID: 7896211045508186424, guid: d3c2508a55398a24db5d68f68d2702ea, type: 3}
propertyPath: m_Color.r
value: 0
propertyPath: m_Color.a
value: 0.69803923
objectReference: {fileID: 0}
m_RemovedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: d3c2508a55398a24db5d68f68d2702ea, type: 3}

View File

@ -36,7 +36,7 @@ namespace AxibugEmuOnline.Client
{
DEFAULT,
new XMBColor("白","#8a9fb2","#4e9eb6"),
new XMBColor("黄","#d5a916","#d1a813"),
new XMBColor("黄","#987500","#d1a813"),
new XMBColor("绿","#3e962b","#7ac25e"),
new XMBColor("粉","#e65a8b","#c7acc6"),
new XMBColor("墨绿","#00421a","#1c951f"),

View File

@ -137,7 +137,7 @@ namespace AxibugEmuOnline.Client
Canvas.ForceUpdateCanvases();
m_selectIndex = 0;
m_selectIndex = defaultIndex;
OptionUI_MenuItem optionUI_MenuItem = m_runtimeMenuItems[defaultIndex];
optionUI_MenuItem.OnFocus();
var itemUIRect = optionUI_MenuItem.transform as RectTransform;

View File

@ -164,9 +164,13 @@
float waveHeight2 = wave(uv.x, frequency2, speed2, midHeight2, maxHeight2);
float waveCol2 = waveColor(uv, waveHeight2, maxHeight2, frequency2, power2);
float3 col = bg;
col = lerp(col, waveCol1 * col, step(uv.y, waveHeight1));
col = lerp(col, waveCol2 * col, step(uv.y, waveHeight2));
float3 col = bg;
float3 waveCol1_temp=col/waveCol1;
col = lerp(col,waveCol1_temp, step(uv.y, waveHeight1));
float3 waveCol2_temp=col/waveCol2;
col = lerp(col,waveCol2_temp, step(uv.y, waveHeight2));
// Output to screen
fixed4 fragColor = float4(col,1.0);

View File

@ -0,0 +1,32 @@
using AxibugEmuOnline.Client.ClientCore;
using Coffee.UIExtensions;
using UnityEngine;
using UnityEngine.UI;
namespace AxibugEmuOnline.Client
{
public class XMBOptionBgChanger : MonoBehaviour
{
public UIGradient gradient;
private void OnEnable()
{
App.settings.BgColor.OnColorChanged += BgColor_OnColorChanged;
var color = App.settings.BgColor.CurrentColor;
gradient.color1 = color.color1;
gradient.color2 = color.color2;
}
private void OnDisable()
{
App.settings.BgColor.OnColorChanged -= BgColor_OnColorChanged;
}
private void BgColor_OnColorChanged(XMBColor color)
{
gradient.color1 = color.color1;
gradient.color2 = color.color2;
}
}
}

View File

@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 4a02adf5375469d4f8f18de467ab1deb
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: