public void Instantiate(ArcArc arc) { Arc = arc; Instance = UnityEngine.Object.Instantiate(ArcArcManager.Instance.ArcTapPrefab, arc.transform); ArcTimingManager timingManager = ArcTimingManager.Instance; int offset = ArcAudioManager.Instance.AudioOffset; float t = 1f * (Timing - arc.Timing) / (arc.EndTiming - arc.Timing); LocalPosition = new Vector3(ArcAlgorithm.ArcXToWorld(ArcAlgorithm.X(arc.XStart, arc.XEnd, t, arc.LineType)), ArcAlgorithm.ArcYToWorld(ArcAlgorithm.Y(arc.YStart, arc.YEnd, t, arc.LineType)) - 0.5f, -timingManager.CalculatePositionByTimingAndStart(arc.Timing + offset, Timing + offset) / 1000f - 0.6f); SetupArcTapConnection(); }
public override void Assign(ArcEvent newValues) { base.Assign(newValues); ArcArc n = newValues as ArcArc; XStart = n.XStart; XEnd = n.XEnd; LineType = n.LineType; YStart = n.YStart; YEnd = n.YEnd; Color = n.Color; IsVoid = n.IsVoid; }
public override ArcEvent Clone() { ArcArc arc = new ArcArc() { Timing = Timing, EndTiming = EndTiming, XStart = XStart, XEnd = XEnd, LineType = LineType, YStart = YStart, YEnd = YEnd, Color = Color, IsVoid = IsVoid, }; foreach (var arctap in ArcTaps) { arc.ArcTaps.Add(arctap.Clone() as ArcArcTap); } return(arc); }
public ArcChart(ArcaeaAffReader reader) { Raw = reader; AudioOffset = reader.AudioOffset; foreach (ArcaeaAffEvent e in reader.Events) { switch (e.Type) { case Aff.EventType.Timing: var timing = e as ArcaeaAffTiming; Timings.Add(new ArcTiming() { Timing = timing.Timing, BeatsPerLine = timing.BeatsPerLine, Bpm = timing.Bpm }); break; case Aff.EventType.Tap: var tap = e as ArcaeaAffTap; Taps.Add(new ArcTap() { Timing = tap.Timing, Track = tap.Track }); break; case Aff.EventType.Hold: var hold = e as ArcaeaAffHold; Holds.Add(new ArcHold() { EndTiming = hold.EndTiming, Timing = hold.Timing, Track = hold.Track }); break; case Aff.EventType.Arc: var arc = e as ArcaeaAffArc; ArcArc arcArc = new ArcArc() { Color = arc.Color, EndTiming = arc.EndTiming, IsVoid = arc.IsVoid, LineType = ToArcLineType(arc.LineType), Timing = arc.Timing, XEnd = arc.XEnd, XStart = arc.XStart, YEnd = arc.YEnd, YStart = arc.YStart }; if (arc.ArcTaps != null) { arcArc.IsVoid = true; foreach (int t in arc.ArcTaps) { arcArc.ArcTaps.Add(new ArcArcTap() { Timing = t }); } } Arcs.Add(arcArc); break; case Aff.EventType.Camera: var camera = e as ArcaeaAffCamera; Cameras.Add(new ArcCamera() { Timing = camera.Timing, Move = camera.Move, Rotate = camera.Rotate, CameraType = ToCameraType(camera.CameraType), Duration = camera.Duration }); break; case Aff.EventType.SceneControl: var sceneControl = e as ArcaeaAffSceneControl; SceneControl.Add(new ArcSceneControl { Timing = sceneControl.Timing, Type = sceneControl.SceneControlType }); break; } } if (reader.Events.Count != 0) { LastEventTiming = reader.Events.Last().Timing; } }