Пример #1
0
    /*constructor for initial from database*/
    public Word(string name, string strokes, int stroke_count, string rbuso)
    {
        strokeList = new ArrayList();

        wordName = name;
        buso     = rbuso;
        property = rbuso;
        if (strokes == null)
        {
            Debug.Log("null strokes");
            //throw new UnityException("null strokes");
        }
        else
        {
            System.IO.StringReader stokeReader = new System.IO.StringReader(strokes);
            for (int i = 0; i < stroke_count; i++)
            {
                Stroke t_stroke = new Stroke();
                for (int j = 0; j < pointPerStroke; j++)
                {
                    string    line  = stokeReader.ReadLine();
                    string [] split = line.Split(new char[] { ' ' });
                    Vector3   p     = new Vector3(float.Parse(split[0]), float.Parse(split[1]), float.Parse(split[2]));
                    t_stroke.AddPoint(p);
                }
                strokeList.Add(t_stroke);
            }
        }
        finishIndex = stroke_count;
    }
Пример #2
0
 public void AddPointToStroke(Point newPoint)
 {
     if (m_stroke != null)
     {
         m_stroke.AddPoint(ScalePointToCanvas(newPoint));
     }
 }
Пример #3
0
 public void Writing(Vector3 worldPoint)
 {
     curStroke.AddPoint(worldPoint);
 }