private void GenFromNew(RiverData data)
    {
        kNoiseVector = new Dictionary <Vector3, Vector3>();

        for (int i = 0, iMax = data.kOrigins.Count; i < iMax; ++i)
        {
            var river = data.kOrigins[i];
            if ((river.type & RiverData.RiverBoundsType.EndPoint) == 0)
            {
                kCurE = river;
                kPre  = null;

                while (kCurE != null && (kCurE.type & RiverData.RiverBoundsType.EndPoint) == 0)
                {
                    GenNoiseVector(kCurE, kPre);
                }
            }
        }


        for (int i = 0, iMax = data.kOrigins.Count; i < iMax; ++i)
        {
            var river = data.kOrigins[i];
            if ((river.type & RiverData.RiverBoundsType.EndPoint) == 0)
            {
                kCurE = river;
                kPre  = null;

                while (kCurE != null && (kCurE.type & RiverData.RiverBoundsType.EndPoint) == 0)
                {
                    GenFromOriginBounds(kCurE, kPre);
                }
            }
        }
    }
    private void GenCenter(RiverData.Bounds kCur, List <Vector3> kCenterPoints)
    {
        while (kCur != null && (kCur.type & RiverData.RiverBoundsType.EndPoint) == 0)
        {
            var center = CenterPos(kCur.pos);
            kCenterPoints.Add(center);

            kCur = kCur.GetLink(kCur.flowDir);
        }
    }
    private void GenNoiseVector(RiverData.Bounds kCur, RiverData.Bounds before)
    {
        kCur.widthModify = 0f;
        if (before != null)
        {
            int count = 0;
            var next  = kCur.GetNext();

            while (next != null && next.flowDir == kCur.flowDir)
            {
                ++count;
                next = next.GetNext();
            }

            var temp = kCur;

            for (int i = 0; i < count; ++i)
            {
                var T     = (float)count;
                var onePI = Mathf.PI;
                var angle = (float)onePI * i / T + onePI;

                var a = Mathf.Sin(angle);

                temp.diffModify = a;
                temp            = temp.GetNext();
            }

            kPre  = temp;
            kCurE = temp.GetNext();
        }
        else
        {
            kPre  = kCurE;
            kCurE = kCur.GetLink(kCur.flowDir);
        }
    }
    private void GenFromOriginBounds(RiverData.Bounds kCur, RiverData.Bounds before)
    {
        if (kCur == null)
        {
            Debug.Log("CC");
        }

        kCur.bHasGend = true;
        var dir = kCur.flowDir;

        if (before == null)// 这是原点
        {
            //if (kCur != null)
            {
                kCur.widthModify = kxModify;

                float centerx = kCur.pos.x + 0.5f;
                float centerz = kCur.pos.z + 0.5f;

                Vector3 center = new Vector3(centerx, 0, centerz);

                var borderleft  = BorderLeft(center, kCur.flowDir);
                var borderright = BorderRight(center, kCur.flowDir);

                var downleft  = DownLeft(center, kCur.flowDir);
                var downRight = DownRight(center, kCur.flowDir);

                var mid = ModifyVector(LerpPos(downleft, downRight, 0.5f));

                var ldir = RiverData.GetTargetDirsDir(kCur.flowDir, RiverData.Direction.Left);
                var rdir = RiverData.GetTargetDirsDir(kCur.flowDir, RiverData.Direction.Right);

                var l = ModifyVector(LerpPos(borderleft, borderright, 0.5f + 0.5f * kRiverPercent * kCur.widthModify));
                var r = ModifyVector(LerpPos(borderright, borderleft, 0.5f + 0.5f * kRiverPercent * kCur.widthModify));

                AddEightVertice(mid, l, r, mid, Color.white);
            }
        }
        else
        {
            //var dir = kCur.flowDir;

            if (kPre.flowDir == kCur.flowDir)
            {
                kCur.widthModify = Mathf.Clamp(kPre.widthModify + kxModify, 0f, 1.0f);


                float centerx = kCur.pos.x + 0.5f;
                float centerz = kCur.pos.z + 0.5f;

                Vector3 center = new Vector3(centerx, 0, centerz);

                var borderleft  = BorderLeft(center, dir);
                var borderright = BorderRight(center, dir);

                var downl = kBoundsPoints[0];
                var downr = kBoundsPoints[1];

                var ldir = RiverData.GetTargetDirsDir(dir, RiverData.Direction.Left);
                var rdir = RiverData.GetTargetDirsDir(dir, RiverData.Direction.Right);

                var l = ModifyVector(LerpPos(borderleft, borderright, 0.5f + 0.5f * kRiverPercent * kCur.widthModify), kCur.diffModify, dir);
                var r = ModifyVector(LerpPos(borderright, borderleft, 0.5f + 0.5f * kRiverPercent * kCur.widthModify), kCur.diffModify, dir);

                AddEightVertice(downl, l, r, downr, Color.white);
            }
            else
            {
                kCur.widthModify = Mathf.Clamp(kPre.widthModify + kxModify, 0f, 1.0f);


                float centerx = kCur.pos.x + 0.5f;
                float centerz = kCur.pos.z + 0.5f;

                Vector3 center = new Vector3(centerx, 0, centerz);

                var borderleft  = BorderLeft(center, dir);
                var borderright = BorderRight(center, dir);

                var downl = kBoundsPoints[0];
                var downr = kBoundsPoints[1];

                var diff = RiverData.ThisDirisOrisDirsDir(kCur.flowDir, kPre.flowDir);

                var l = ModifyVector(LerpPos(borderleft, borderright, 0.5f + 0.5f * kRiverPercent * kCur.widthModify));
                var r = ModifyVector(LerpPos(borderright, borderleft, 0.5f + 0.5f * kRiverPercent * kCur.widthModify));

                AddEightVertice(downl, l, r, downr, Color.white, diff);
            }
        }


        kPre  = kCurE;
        kCurE = kCur.GetLink(kCur.flowDir);
    }