예제 #1
0
        void LoadSettingFile()
        {
            string line;
            string pathBasic = Application.dataPath + "/StreamingAssets/";
            string path      = "Setting/Setting.txt";

            using (System.IO.StreamReader file = new System.IO.StreamReader(@pathBasic + path))
            {
                while ((line = file.ReadLine()) != null)
                {
                    if (line.Contains(";") || string.IsNullOrEmpty(line))
                    {
                        continue;
                    }

                    if (line.StartsWith("Localizing"))
                    {
                        LocalizingType = (LocalizingType)int.Parse(line.Split('=')[1]);
                    }
                    else if (line.StartsWith("PortName"))
                    {
                        _portName = line.Split('=')[1];
                    }
                    else if (line.StartsWith("BaudRate"))
                    {
                        _portRate = int.Parse(line.Split('=')[1]);
                    }
                }

                file.Close();
                line = string.Empty;
            }
        }
예제 #2
0
        private void LoadSettingFile()
        {
            string line;
            string pathBasic = Application.dataPath + "/StreamingAssets/";
            string path      = "Setting/Setting.txt";

            using (System.IO.StreamReader file = new System.IO.StreamReader(@pathBasic + path))
            {
                while ((line = file.ReadLine()) != null)
                {
                    if (line.Contains(";") || string.IsNullOrEmpty(line))
                    {
                        continue;
                    }

                    if (line.StartsWith("Localizing"))
                    {
                        LocalizingType = (LocalizingType)int.Parse(line.Split('=')[1]);
                    }
                    else if (line.StartsWith("port"))
                    {
                        port = line.Split('=')[1];
                    }
                    else if (line.StartsWith("baud"))
                    {
                        baud = int.Parse(line.Split('=')[1]);
                    }
                    else if (line.StartsWith("IsSingle"))
                    {
                        isSingle = bool.Parse(line.Split('=')[1]);
                    }
                    else if (line.StartsWith("IsLooking"))
                    {
                        UseLookingGless = bool.Parse(line.Split('=')[1]);
                    }
                    else if (line.StartsWith("IsTablet"))
                    {
                        UseTablet = bool.Parse(line.Split('=')[1]);
                    }
                    else if (line.StartsWith("UseWakeUp"))
                    {
                        UseWakeUp = bool.Parse(line.Split('=')[1]);
                    }
                    else if (line.StartsWith("RecordDelay"))
                    {
                        RecordDelay = float.Parse(line.Split('=')[1]);
                    }
                }
                file.Close();
                line = string.Empty;
            }
        }