hch
13 小时以前 742387b0573b11b9edea35c9254139ed385ceb79
Main/System/Main/MoneyMoveByPath.cs
@@ -20,6 +20,10 @@
    public Transform targetPosition;
    List<ImageEx> imgMoneys = new List<ImageEx>();
    
    int pointCount = 30;
    Vector3[] points = new Vector3[30];
    Vector3[] points2 = new Vector3[30];
    /// <summary>
    /// 播放掉落动画
    /// </summary>
@@ -54,8 +58,7 @@
        }
        //通过 heightCurve 生成路径,时间为x 总时间为1,y为高度,偏移量为100
        int pointCount = 30;
        Vector3[] points = new Vector3[pointCount];
        for (int i = 0; i < pointCount; i++)
        {
            float x = i / (pointCount - 1f);
@@ -64,8 +67,6 @@
        }
        for (int i = 0; i < imgMoneys.Count; i++)
        {
@@ -84,13 +85,12 @@
                // x y 随机下差异
                float randX = Random.Range(0.2f, 1f);
                float randY = Random.Range(0.6f, 1f);
                Vector3[] points2 = new Vector3[pointCount];
                for (int j = 0; j < points.Length; j++)
                {
                    points2[j] = new Vector3((points[j].x + offsetX)* randDir * randX, points[j].y * randY, points[j].z);
                }
                moneyImg.transform.localPosition = points2[0];
                moneyImg.transform.DOLocalPath(points2, duration1, PathType.CatmullRom).SetEase(Ease.InOutSine).OnComplete(() =>
                {