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) {
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<StampedEvent>());
}
return_ahead:
OpenAnchor("tail");
base.EndUpdate(s);
CloseAnchor("tail");