From b39a3ad3355dfc7e829c41c2d939a6410917cd9f Mon Sep 17 00:00:00 2001 From: PopSlime Date: Sun, 2 Oct 2022 16:02:08 +0800 Subject: [PATCH] Remove unnecessary operations on note game objects. --- Assets/Cryville/Crtr/NoteHandler.cs | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Assets/Cryville/Crtr/NoteHandler.cs b/Assets/Cryville/Crtr/NoteHandler.cs index 535a459..7cc828d 100644 --- a/Assets/Cryville/Crtr/NoteHandler.cs +++ b/Assets/Cryville/Crtr/NoteHandler.cs @@ -40,21 +40,23 @@ namespace Cryville.Crtr { } protected override void Awake(ContainerState s) { base.Awake(s); - if (!gogroup) return; - Chart.Note tev = Event; - if (tev.IsLong) { - foreach (var i in sgos) { - i.Reset(); - i.AppendPoint(Position, Rotation); + if (s.CloneType == 2) { + if (!gogroup) return; + Chart.Note tev = Event; + if (tev.IsLong) { + foreach (var i in sgos) { + i.Reset(); + i.AppendPoint(Position, Rotation); + } } - } - else { + else { #if UNITY_5_6_OR_NEWER - gogroup.SetPositionAndRotation(Position, Rotation); + gogroup.SetPositionAndRotation(Position, Rotation); #else gogroup.position = Position; gogroup.rotation = Rotation; #endif + } } } @@ -160,8 +162,7 @@ namespace Cryville.Crtr { } public override void EndUpdate(ContainerState s) { - if (s.CloneType == 0 || s.CloneType == 2) { - if (!gogroup) goto return_ahead; + if (s.CloneType == 2 && gogroup) { foreach (var i in sgos) i.Seal(); #if UNITY_5_6_OR_NEWER a_tail.SetPositionAndRotation(GetFramePoint(ts.Parent, ts.Track), Quaternion.Euler(ts.Direction)); @@ -177,7 +178,6 @@ namespace Cryville.Crtr { } cs.Bus.IssuePatch(patchedJudgeEvents.Cast()); } - return_ahead: OpenAnchor("tail"); base.EndUpdate(s); CloseAnchor("tail");