static public List <temm> loadTxt(string Name)
    {
        /// Количество строк
        int q = 0;

        using (StreamReader reader1 = File.OpenText(Name))
        {
            string h = null;
            while ((h = reader1.ReadLine()) != null)
            {
                if (h[0] != '!')
                {
                    q++;
                }
            }
        }
        number = q;

        List <temm> res = new List <temm>(q);

        using (StreamReader reader1 = File.OpenText(Name))
        {
            string s = null;
            while ((s = reader1.ReadLine()) != null)
            {
                if (s[0] != '!')
                {
                    temm temp = new temm();
                    temp.put(s.Split(','));
                    res.Add(temp);
                }
            }
        }
        return(res);
    }
Ejemplo n.º 2
0
    public void make(temm t)
    {
        buf = "";
        //angle = new float();
        number  = int.Parse(t.x[1]);
        command = int.Parse(t.x[0]);
        //Debug.Log (command);
        position.x = float.Parse(t.x[2]) / 10;
        Debug.Log(position.x);
        position.y = float.Parse(t.x[3]);
        position.z = float.Parse(t.x[4]) / 10;
        angle      = float.Parse(t.x[5]);
        fline      = int.Parse(t.x[7]);
        countsol   = int.Parse(t.x[6]);
        fline_dist = 3f;//float.Parse(t.x[0]);

        for (int i = 8; i < t.x.Length; i++)
        {
            buf += t.x[i];
            if (i != (t.x.Length - 1))
            {
                buf += ",";
            }
        }
        //Debug.Log(buf);
    }