private void UpdateJointTransform(Lanotalium.Chart.LanotaHoldNote Note) { float aTime = Note.Time; float aDegree = Note.Degree + Tuner.CameraManager.CurrentRotation; if (Note.Joints != null) { for (int i = 0; i < Note.Joints.Count - 1; ++i) { Lanotalium.Chart.LanotaJoints Joint = Note.Joints[i]; aTime += Joint.dTime; aDegree += Joint.dDegree; float Percent = CalculateMovePercent(aTime); Percent = CalculateEasedPercent(Percent); Joint.Percent = Percent; if (Percent < 20) { continue; } Joint.JointGameObject.transform.rotation = Quaternion.Euler(new Vector3(90, aDegree, 0)); Joint.JointGameObject.transform.position = new Vector3(-Percent / 10 * Mathf.Sin(aDegree * Mathf.Deg2Rad), 0, -Percent / 10 * Mathf.Cos(aDegree * Mathf.Deg2Rad)); Joint.JointGameObject.transform.localScale = new Vector3(Percent / 100, Percent / 100, 0); Joint.aTime = aTime; Joint.aDegree = aDegree - Tuner.CameraManager.CurrentRotation; } } }
private void CreateNoteAtCurser(float Time, float Degree) { if (!Enable) { return; } int Type = ConvertValueToType(TypeDropdown.value); int Size = SizeDropdown.value; if (Type == 5) { Lanotalium.Chart.LanotaHoldNote New = new Lanotalium.Chart.LanotaHoldNote(); New.Type = 5; New.Duration = 1; New.Degree = Degree; New.Time = Time; New.Size = Size; OperationManager.AddHoldNote(New); } else { Lanotalium.Chart.LanotaTapNote New = new Lanotalium.Chart.LanotaTapNote(); New.Type = Type; New.Time = Time; New.Degree = Degree; New.Size = Size; OperationManager.AddTapNote(New); } }
public bool IsHoldNoteinScanRange(Lanotalium.Chart.LanotaHoldNote Note) { if (!Enable) { return(true); } if (RangePairCount == 0) { return(false); } for (int i = 0; i < RangePairCount; ++i) { if (Note.Time >= Starts[i] && Note.Time <= Ends[i]) { return(true); } else if (Note.Time <= Starts[i] && Note.Time + Note.Duration >= Ends[i]) { return(true); } else if (Note.Time + Note.Duration >= Starts[i] && Note.Time + Note.Duration <= Ends[i]) { return(true); } else if (Note.Time >= Starts[i] && Note.Time + Note.Duration <= Ends[i]) { return(true); } } return(false); }
public void Initialize(LimOperationManager OperationManager, Lanotalium.Chart.LanotaHoldNote HoldNoteData, Lanotalium.Chart.LanotaJoints JointNoteData, ComponentHoldNoteManager ComponentHoldNote) { this.OperationManager = OperationManager; this.HoldNoteData = HoldNoteData; this.JointNoteData = JointNoteData; this.ComponentHoldNote = ComponentHoldNote; RefreshUiWidth(); }
public void InstantiateHeadNote(Lanotalium.Chart.LanotaHoldNote Note) { Note.HoldNoteGameObject = Instantiate(GetPrefab(Note.Size, Note.Combination), transform); Note.LineRenderer = Note.HoldNoteGameObject.GetComponentInChildren <LineRenderer>(); Note.InstanceId = Note.HoldNoteGameObject.GetInstanceID(); Note.Sprite = Note.HoldNoteGameObject.GetComponentInChildren <SpriteRenderer>(); Note.OnTouch = false; Note.HoldNoteGameObject.SetActive(false); }
public void InstantiateAllJointNote(Lanotalium.Chart.LanotaHoldNote Note) { if (Note.Joints != null) { for (int i = 0; i < Note.Joints.Count - 1; ++i) { Note.Joints[i].JointGameObject = Instantiate(oTJoint, transform); Note.Joints[i].InstanceId = Note.Joints[i].JointGameObject.GetInstanceID(); Note.Joints[i].JointGameObject.SetActive(false); } } }
public void CreateHoldNote() { if (LimSystem.ChartContainer == null) { return; } Lanotalium.Chart.LanotaHoldNote New = new Lanotalium.Chart.LanotaHoldNote(); New.Type = 5; New.Time = TunerManager.ChartTime; New.Duration = 1; OperationManager.AddHoldNote(New); OperationManager.InspectorManager.ArrangeComponentsUi(); }
public void ConvertSelectedToHoldNote() { if (LimSystem.ChartContainer == null) { return; } OperationManager.SelectedTapNote.Sort((Lanotalium.Chart.LanotaTapNote a, Lanotalium.Chart.LanotaTapNote b) => { return(a.Time.CompareTo(b.Time)); }); int Quantity = OperationManager.SelectedTapNote.Count; if (Quantity == 0) { return; } else if (Quantity == 1) { OperationManager.ConvertTapNoteToHoldNote(OperationManager.SelectedTapNote[0]); return; } else { Lanotalium.Chart.LanotaHoldNote New = new Lanotalium.Chart.LanotaHoldNote { Duration = OperationManager.SelectedTapNote[Quantity - 1].Time - OperationManager.SelectedTapNote[0].Time, Time = OperationManager.SelectedTapNote[0].Time, Degree = OperationManager.SelectedTapNote[0].Degree, Type = 5, Size = 1, Jcount = Quantity - 1, Joints = new List <Lanotalium.Chart.LanotaJoints>() }; float DegreeCount = New.Degree; float TimeCount = New.Time; for (int i = 1; i < Quantity; ++i) { Lanotalium.Chart.LanotaJoints NewJ = new Lanotalium.Chart.LanotaJoints(); NewJ.Cfmi = 0; NewJ.dTime = Mathf.Max(0.0001f, OperationManager.SelectedTapNote[i].Time - TimeCount); NewJ.dDegree = OperationManager.SelectedTapNote[i].Degree - DegreeCount; New.Joints.Add(NewJ); TimeCount += NewJ.dTime; DegreeCount += NewJ.dDegree; } foreach (Lanotalium.Chart.LanotaTapNote Tap in OperationManager.SelectedTapNote) { OperationManager.DeleteTapNote(Tap); } OperationManager.SelectedTapNote.Clear(); OperationManager.AddHoldNote(New, true, true, true); } }
private int CalculateHoldNoteCount(Lanotalium.Chart.LanotaHoldNote Hold, float Time) { int NoteCount = 0; float Duration = (Hold.Time + Hold.Duration) < Time ? Hold.Duration : (Time - Hold.Time); float JudgeDelta = 30f / TunerManager.BpmManager.CalculateBpm(Hold.Time); while (NoteCount * JudgeDelta < Duration && !Approximately(NoteCount * JudgeDelta, Duration)) { NoteCount++; } if (Time > Hold.Time + Hold.Duration) { NoteCount += 1; } return(NoteCount); }
private float CalculateHeadRotation(Lanotalium.Chart.LanotaHoldNote Note) { float LastaTime = Note.Time, LastaDegree = Note.Degree; if (Note.Joints != null) { foreach (Lanotalium.Chart.LanotaJoints Joint in Note.Joints) { if (Tuner.ChartTime > Joint.aTime) { LastaTime = Joint.aTime; LastaDegree = Joint.aDegree; continue; } float Percent = (Tuner.ChartTime - LastaTime) / Joint.dTime; return(Tuner.CameraManager.CurrentRotation + LastaDegree + Joint.dDegree * CalculateEasedCurve(Percent, Joint.Cfmi)); } if (Note.Joints.Count != 0) { return(Tuner.CameraManager.CurrentRotation + Note.Joints[Note.Joints.Count - 1].aDegree); } } return(Tuner.CameraManager.CurrentRotation + Note.Degree); }
public void CopySelectedNotes() { if (!OperationManager.TunerManager.isInitialized) { return; } if (!ValidateCopyInstruction()) { return; } bool HasTap = false, HasHold = false; float FirstNoteTime = 0; if (OperationManager.SelectedTapNote.Count != 0) { OperationManager.SelectedTapNote.Sort((Lanotalium.Chart.LanotaTapNote a, Lanotalium.Chart.LanotaTapNote b) => { return(a.Time.CompareTo(b.Time)); }); FirstNoteTime = OperationManager.SelectedTapNote[0].Time; HasTap = true; } if (OperationManager.SelectedHoldNote.Count != 0) { OperationManager.SelectedHoldNote.Sort((Lanotalium.Chart.LanotaHoldNote a, Lanotalium.Chart.LanotaHoldNote b) => { return(a.Time.CompareTo(b.Time)); }); FirstNoteTime = OperationManager.SelectedHoldNote[0].Time; HasHold = true; } if (HasTap && HasHold) { FirstNoteTime = Mathf.Min(OperationManager.SelectedTapNote[0].Time, OperationManager.SelectedHoldNote[0].Time); } if (!HasTap && !HasHold) { return; } if (HasTap) { foreach (float Target in CopyTargets) { float Delta = Target - FirstNoteTime; foreach (Lanotalium.Chart.LanotaTapNote Tap in OperationManager.SelectedTapNote) { Lanotalium.Chart.LanotaTapNote New = Tap.DeepCopy(); New.Time += Delta; OperationManager.AddTapNote(New, true, false, false); } } } if (HasHold) { foreach (float Target in CopyTargets) { float Delta = Target - FirstNoteTime; foreach (Lanotalium.Chart.LanotaHoldNote Hold in OperationManager.SelectedHoldNote) { Lanotalium.Chart.LanotaHoldNote New = Hold.DeepCopy(); New.Time += Delta; OperationManager.AddHoldNote(New, true, false, false); } } } OperationManager.SelectNothing(); LimNotifyIcon.ShowMessage(LimLanguageManager.TextDict["Copier_Msg_Success"]); }