Skip to content

Commit

Permalink
Fix arc judge render by fix arc group
Browse files Browse the repository at this point in the history
  • Loading branch information
yojohanshinwataikei committed Nov 12, 2020
1 parent 995ed20 commit 0b5e8f1
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
3 changes: 2 additions & 1 deletion Assets/Misc/ChangeLog.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
0.3.3
- 修复 Arc 复制时的渲染错乱问题
- 修复 Arc 编辑时连接关系不同步的问题
- 修复 0 时长黑线 Arc 头部显示的问题
- 修复 Arc 编辑时判定显示错误的问题
- 修复 0 时长黑线 Arc 头部显示错误的问题

---

Expand Down
25 changes: 13 additions & 12 deletions Assets/Scripts/Gameplay/Managers/ArcArcManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -69,27 +69,18 @@ public void CalculateArcRelationship()
{
if (a.Color == b.Color && a.IsVoid == b.IsVoid)
{
if (a.ArcGroup == null && b.ArcGroup != null)
if (b.ArcGroup != null)
{
a.ArcGroup = b.ArcGroup;
}
else if (a.ArcGroup != null && b.ArcGroup == null)
{
b.ArcGroup = a.ArcGroup;
}
else if (a.ArcGroup != null && b.ArcGroup != null)
{
foreach (var t in b.ArcGroup)
{
if (!a.ArcGroup.Contains(t)) a.ArcGroup.Add(t);
}
b.ArcGroup = a.ArcGroup;
}
else if (a.ArcGroup == null && b.ArcGroup == null)
{
a.ArcGroup = b.ArcGroup = new List<ArcArc> { a };
a.ArcGroup = b.ArcGroup = new List<ArcArc>();
}
if (!a.ArcGroup.Contains(b)) a.ArcGroup.Add(b);
}
if (a.IsVoid == b.IsVoid)
{
Expand All @@ -100,7 +91,17 @@ public void CalculateArcRelationship()
}
foreach (ArcArc arc in Arcs)
{
if (arc.ArcGroup == null) arc.ArcGroup = new List<ArcArc> { arc };
if (arc.ArcGroup == null)
{
arc.ArcGroup = new List<ArcArc> { arc };
}
else
{
if (!arc.ArcGroup.Contains(arc))
{
arc.ArcGroup.Add(arc);
}
}
arc.ArcGroup.Sort((ArcArc a, ArcArc b) => a.Timing.CompareTo(b.Timing));
}
foreach (ArcArc arc in Arcs)
Expand Down

0 comments on commit 0b5e8f1

Please sign in to comment.