Exemplo n.º 1
0
 void Start()
 {
     GetComponent <MeshFilter>().mesh = GeometryMaker.MakePrism();
 }
Exemplo n.º 2
0
        private Dictionary <Decoration, List <Geometry> > PrepareGeometries(Pair pair, FormattedText visibleFormattedText, List <Decoration> decorations, EDecorationType decorationType, GeometryMaker gMaker)
        {
            Dictionary <Decoration, List <Geometry> > geometryDictionary = new Dictionary <Decoration, List <Geometry> >();

            foreach (Decoration dec in decorations)
            {
                List <Geometry> geomList = new List <Geometry>();
                if (dec.DecorationType == decorationType)
                {
                    List <Pair> ranges = dec.Ranges(this.Text);
                    foreach (Pair p in ranges)
                    {
                        if (p.End > pair.Start && p.Start < pair.Start + VisibleText.Length)
                        {
                            int      adjustedStart  = Math.Max(p.Start - pair.Start, 0);
                            int      adjustedLength = Math.Min(p.Length + Math.Min(p.Start - pair.Start, 0), pair.Length - adjustedStart);
                            Geometry geom           = gMaker(visibleFormattedText, new Pair(adjustedStart, adjustedLength));
                            geomList.Add(geom);
                        }
                    }
                }
                geometryDictionary.Add(dec, geomList);
            }
            return(geometryDictionary);
        }