Prune code.

This commit is contained in:
2022-09-30 18:19:19 +08:00
parent e8e36b83bd
commit cd4ea557c3
41 changed files with 22 additions and 3592 deletions

View File

@@ -23,17 +23,6 @@ namespace Cryville.Crtr {
}
}
/*public override void Dispose() {
base.Dispose();
for (int i = notePool.Count - 1; i >= 0; i--) {
var t = notePool.ElementAt(i);
GameObject.Destroy(t.Value);
}
}*/
//Dictionary<StampedEvent, GameObject> notePool = new Dictionary<StampedEvent, GameObject>();
// Trail trail;
SectionalGameObject[] sgos;
public override void Init() {
@@ -42,13 +31,6 @@ namespace Cryville.Crtr {
}
protected override void PreAwake(ContainerState s) {
base.PreAwake(s);
/*var attev = StampedEvent.AttackEvent;
if (attev != null) {
GameObject headObj = null;
bool pooledh = notePool.TryGetValue(attev, out headObj);
if (pooledh)
GameObject.Destroy(headObj);
}*/
#if UNITY_5_6_OR_NEWER
a_head.SetPositionAndRotation(Position = GetFramePoint(s.Parent, s.Track), Rotation = GetFrameRotation(s.Parent, s.Track));
#else
@@ -95,31 +77,14 @@ namespace Cryville.Crtr {
Rotation = GetFrameRotation(bs.Parent, bs.Track);
}
else if (s.CloneType == 2) {
/*for (int i = notePool.Count - 1; i >= 0; i--) {
var t = notePool.ElementAt(i);
var eev = t.Key;
var rev = t.Key.ReleaseEvent;
if (rev != null) {
eev = rev;
}
if (eev.Time < cs.Time) {
GameObject.Destroy(t.Value);
notePool.Remove(t.Key);
}
}*/
Position = GetFramePoint(ts.Parent, ts.Track);
Rotation = GetFrameRotation(ts.Parent, ts.Track);
if (!gogroup) return;
// sgos = gogroup.GetComponentsInChildren<PolygonSGO>();
Chart.Note tev = Event;
if (tev.IsLong) {
foreach (var i in sgos)
i.AppendPoint(Position, Rotation);
}
/*else {
gogroup.position = p;
gogroup.rotation = Quaternion.Euler(ts.Direction);
}*/
}
else if (s.CloneType == 16) {
if (ev == null) { }
@@ -197,7 +162,6 @@ namespace Cryville.Crtr {
public override void EndUpdate(ContainerState s) {
if (s.CloneType == 0 || s.CloneType == 2) {
if (!gogroup) goto return_ahead;
// sgos = gogroup.GetComponentsInChildren<PolygonSGO>();
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));
@@ -255,22 +219,6 @@ namespace Cryville.Crtr {
if (tp != Vector3.zero) ctrl.Add(tp);
}
if (ctrl.Count == 0) {
/* // Early algorithm
Vector3 m0, m1;
bool flag0 = id == 0;
bool flag1 = id == state.Children.Where(i => i.Key.Event is Chart.Track).Count() - 2;
if (flag0 && flag1) // Only two tracks exist
return (1 - t) * p1 + t * p2;
else {
Vector3 p0, p3;
if (!flag1) p3 = ((TrackHandler)tl.ElementAt(id + 2).Value.Handler).GetCurrentWorldPoint();
if (!flag0) p0 = ((TrackHandler)tl.ElementAt(id - 1).Value.Handler).GetCurrentWorldPoint();
if (flag0) m0 = 2 * (p2-p1).normalized - (p3-p1).normalized;
else m0 = 1f*((p1-p0).normalized + (p2-p1).normalized);
if (flag1) m1 = 2 * (p2-p1).normalized - (p2-p0).normalized;
else m1 = 1f*((p2-p1).normalized + (p3-p2).normalized);
return t*t*(2*t-3)*(p1-p2)+p1 + t*(t-1)*((t-1)*m0+t*m1);
}*/
var frame = gh.GetCurrentFrame(func);
return frame.Dot(
ColumnVector<float>.WithPolynomialCoefficients(