//static bool isInsideImg(zzPoint pPoint,Texture2D tex)
    //{
    //    return pPoint.x >= 0
    //            && pPoint.x < tex.width
    //            && pPoint.y >= 0
    //            && pPoint.y < tex.height;
    //}
    static zzPoint[] beginEdge(zzActiveChart tex, zzPoint beginPosition, int[,] pProgressdMark, int pMark)
    {
        List<zzPoint> lOut = new List<zzPoint>();
        lOut.Add(beginPosition);
        pProgressdMark[beginPosition.x, beginPosition.y] = pMark;
        DetectDirection lDetectDirection = new DetectDirection();
        //int nowX=beginX,nowY=beginY;
        zzPoint lNowPoint = beginPosition;
        //int lNextX,lNextY;
        zzPoint lNextPoint;
        int lTotalNum = tex.width*tex.height;
        while(true)
        {

            lNextPoint = lDetectDirection.getOfsetPoint(lNowPoint);
            var lNextDirection = lDetectDirection.nextDirection();
            var lNextNextPoint = lNextDirection.getOfsetPoint(lNowPoint);

            if (tex.isInside(lNextPoint) && tex.isActive(lNextPoint))
            {

                lNowPoint = lNextPoint;

                if (lNowPoint == beginPosition)
                    break;
                pProgressdMark[lNowPoint.x, lNowPoint.y] = pMark;
                lOut.Add(lNowPoint);
                lDetectDirection.toPreDirection();
                lDetectDirection.toPreDirection();
            }
            else
            {
                //不可用,继续顺时针寻找
                lDetectDirection.toNextDirection();
            }

            if(lOut.Count>lTotalNum)
            {
                Debug.LogError("error ");
                break;
            }
        }

        return lOut.ToArray();
    }