Remove unnecessary operations on note game objects.

This commit is contained in:
2022-10-02 16:02:08 +08:00
parent 365b2aa144
commit b39a3ad335

View File

@@ -40,21 +40,23 @@ namespace Cryville.Crtr {
} }
protected override void Awake(ContainerState s) { protected override void Awake(ContainerState s) {
base.Awake(s); base.Awake(s);
if (!gogroup) return; if (s.CloneType == 2) {
Chart.Note tev = Event; if (!gogroup) return;
if (tev.IsLong) { Chart.Note tev = Event;
foreach (var i in sgos) { if (tev.IsLong) {
i.Reset(); foreach (var i in sgos) {
i.AppendPoint(Position, Rotation); i.Reset();
i.AppendPoint(Position, Rotation);
}
} }
} else {
else {
#if UNITY_5_6_OR_NEWER #if UNITY_5_6_OR_NEWER
gogroup.SetPositionAndRotation(Position, Rotation); gogroup.SetPositionAndRotation(Position, Rotation);
#else #else
gogroup.position = Position; gogroup.position = Position;
gogroup.rotation = Rotation; gogroup.rotation = Rotation;
#endif #endif
}
} }
} }
@@ -160,8 +162,7 @@ namespace Cryville.Crtr {
} }
public override void EndUpdate(ContainerState s) { public override void EndUpdate(ContainerState s) {
if (s.CloneType == 0 || s.CloneType == 2) { if (s.CloneType == 2 && gogroup) {
if (!gogroup) goto return_ahead;
foreach (var i in sgos) i.Seal(); foreach (var i in sgos) i.Seal();
#if UNITY_5_6_OR_NEWER #if UNITY_5_6_OR_NEWER
a_tail.SetPositionAndRotation(GetFramePoint(ts.Parent, ts.Track), Quaternion.Euler(ts.Direction)); a_tail.SetPositionAndRotation(GetFramePoint(ts.Parent, ts.Track), Quaternion.Euler(ts.Direction));
@@ -177,7 +178,6 @@ namespace Cryville.Crtr {
} }
cs.Bus.IssuePatch(patchedJudgeEvents.Cast<StampedEvent>()); cs.Bus.IssuePatch(patchedJudgeEvents.Cast<StampedEvent>());
} }
return_ahead:
OpenAnchor("tail"); OpenAnchor("tail");
base.EndUpdate(s); base.EndUpdate(s);
CloseAnchor("tail"); CloseAnchor("tail");