using System; using System.Collections.Generic; using UnityEngine; public class PhotoFaceData { private PhotoFaceData() { } public static void Create() { if (PhotoFaceData.face_data_ != null) { return; } PhotoFaceData.face_data_ = new List(); using (AFileBase afileBase = GameUty.FileSystem.FileOpen("phot_face_list.nei")) { using (CsvParser csvParser = new CsvParser()) { bool condition = csvParser.Open(afileBase); NDebug.Assert(condition, "phot_face_list.nei\nopen failed."); for (int i = 1; i < csvParser.max_cell_y; i++) { if (csvParser.IsCellToExistData(0, i)) { int num = 0; PhotoFaceData photoFaceData = new PhotoFaceData(); photoFaceData.id = csvParser.GetCellAsInteger(num++, i); photoFaceData.category = csvParser.GetCellAsString(num++, i); photoFaceData.name = csvParser.GetCellAsString(num++, i); photoFaceData.setting_name = csvParser.GetCellAsString(num++, i); PhotoFaceData.face_data_.Add(photoFaceData); if (photoFaceData.setting_name == "通常") { PhotoFaceData.init_data_ = photoFaceData; } } } } } PhotoFaceData.category_list_ = new Dictionary>(); PhotoFaceData.popup_menu_list_ = new List>(); HashSet hashSet = new HashSet(); List data = PhotoFaceData.data; for (int j = 0; j < data.Count; j++) { if (!PhotoFaceData.category_list_.ContainsKey(data[j].category)) { PhotoFaceData.category_list_.Add(data[j].category, new List()); } PhotoFaceData.category_list_[data[j].category].Add(data[j]); if (!hashSet.Contains(data[j].category)) { PhotoFaceData.popup_menu_list_.Add(new KeyValuePair(data[j].category, null)); hashSet.Add(data[j].category); } } } public string termName { get { return "ScenePhotoMode/表情タイプ/" + this.name.TrimEnd(new char[0]); } } public void Apply(Maid maid) { if (maid == null || maid.body0 == null || maid.body0.m_Bones == null || maid.IsBusy) { return; } maid.FaceAnime(this.setting_name, 0f, 0); } public float[] BlendArray(Maid maid) { if (maid == null || maid.body0 == null || maid.body0.m_Bones == null || maid.IsBusy) { return null; } return maid.body0.Face.morph.dicBlendSet[this.setting_name]; } public static List data { get { return PhotoFaceData.face_data_; } } public static PhotoFaceData init_data { get { return PhotoFaceData.init_data_; } } public static Dictionary> category_list { get { return PhotoFaceData.category_list_; } } public static List> popup_category_list { get { return PhotoFaceData.popup_menu_list_; } } public static PhotoFaceData Get(long id) { for (int i = 0; i < PhotoFaceData.face_data_.Count; i++) { if ((long)PhotoFaceData.face_data_[i].id == id) { return PhotoFaceData.face_data_[i]; } } return null; } public int id; public string category; public string name; public string setting_name; private static PhotoFaceData init_data_; private static List face_data_; private static Dictionary> category_list_; private static List> popup_menu_list_; }