Restructure event/container system.
This commit is contained in:
@@ -59,19 +59,17 @@ namespace Cryville.Crtr {
|
||||
sgos = gogroup.GetComponentsInChildren<SectionalGameObject>();
|
||||
foreach (var judge in judges.Values) judge.InitPropSrcs();
|
||||
}
|
||||
protected override void PreAwake(ContainerState s) {
|
||||
base.PreAwake(s);
|
||||
#if UNITY_5_6_OR_NEWER
|
||||
a_head.Transform.SetPositionAndRotation(Position = GetFramePoint(s.Parent, s.Track), Rotation = GetFrameRotation(s.Parent, s.Track));
|
||||
#else
|
||||
a_head.Transform.position = Position = GetFramePoint(s.Parent, s.Track);
|
||||
a_head.Transform.rotation = Rotation = GetFrameRotation(s.Parent, s.Track);
|
||||
#endif
|
||||
}
|
||||
protected override void Awake(ContainerState s) {
|
||||
base.Awake(s);
|
||||
|
||||
public override void StartPhysicalUpdate(ContainerState s) {
|
||||
base.StartPhysicalUpdate(s);
|
||||
if (s.CloneType == 2) {
|
||||
if (!gogroup) return;
|
||||
TransformAwake(s);
|
||||
}
|
||||
}
|
||||
public override void StartGraphicalUpdate(ContainerState s) {
|
||||
base.StartGraphicalUpdate(s);
|
||||
TransformAwake(s);
|
||||
if (gogroup) {
|
||||
if (Event.IsLong) {
|
||||
foreach (var i in sgos) {
|
||||
i.Reset();
|
||||
@@ -88,17 +86,18 @@ namespace Cryville.Crtr {
|
||||
}
|
||||
}
|
||||
}
|
||||
void TransformAwake(ContainerState s) {
|
||||
Position = GetFramePoint(s.Parent, s.Track);
|
||||
Rotation = GetFrameRotation(s.Parent, s.Track);
|
||||
}
|
||||
|
||||
public override void Update(ContainerState s, StampedEvent ev) {
|
||||
base.Update(s, ev);
|
||||
if (s.CloneType <= 2) {
|
||||
Position = GetFramePoint(s.Parent, s.Track);
|
||||
Rotation = GetFrameRotation(s.Parent, s.Track);
|
||||
}
|
||||
if (s.CloneType == 2) {
|
||||
if (!gogroup) return;
|
||||
Chart.Note tev = Event;
|
||||
if (tev.IsLong) {
|
||||
if (s.CloneType == 2) {
|
||||
if (!gogroup || !Event.IsLong) return;
|
||||
foreach (var i in sgos)
|
||||
i.AppendPoint(Position, Rotation);
|
||||
}
|
||||
@@ -116,22 +115,11 @@ namespace Cryville.Crtr {
|
||||
}
|
||||
}
|
||||
|
||||
public override void Anchor() {
|
||||
base.Anchor();
|
||||
// TODO Push Dynamic Anchor Events
|
||||
}
|
||||
|
||||
public override void EndUpdate(ContainerState s) {
|
||||
if (s.CloneType == 2 && gogroup) {
|
||||
public override void EndGraphicalUpdate(ContainerState s) {
|
||||
if (gogroup) {
|
||||
foreach (var i in sgos) i.Seal();
|
||||
#if UNITY_5_6_OR_NEWER
|
||||
a_tail.Transform.SetPositionAndRotation(GetFramePoint(ts.Parent, ts.Track), Quaternion.Euler(ts.Direction));
|
||||
#else
|
||||
a_tail.Transform.position = GetFramePoint(ts.Parent, ts.Track);
|
||||
a_tail.Transform.rotation = Quaternion.Euler(ts.Direction);
|
||||
#endif
|
||||
}
|
||||
base.EndUpdate(s);
|
||||
base.EndGraphicalUpdate(s);
|
||||
}
|
||||
|
||||
Vector3 GetFramePoint(ContainerState state, float track) {
|
||||
|
Reference in New Issue
Block a user