Esempio n. 1
0
 public void UpdateLineInfoSelfty(RP_LineInfo lineInfo)
 {
     if (lineInfo != null)
     {
         _lineInfo = lineInfo;
     }
 }
        /// <summary>
        /// 设置显示点
        /// </summary>
        /// <param name="positions"></param>
        public GameObject[] CreatePoints(string lineName, RP_Pos[] positions, GameObject prefab, RP_LineInfo lineInfo = null)
        {
            GameObject[] created = null;
            var          oldLine = lines.Find(x => x.lineName == lineName);

            if (oldLine != null)
            {
                oldLine.UpdateLineInfoSelfty(lineInfo);
                oldLine.startAngle = graphInfo.startAngle;
                oldLine.clockwise  = graphInfo.clockwise;
                created            = oldLine.ResetPoints(prefab, Radius, positions);
            }
            else
            {
                var line = new RP_Line(lineName, transform);
                line.startAngle = graphInfo.startAngle;
                line.clockwise  = graphInfo.clockwise;
                line.UpdateLineInfoSelfty(lineInfo);
                lines.Add(line);

                created = line.ResetPoints(prefab, Radius, positions);
            }
            SetAllDirty();
            return(created);
        }