void StringToCurve(string data)
        {
            points = new List <FloatString4>();

            string[] lines = data.Split('\n');
            foreach (string line in lines)
            {
                string[] pcs = line.Split(new char[] { '=', ' ' }, StringSplitOptions.RemoveEmptyEntries);
                if ((pcs.Length >= 3) && (pcs[0] == "key"))
                {
                    FloatString4 nv = new FloatString4();
                    if (pcs.Length >= 5)
                    {
                        nv.strings = new string[] { pcs[1], pcs[2], pcs[3], pcs[4] };
                        nv.twoMode = false;
                    }
                    else
                    {
                        nv.strings = new string[] { pcs[1], pcs[2], "0", "0" };
                        nv.twoMode = true;
                    }
                    nv.UpdateFloats();
                    points.Add(nv);
                }
            }

            if (!textChanged)
            {
                textVersion = CurveToString();
            }

            curveNeedsUpdate = true;
        }
Beispiel #2
0
        void StringToCurve(string data)
        {
            points = new List <FloatString4>();

            string[] lines = data.Split('\n');
            foreach (string line in lines)
            {
                string[] pcs = line.Split(new char[] { '=', ' ' }, StringSplitOptions.RemoveEmptyEntries);
                if ((pcs.Length >= 5) && (pcs[0] == "key"))
                {
                    FloatString4 nv = new FloatString4();
                    nv.strings = new string[] { pcs[1], pcs[2], pcs[3], pcs[4] };
                    nv.UpdateFloats();
                    points.Add(nv);
                }
            }

            curveNeedsUpdate = true;
        }