diff --git a/Assets/Materials/Player/Track.mat b/Assets/Materials/Player/Track.mat index a1c9447..9e57ee4 100644 --- a/Assets/Materials/Player/Track.mat +++ b/Assets/Materials/Player/Track.mat @@ -69,7 +69,7 @@ Material: - _Parallax: 0.02 - _SmoothnessTextureChannel: 0 - _SpecularHighlights: 1 - - _Speed: 0 + - _Speed: 1 - _SrcBlend: 1 - _UVSec: 0 - _ZWrite: 1 diff --git a/Assets/Misc/BuildTimestamp.txt b/Assets/Misc/BuildTimestamp.txt index 68e7e5c..ded86fc 100644 --- a/Assets/Misc/BuildTimestamp.txt +++ b/Assets/Misc/BuildTimestamp.txt @@ -1 +1 @@ -637190312010828195 \ No newline at end of file +637190459757934719 \ No newline at end of file diff --git a/Assets/Misc/ChangeLog.txt b/Assets/Misc/ChangeLog.txt index ada01f0..f9293c6 100644 --- a/Assets/Misc/ChangeLog.txt +++ b/Assets/Misc/ChangeLog.txt @@ -1,8 +1,12 @@ -进行了以下的小修改 +Arc 的颜色现在会随着高度变化了 +除此之外进行了以下的小修改 - 修复了镜像操作错误显示为复制的问题 - 修复了文本高度计算错误, 导致的顶端弹出提示停留时间过长的问题 - 改善了网格线设置的默认参数, 不再包括 -0.2 处的横线, 老用户需要手动重新设置 - 修复了多处 UI 排版问题 +- 通过更改皮肤材质的 mipmap 等级, 缓解了天键发糊的问题 (可能会导致更吃显卡) +- 加载谱面时的转场音效现在受谱面音量变化了 +- 调整了选中的 Arc 的颜色 以下是最近一次大更新的更新记录 --- 欢迎来到第一个版本的 Arcade-plus ! diff --git a/Assets/Prefabs/Player/Arc.prefab b/Assets/Prefabs/Player/Arc.prefab index 7fb2ddb..bee9714 100644 --- a/Assets/Prefabs/Player/Arc.prefab +++ b/Assets/Prefabs/Player/Arc.prefab @@ -133,11 +133,6 @@ MonoBehaviour: shadowMaterial: {fileID: 2100000, guid: 82043575658889a4bafb43f4397fe61e, type: 2} SegmentPrefab: {fileID: 1374156918699440, guid: 65a6ec2a7d2a9b1419fa573cc455d902, type: 3} - ArcRed: {r: 1, g: 0.5882353, b: 0.8627451, a: 1} - ArcBlue: {r: 0.047058824, g: 0.83137256, b: 0.83137256, a: 1} - ArcGreen: {r: 0.13725491, g: 1, b: 0.42352942, a: 1} - ArcVoid: {r: 0.5686275, g: 0.47058824, b: 0.6666667, a: 1} - ShadowColor: {r: 0.3529412, g: 0.3529412, b: 0.3529412, a: 0.3529412} ArcCollider: {fileID: 64321634845165700} HeadCollider: {fileID: 64226225488760392} HeadFilter: {fileID: 33427256565974668} @@ -465,8 +460,8 @@ ParticleSystem: startColor: serializedVersion: 2 minMaxState: 2 - minColor: {r: 0.3392157, g: 0.5392157, b: 0.79019606, a: 0.5} - maxColor: {r: 0.5392157, g: 0.73921573, b: 0.9901961, a: 2} + minColor: {r: 0.3, g: 0.1, b: 0.3, a: 0.5} + maxColor: {r: 0.5, g: 0.3, b: 0.5, a: 2} maxGradient: serializedVersion: 2 key0: {r: 1, g: 1, b: 1, a: 1} @@ -1548,7 +1543,7 @@ ParticleSystem: maxGradient: serializedVersion: 2 key0: {r: 1, g: 1, b: 1, a: 1} - key1: {r: 0.54901963, g: 0.6392157, b: 0.8901961, a: 1} + key1: {r: 0.4, g: 0.2, b: 0.8, a: 1} key2: {r: 0, g: 0, b: 0, a: 0} key3: {r: 0, g: 0, b: 0, a: 0} key4: {r: 0, g: 0, b: 0, a: 0} diff --git a/Assets/Scripts/Compose/AdeSkinHost.cs b/Assets/Scripts/Compose/AdeSkinHost.cs index 6c44941..d1cde73 100644 --- a/Assets/Scripts/Compose/AdeSkinHost.cs +++ b/Assets/Scripts/Compose/AdeSkinHost.cs @@ -857,6 +857,7 @@ private Texture2D LoadTexture2D(string path, List resourceLi { return null; } + //TODO: Completly remove mipmap after GPU optimize Texture2D texture = new Texture2D(1, 1); bool success = ImageConversion.LoadImage(texture, file, true); if (success) @@ -864,6 +865,7 @@ private Texture2D LoadTexture2D(string path, List resourceLi resourceList.Add(texture); texture.wrapMode = TextureWrapMode.Clamp; texture.name = path; + texture.mipMapBias=-4; return texture; } else diff --git a/Assets/Scripts/Compose/UI/AdeShutterManager.cs b/Assets/Scripts/Compose/UI/AdeShutterManager.cs index afa698d..946028f 100644 --- a/Assets/Scripts/Compose/UI/AdeShutterManager.cs +++ b/Assets/Scripts/Compose/UI/AdeShutterManager.cs @@ -1,6 +1,7 @@ using System.Collections; using UnityEngine; using DG.Tweening; +using Arcade.Compose.Dialog; namespace Arcade.Compose { @@ -28,13 +29,13 @@ public void Open() { Left.DOAnchorPosX(-1165, Duration).SetEase(Ease.InCubic); Right.DOAnchorPosX(459, Duration).SetEase(Ease.InCubic); - AudioSource.PlayClipAtPoint(OpenAudio, new Vector3()); + AudioSource.PlayClipAtPoint(OpenAudio, new Vector3(),AdeSoundDialog.Instance.ChartSource.volume); } public void Close() { Left.DOAnchorPosX(0, Duration).SetEase(Ease.OutCubic); Right.DOAnchorPosX(0, Duration).SetEase(Ease.OutCubic); - AudioSource.PlayClipAtPoint(CloseAudio, new Vector3()); + AudioSource.PlayClipAtPoint(CloseAudio, new Vector3(),AdeSoundDialog.Instance.ChartSource.volume); } public IEnumerator OpenCoroutine() { diff --git a/Assets/Scripts/Gameplay/Components/ArcArcRenderer.cs b/Assets/Scripts/Gameplay/Components/ArcArcRenderer.cs index cf5bd5b..c9b84ad 100644 --- a/Assets/Scripts/Gameplay/Components/ArcArcRenderer.cs +++ b/Assets/Scripts/Gameplay/Components/ArcArcRenderer.cs @@ -14,11 +14,6 @@ public class ArcArcRenderer : MonoBehaviour public Material arcMaterial; public Material shadowMaterial; public GameObject SegmentPrefab; - public Color ArcRed; - public Color ArcBlue; - public Color ArcGreen; - public Color ArcVoid; - public Color ShadowColor; public MeshCollider ArcCollider, HeadCollider; public MeshFilter HeadFilter; @@ -32,6 +27,36 @@ public class ArcArcRenderer : MonoBehaviour private MaterialPropertyBlock headPropertyBlock; + private Color ArcRedHigh + { + get { return ArcArcManager.Instance.ArcRedHigh; } + } + private Color ArcBlueHigh + { + get { return ArcArcManager.Instance.ArcBlueHigh; } + } + private Color ArcGreenHigh + { + get { return ArcArcManager.Instance.ArcGreenHigh; } + } + private Color ArcRedLow + { + get { return ArcArcManager.Instance.ArcRedLow; } + } + private Color ArcBlueLow + { + get { return ArcArcManager.Instance.ArcBlueLow; } + } + private Color ArcGreenLow + { + get { return ArcArcManager.Instance.ArcGreenLow; } + } + private Color ArcVoid + { + get { return ArcArcManager.Instance.ArcVoid; } + } + + public ArcArc Arc { get @@ -44,22 +69,42 @@ public ArcArc Arc Build(); } } - public Color Color + public Color HighColor + { + get + { + return currentHighColor; + } + set + { + if (currentHighColor != value) + { + currentHighColor = value; + headPropertyBlock.SetColor(highColorShaderId, currentHighColor); + HeadRenderer.SetPropertyBlock(headPropertyBlock); + foreach (var s in segments) + { + s.HighColor = currentHighColor; + } + } + } + } + public Color LowColor { get { - return currentColor; + return currentLowColor; } set { - if (currentColor != value) + if (currentLowColor != value) { - currentColor = value; - headPropertyBlock.SetColor(colorShaderId, currentColor); + currentLowColor = value; + headPropertyBlock.SetColor(lowColorShaderId, currentLowColor); HeadRenderer.SetPropertyBlock(headPropertyBlock); foreach (var s in segments) { - s.Color = currentColor; + s.LowColor = currentLowColor; } } } @@ -68,20 +113,25 @@ public float Alpha { get { - return currentColor.a; + return currentHighColor.a; } set { - if (currentColor.a != value) + if (currentHighColor.a != value) { - currentColor.a = value; - headPropertyBlock.SetColor(colorShaderId, currentColor); + currentHighColor.a = value; + headPropertyBlock.SetColor(highColorShaderId, currentHighColor); HeadRenderer.SetPropertyBlock(headPropertyBlock); foreach (var s in segments) { s.Alpha = value; } } + if (currentLowColor.a != value) + { + currentLowColor.a = value; + headPropertyBlock.SetColor(lowColorShaderId, currentLowColor); + } } } public bool Enable @@ -184,11 +234,13 @@ public void ReloadSkin() public void ReloadColor() { - float alpha=Alpha; - if(arc!=null){ - Color = (arc.IsVoid ? ArcVoid : (arc.Color == 0 ? ArcBlue : arc.Color == 1 ? ArcRed : ArcGreen)); + float alpha = Alpha; + if (arc != null) + { + HighColor = (arc.IsVoid ? ArcVoid : (arc.Color == 0 ? ArcBlueHigh : arc.Color == 1 ? ArcRedHigh : ArcGreenHigh)); + LowColor = (arc.IsVoid ? ArcVoid : (arc.Color == 0 ? ArcBlueLow : arc.Color == 1 ? ArcRedLow : ArcGreenLow)); } - Alpha=alpha; + Alpha = alpha; } public bool EnableEffect { @@ -244,7 +296,8 @@ private void Awake() headPropertyBlock = new MaterialPropertyBlock(); HeadRenderer.sortingLayerName = "Arc"; HeadRenderer.sortingOrder = 1; - colorShaderId = Shader.PropertyToID("_Color"); + highColorShaderId = Shader.PropertyToID("_HighColor"); + lowColorShaderId = Shader.PropertyToID("_LowColor"); highlightShaderId = Shader.PropertyToID("_Highlight"); mainTexShaderId = Shader.PropertyToID("_MainTex"); } @@ -256,7 +309,9 @@ private void OnDestroy() } private int highlightShaderId; - private int colorShaderId; + private int highColorShaderId; + private int lowlightShaderId; + private int lowColorShaderId; private int mainTexShaderId; private int segmentCount = 0; private bool enable; @@ -267,7 +322,8 @@ private void OnDestroy() private bool highlighted; private bool effect; private ArcArc arc; - private Color currentColor; + private Color currentHighColor; + private Color currentLowColor; private List segments = new List(); private void InstantiateSegment(int quantity) @@ -312,7 +368,7 @@ public void BuildHeightIndicator() } HeightIndicatorRenderer.transform.localPosition = new Vector3(ArcAlgorithm.ArcXToWorld(arc.XStart), 0, 0); HeightIndicatorRenderer.transform.localScale = new Vector3(2.34f, 100 * (ArcAlgorithm.ArcYToWorld(arc.YStart) - OffsetNormal / 2), 1); - HeightIndicatorRenderer.color = arc.Color == 1 ? ArcRed : arc.Color == 0 ? ArcBlue : ArcGreen; + HeightIndicatorRenderer.color = Color.Lerp(arc.Color == 1 ? ArcRedLow : arc.Color == 0 ? ArcBlueLow : ArcGreenLow,arc.Color == 1 ? ArcRedHigh : arc.Color == 0 ? ArcBlueHigh : ArcGreenHigh,arc.YStart); } public void BuildSegments() { @@ -328,26 +384,32 @@ public void BuildSegments() segmentCount = (segSize == 0 ? 0 : duration / segSize) + 1; InstantiateSegment(segmentCount); + float startHeight = 0; + float endHeight = arc.YStart; Vector3 start = new Vector3(); Vector3 end = new Vector3(ArcAlgorithm.ArcXToWorld(arc.XStart), ArcAlgorithm.ArcYToWorld(arc.YStart)); - for (int i = 0; i < segmentCount - 1; ++i) { + startHeight = endHeight; start = end; + endHeight = ArcAlgorithm.Y(arc.YStart, arc.YEnd, (i + 1f) * segSize / duration, arc.LineType); end = new Vector3(ArcAlgorithm.ArcXToWorld(ArcAlgorithm.X(arc.XStart, arc.XEnd, (i + 1f) * segSize / duration, arc.LineType)), ArcAlgorithm.ArcYToWorld(ArcAlgorithm.Y(arc.YStart, arc.YEnd, (i + 1f) * segSize / duration, arc.LineType)), -timingManager.CalculatePositionByTimingAndStart(arc.Timing + offset, arc.Timing + offset + segSize * (i + 1)) / 1000f); - segments[i].BuildSegment(start, end, arc.IsVoid ? OffsetVoid : OffsetNormal, arc.Timing + segSize * i, arc.Timing + segSize * (i + 1)); + segments[i].BuildSegment(start, end, arc.IsVoid ? OffsetVoid : OffsetNormal, arc.Timing + segSize * i, arc.Timing + segSize * (i + 1), startHeight, endHeight); } + startHeight = endHeight; start = end; + endHeight = arc.YEnd; end = new Vector3(ArcAlgorithm.ArcXToWorld(arc.XEnd), ArcAlgorithm.ArcYToWorld(arc.YEnd), -timingManager.CalculatePositionByTimingAndStart(arc.Timing + offset, arc.EndTiming + offset) / 1000f); - segments[segmentCount - 1].BuildSegment(start, end, arc.IsVoid ? OffsetVoid : OffsetNormal, arc.Timing + segSize * (segmentCount - 1), arc.EndTiming); + segments[segmentCount - 1].BuildSegment(start, end, arc.IsVoid ? OffsetVoid : OffsetNormal, arc.Timing + segSize * (segmentCount - 1), arc.EndTiming, startHeight, endHeight); - Color = (arc.IsVoid ? ArcVoid : (arc.Color == 0 ? ArcBlue : arc.Color == 1 ? ArcRed : ArcGreen)); + HighColor = (arc.IsVoid ? ArcVoid : (arc.Color == 0 ? ArcBlueHigh : arc.Color == 1 ? ArcRedHigh : ArcGreenHigh)); + LowColor = (arc.IsVoid ? ArcVoid : (arc.Color == 0 ? ArcBlueLow : arc.Color == 1 ? ArcRedLow : ArcGreenLow)); } public void BuildHead() @@ -357,22 +419,28 @@ public void BuildHead() Vector3[] vertices = new Vector3[4]; Vector2[] uv = new Vector2[4]; + Vector2[] uv2 = new Vector2[4]; int[] triangles = new int[] { 0, 2, 1, 0, 3, 2, 0, 1, 2, 0, 2, 3 }; vertices[0] = pos + new Vector3(0, offset / 2, 0); - uv[0] = new Vector2(); + uv[0] = new Vector2(0,0); + uv2[0] = new Vector2(arc.YStart,0); vertices[1] = pos + new Vector3(offset, -offset / 2, 0); uv[1] = new Vector2(1, 0); + uv2[1] = new Vector2(arc.YStart,0); vertices[2] = pos + new Vector3(0, -offset / 2, offset / 2); uv[2] = new Vector2(1, 1); + uv2[2] = new Vector2(arc.YStart,0); vertices[3] = pos + new Vector3(-offset, -offset / 2, 0); uv[3] = new Vector2(1, 1); + uv2[3] = new Vector2(arc.YStart,0); Destroy(HeadFilter.sharedMesh); HeadFilter.sharedMesh = new Mesh() { vertices = vertices, uv = uv, + uv2 = uv2, triangles = triangles.Take(6).ToArray() }; @@ -462,7 +530,7 @@ private void UpdateSegments() s.Enable = true; s.CurrentArcMaterial = null; s.CurrentShadowMaterial = null; - s.Alpha = currentColor.a; + s.Alpha = currentHighColor.a; if (arc.Judging || arc.IsVoid) { s.From = (z + s.FromPos.z) / (-s.ToPos.z + s.FromPos.z); @@ -479,7 +547,7 @@ private void UpdateSegments() s.Enable = true; s.CurrentArcMaterial = null; s.CurrentShadowMaterial = null; - s.Alpha = currentColor.a * (100 - pos) / 10f; + s.Alpha = currentHighColor.a * (100 - pos) / 10f; s.From = 0; } else if (pos > 100 || pos < -20) @@ -489,7 +557,7 @@ private void UpdateSegments() else { s.Enable = true; - s.Alpha = currentColor.a; + s.Alpha = currentHighColor.a; s.From = 0; s.CurrentArcMaterial = arcMaterial; s.CurrentShadowMaterial = shadowMaterial; @@ -517,14 +585,18 @@ private void UpdateHead() { Head.localPosition = new Vector3(); HeadRenderer.sharedMaterial = arcMaterial; - Color c = currentColor; - c.a = currentColor.a * (100000 - arc.Position) / 100000; - headPropertyBlock.SetColor(colorShaderId, c); + Color highC = currentHighColor; + highC.a = currentHighColor.a * (100000 - arc.Position) / 100000; + headPropertyBlock.SetColor(highColorShaderId, highC); + Color lowC = currentLowColor; + lowC.a = currentLowColor.a * (100000 - arc.Position) / 100000; + headPropertyBlock.SetColor(lowColorShaderId, lowC); HeadRenderer.SetPropertyBlock(headPropertyBlock); } else if (arc.Position < 0) { - headPropertyBlock.SetColor(colorShaderId, currentColor); + headPropertyBlock.SetColor(highColorShaderId, currentHighColor); + headPropertyBlock.SetColor(lowColorShaderId, currentLowColor); HeadRenderer.SetPropertyBlock(headPropertyBlock); if (arc.Judging || arc.IsVoid) { @@ -549,7 +621,8 @@ private void UpdateHead() } else { - headPropertyBlock.SetColor(colorShaderId, currentColor); + headPropertyBlock.SetColor(highColorShaderId, currentHighColor); + headPropertyBlock.SetColor(lowColorShaderId, currentLowColor); HeadRenderer.SetPropertyBlock(headPropertyBlock); Head.localPosition = new Vector3(); } @@ -566,8 +639,8 @@ private void UpdateHeightIndicator() int currentTiming = ArcGameplayManager.Instance.Timing; if (pos < -90 && pos > -100) { - Color c = currentColor; - c.a = currentColor.a * (pos + 100) / 10; + Color c = Color.Lerp(currentLowColor,currentHighColor,arc.YStart); + c.a = currentHighColor.a * (pos + 100) / 10; EnableHeightIndicator = true; HeightIndicatorRenderer.color = c; } @@ -579,7 +652,7 @@ private void UpdateHeightIndicator() { if (arc.Judging && pos > 0) EnableHeightIndicator = false; else EnableHeightIndicator = true; - HeightIndicatorRenderer.color = currentColor; + HeightIndicatorRenderer.color = Color.Lerp(currentLowColor,currentHighColor,arc.YStart); } } private void UpdateArcCap() diff --git a/Assets/Scripts/Gameplay/Components/ArcArcSegmentComponent.cs b/Assets/Scripts/Gameplay/Components/ArcArcSegmentComponent.cs index 07b32eb..86ac3a6 100644 --- a/Assets/Scripts/Gameplay/Components/ArcArcSegmentComponent.cs +++ b/Assets/Scripts/Gameplay/Components/ArcArcSegmentComponent.cs @@ -48,18 +48,18 @@ public float From } } } - public Color Color + public Color HighColor { get { - return currentColor; + return currentHighColor; } set { - if (currentColor != value) + if (currentHighColor != value) { - currentColor = value; - bodyPropertyBlock.SetColor(colorShaderId, value); + currentHighColor = value; + bodyPropertyBlock.SetColor(highColorShaderId, value); SegmentRenderer.SetPropertyBlock(bodyPropertyBlock); Color c = ShadowColor; c.a = value.a * 0.3f; @@ -68,24 +68,47 @@ public Color Color } } } + + public Color LowColor + { + get + { + return currentLowColor; + } + set + { + if (currentLowColor != value) + { + currentLowColor = value; + bodyPropertyBlock.SetColor(lowColorShaderId, value); + SegmentRenderer.SetPropertyBlock(bodyPropertyBlock); + } + } + } public float Alpha { get { - return currentColor.a; + return currentHighColor.a; } set { - if (currentColor.a != value) + if (currentHighColor.a != value) { - currentColor.a = value; - bodyPropertyBlock.SetColor(colorShaderId, currentColor); + currentHighColor.a = value; + bodyPropertyBlock.SetColor(highColorShaderId, currentHighColor); SegmentRenderer.SetPropertyBlock(bodyPropertyBlock); Color c = ShadowColor; c.a = value * 0.3f; shadowPropertyBlock.SetColor(colorShaderId, c); ShadowRenderer.SetPropertyBlock(shadowPropertyBlock); } + if (currentLowColor.a != value) + { + currentLowColor.a = value; + bodyPropertyBlock.SetColor(lowColorShaderId, currentLowColor); + SegmentRenderer.SetPropertyBlock(bodyPropertyBlock); + } } } public bool Highlight @@ -182,10 +205,13 @@ public Material CurrentShadowMaterial private bool highlighted = false; private int fromShaderId; private int colorShaderId; + private int highColorShaderId; + private int lowColorShaderId; private int highlightShaderId; private int mainTexShaderId; private float currentFrom = 0; - private Color currentColor; + private Color currentHighColor; + private Color currentLowColor; private void Awake() { @@ -199,6 +225,8 @@ private void Awake() shadowPropertyBlock = new MaterialPropertyBlock(); fromShaderId = Shader.PropertyToID("_From"); colorShaderId = Shader.PropertyToID("_Color"); + highColorShaderId = Shader.PropertyToID("_HighColor"); + lowColorShaderId = Shader.PropertyToID("_LowColor"); highlightShaderId = Shader.PropertyToID("_Highlight"); mainTexShaderId = Shader.PropertyToID("_MainTex"); } @@ -208,7 +236,7 @@ private void OnDestroy() Destroy(ShadowFilter.sharedMesh); } - public void BuildSegment(Vector3 fromPos, Vector3 toPos, float offset, int from, int to) + public void BuildSegment(Vector3 fromPos, Vector3 toPos, float offset, int from, int to, float fromHeight, float toHeight) { FromTiming = from; ToTiming = to; @@ -219,26 +247,34 @@ public void BuildSegment(Vector3 fromPos, Vector3 toPos, float offset, int from, Vector3[] vertices = new Vector3[6]; Vector2[] uv = new Vector2[6]; + Vector2[] uv2 = new Vector2[6]; int[] triangles = new int[] { 0, 3, 2, 0, 2, 1, 0, 5, 4, 0, 4, 1 }; vertices[0] = fromPos + new Vector3(0, offset / 2, 0); - uv[0] = new Vector2(); + uv[0] = new Vector2(0, 0); + uv2[0] =new Vector2(fromHeight,0); vertices[1] = toPos + new Vector3(0, offset / 2, 0); uv[1] = new Vector2(0, 1); + uv2[1] =new Vector2(toHeight,0); vertices[2] = toPos + new Vector3(offset, -offset / 2, 0); uv[2] = new Vector2(1, 1); + uv2[2] =new Vector2(toHeight,0); vertices[3] = fromPos + new Vector3(offset, -offset / 2, 0); uv[3] = new Vector2(1, 0); + uv2[3] =new Vector2(fromHeight,0); vertices[4] = toPos + new Vector3(-offset, -offset / 2, 0); uv[4] = new Vector2(1, 1); + uv2[4] =new Vector2(toHeight,0); vertices[5] = fromPos + new Vector3(-offset, -offset / 2, 0); uv[5] = new Vector2(1, 0); + uv2[5] =new Vector2(fromHeight,0); Destroy(SegmentFilter.sharedMesh); SegmentFilter.sharedMesh = new Mesh() { vertices = vertices, uv = uv, + uv2 = uv2, triangles = triangles }; diff --git a/Assets/Scripts/Gameplay/Managers/ArcArcManager.cs b/Assets/Scripts/Gameplay/Managers/ArcArcManager.cs index f16f27d..21c43f9 100644 --- a/Assets/Scripts/Gameplay/Managers/ArcArcManager.cs +++ b/Assets/Scripts/Gameplay/Managers/ArcArcManager.cs @@ -22,6 +22,15 @@ private void Awake() public Texture2D ArcTapSkin; public Material ArcTapMaterial; public Material ArcMaterial; + + public Color ArcRedLow; + public Color ArcBlueLow; + public Color ArcGreenLow; + public Color ArcRedHigh; + public Color ArcBlueHigh; + public Color ArcGreenHigh; + public Color ArcVoid; + public Color ShadowColor; public readonly float[] Lanes = { 6.375f, 2.125f, -2.125f, -6.375f }; [HideInInspector] @@ -305,19 +314,18 @@ public void SetHeightIndicatorSkin(Sprite sprite) public void SetArcColors(Color arcRedLow, Color arcBlueLow, Color arcGreenLow, Color arcRedHigh, Color arcBlueHigh, Color arcGreenHigh,Color arcVoid) { + ArcRedLow=arcRedLow; + ArcBlueLow=arcBlueLow; + ArcGreenLow=arcGreenLow; + ArcRedHigh=arcRedHigh; + ArcBlueHigh=arcBlueHigh; + ArcGreenHigh=arcGreenHigh; + ArcVoid=arcVoid; //TODO: arc has slight diifferent color at different hight ArcArcRenderer prefabRenderer = ArcNotePrefab.GetComponent(); - prefabRenderer.ArcRed=arcRedHigh; - prefabRenderer.ArcBlue=arcBlueHigh; - prefabRenderer.ArcGreen=arcGreenHigh; - prefabRenderer.ArcVoid=arcVoid; prefabRenderer.ReloadColor(); foreach (ArcArc arc in Arcs) { - arc.arcRenderer.ArcRed=arcRedHigh; - arc.arcRenderer.ArcBlue=arcBlueHigh; - arc.arcRenderer.ArcGreen=arcGreenHigh; - arc.arcRenderer.ArcVoid=arcVoid; arc.arcRenderer.ReloadColor(); } } diff --git a/Assets/Shader/Arc.shader b/Assets/Shader/Arc.shader index 376b22a..46f14fd 100644 --- a/Assets/Shader/Arc.shader +++ b/Assets/Shader/Arc.shader @@ -31,6 +31,7 @@ float4 vertex : POSITION; float4 color : COLOR; float2 uv : TEXCOORD0; + float2 uv2 : TEXCOORD1; }; struct v2f @@ -38,11 +39,13 @@ float4 vertex : SV_POSITION; fixed4 color : COLOR; float2 uv : TEXCOORD0; + float2 uv2 : TEXCOORD1; }; int _Highlight; float _From,_To; - float4 _Color; + float4 _HighColor; + float4 _LowColor; float4 _MainTex_ST; sampler2D _MainTex; @@ -51,16 +54,19 @@ v2f o; o.vertex = UnityObjectToClipPos(v.vertex); o.uv = TRANSFORM_TEX(v.uv, _MainTex); - o.color = v.color * _Color; + o.color = v.color; + o.uv2 = v.uv2; return o; } half4 Highlight(half4 c) { - // TODO: the highlight thing should be more generic + // TODO: highlight by outline might be better fixed3 hsv = rgb2hsv(c.rgb); - if(c.r<0.5) {if(c.b>0.66){hsv.x += 0.1f;}else{hsv.x-=0.1f;}} - else hsv.y += 1.2f; + float rate=1.75; + float sv=hsv.y*hsv.z*rate; + hsv.z+=sv*(1-rate)/2; + hsv.y=sv/hsv.z; return half4(hsv2rgb(hsv),c.a); } @@ -68,7 +74,7 @@ { if(i.uv.y < _From || i.uv.y > _To) return 0; float4 c = tex2D(_MainTex,i.uv) ; - float4 inColor = i.color; + float4 inColor = lerp(_LowColor,_HighColor,i.uv2.x); if(_Highlight == 1) { inColor = Highlight(inColor); diff --git a/Assets/_Scenes/ArcEditor.unity b/Assets/_Scenes/ArcEditor.unity index 4c58a74..f1f4bfb 100644 --- a/Assets/_Scenes/ArcEditor.unity +++ b/Assets/_Scenes/ArcEditor.unity @@ -16043,7 +16043,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 3, y: -40.000008} + m_AnchoredPosition: {x: 3, y: -40.000015} m_SizeDelta: {x: 6, y: -68} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &673454530 @@ -33206,7 +33206,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0, y: 74.00001} + m_AnchoredPosition: {x: 0, y: 74.000015} m_SizeDelta: {x: 0, y: 159} m_Pivot: {x: 0.5, y: 1} --- !u!114 &1168504486 @@ -50981,6 +50981,14 @@ MonoBehaviour: ArcTapSkin: {fileID: 2800000, guid: 4774c9cdcbf72374bbb1a31f99e2a0de, type: 3} ArcTapMaterial: {fileID: 2100000, guid: 398ea87e569dea441b35a94a2d63ca34, type: 2} ArcMaterial: {fileID: 2100000, guid: fc19cc416dce47b4ba4772e4ad59ac87, type: 2} + ArcRedLow: {r: 1, g: 0.5882353, b: 0.8627451, a: 1} + ArcBlueLow: {r: 0.047058824, g: 0.83137256, b: 0.83137256, a: 1} + ArcGreenLow: {r: 0.13725491, g: 1, b: 0.42352942, a: 1} + ArcRedHigh: {r: 1, g: 0.5882353, b: 0.8627451, a: 1} + ArcBlueHigh: {r: 0.047058824, g: 0.83137256, b: 0.83137256, a: 1} + ArcGreenHigh: {r: 0.13725491, g: 1, b: 0.42352942, a: 1} + ArcVoid: {r: 0.5686275, g: 0.47058824, b: 0.6666667, a: 1} + ShadowColor: {r: 0.3529412, g: 0.3529412, b: 0.3529412, a: 0.3529412} ArcJudgePos: 0 --- !u!1 &1691752790 GameObject: diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index cd63d59..7b11a35 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -121,7 +121,7 @@ PlayerSettings: 16:10: 0 16:9: 1 Others: 0 - bundleVersion: 0.0.0 + bundleVersion: 0.0.1 preloadedAssets: - {fileID: 4800000, guid: bb26ede1beb997943a7d6295fbf075d4, type: 3} - {fileID: 4800000, guid: 1e340182228616b4ca7dad1e80f4d319, type: 3}