示例#1
0
        private Dictionary <string, KKAnimeFaceController.FacePattern> LoadFacePatternDic()
        {
            Dictionary <string, KKAnimeFaceController.FacePattern> dictionary = new Dictionary <string, KKAnimeFaceController.FacePattern>();
            string text  = "BepInEx/KKVMDPlayPlugin/FaceData.txt";
            string text2 = "BepInEx/KKVMDPlayPlugin/FaceData_sample.txt";

            if (!File.Exists(text) && File.Exists(text2))
            {
                File.Copy(text2, text);
            }
            string[] array = File.ReadAllText(text, Encoding.UTF8).Split(new string[]
            {
                "\r\n"
            }, StringSplitOptions.None);
            for (int i = 0; i < array.Length; i++)
            {
                string text3 = array[i].Trim();
                if (!NullCheck.IsNullOrEmpty(text3) && !text3.StartsWith("#"))
                {
                    KKAnimeFaceController.FacePattern facePattern = this.LoadTextData(text3);
                    if (facePattern != null)
                    {
                        dictionary.Add(facePattern.name, facePattern);
                    }
                }
            }
            return(dictionary);
        }