public AudioSplinePoint RemovePoint(int index) { AudioSplinePoint result = pts[index]; pts = MyArray <AudioSplinePoint> .RemoveAt(pts, index); RefreshPointNames(); return(result); }
public void AddPoint(int index) { if (index >= 0) { GameObject gameObject = new GameObject("AudioSplinePoint"); gameObject.transform.parent = base.gameObject.transform; AudioSplinePoint point = gameObject.AddComponent <AudioSplinePoint>(); _CRSpline.AddPoint(index, point); } }
public int GetSplinePointIndex(AudioSplinePoint point) { for (int i = 0; i < pts.Length; i++) { if (pts[i] == point) { return(i); } } return(-1); }
public void AddPoint(int index, AudioSplinePoint point) { index++; pts = MyArray <AudioSplinePoint> .InsertAt(pts, index, point); if (pts[index - 1] != null && pts[index + 1] != null) { Vector3 position = Vector3.Lerp(pts[index - 1].transform.position, pts[index + 1].transform.position, 0.5f); point.transform.position = position; } RefreshPointNames(); }