Skip to content

Commit

Permalink
Fix skin of arctap shadow
Browse files Browse the repository at this point in the history
  • Loading branch information
yojohanshinwataikei committed Apr 1, 2024
1 parent 8ecb57e commit 684eade
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 5 deletions.
3 changes: 2 additions & 1 deletion Assets/Misc/ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
0.5.3

- 加入对于未知颜色的 Arc 的支持
- 支持用颜色为 3 的直角 Arc 模拟可变尺寸的 Arctap
- 支持未知颜色的 Arc
- 修复特定情况下打击特效会渲染在 ArcTap 之后的问题
- 修复 NoInput 下 Arc 开头的渲染位置
- 修复负数 BPM 下 Arc 的渲染
Expand Down
2 changes: 2 additions & 0 deletions Assets/Scripts/Gameplay/Chart/ArcChart.cs
Original file line number Diff line number Diff line change
Expand Up @@ -905,6 +905,8 @@ public void Instantiate(ArcArc arc)
arc.IsSfx ? ArcArcManager.Instance.SfxArcTapPrefab : ArcArcManager.Instance.ArcTapPrefab, arc.transform
);

ShadowRenderer.sprite=ArcArcManager.Instance.ArcTapShadowSkin;

UpdatePosition();
UpdateScale();
SetupArcTapConnection();
Expand Down
19 changes: 15 additions & 4 deletions Assets/Scripts/Gameplay/Managers/ArcArcManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ private void Awake()
public GameObject ArcNotePrefab, ArcTapPrefab, SfxArcTapPrefab, ConnectionPrefab;
public Transform ArcLayer;
public Color ConnectionColor;
public Sprite ArcTapShadowSkin;
public Texture2D ArcTapSkin;
public Material ArcTapMaterial;
public Texture2D SfxArcTapNoteSkin;
Expand Down Expand Up @@ -157,10 +158,12 @@ private void RenderArcs()

foreach (var t in Arcs)
{
foreach(var arctap in t.ArcTaps){
foreach (var arctap in t.ArcTaps)
{
RenderArcTap(arctap);
}
if (t.ConvertedVariousSizedArctap!=null){
if (t.ConvertedVariousSizedArctap != null)
{
RenderArcTap(t.ConvertedVariousSizedArctap);
}
int duration = t.EndTiming - t.Timing;
Expand Down Expand Up @@ -257,10 +260,12 @@ private void JudgeArcs()
{
continue;
}
foreach(var arcTap in arc.ArcTaps){
foreach (var arcTap in arc.ArcTaps)
{
JudgeArcTap(arcTap);
}
if(arc.ConvertedVariousSizedArctap!=null){
if (arc.ConvertedVariousSizedArctap != null)
{
JudgeArcTap(arc.ConvertedVariousSizedArctap);
}
if (arc.Judged) continue;
Expand Down Expand Up @@ -304,13 +309,19 @@ private void JudgeArcTap(ArcArcTap t)

public void SetArcTapShadowSkin(Sprite sprite)
{
ArcTapShadowSkin = sprite;
ArcTapPrefab.GetComponentInChildren<SpriteRenderer>().sprite = sprite;
SfxArcTapPrefab.GetComponentInChildren<SpriteRenderer>().sprite = sprite;
foreach (ArcArc arc in Arcs)
{
foreach (ArcArcTap t in arc.ArcTaps)
{
t.ShadowRenderer.sprite = sprite;
}
if (arc.ConvertedVariousSizedArctap != null)
{
arc.ConvertedVariousSizedArctap.ShadowRenderer.sprite = sprite;
}
}
}

Expand Down

0 comments on commit 684eade

Please sign in to comment.