示例#1
0
        public AudioSplinePoint RemovePoint(int index)
        {
            AudioSplinePoint result = pts[index];

            pts = MyArray <AudioSplinePoint> .RemoveAt(pts, index);

            RefreshPointNames();
            return(result);
        }
示例#2
0
 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);
     }
 }
示例#3
0
 public int GetSplinePointIndex(AudioSplinePoint point)
 {
     for (int i = 0; i < pts.Length; i++)
     {
         if (pts[i] == point)
         {
             return(i);
         }
     }
     return(-1);
 }
示例#4
0
        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();
        }