123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963 |
- using System;
- using System.Collections.Generic;
- using System.Text;
- using MaidStatus;
- using UnityEngine;
- using UnityEngine.EventSystems;
- public class KaraokeDataManager : MonoBehaviour
- {
- public static bool IsExistKaraokeData(bool isFileSystemOld)
- {
- string format = "karaoke_music_enable_list_{0:000}.nei";
- if (!isFileSystemOld)
- {
- for (int i = 1; i < 101; i++)
- {
- if (GameUty.FileSystem.IsExistentFile(string.Format(format, i)))
- {
- return true;
- }
- }
- }
- else
- {
- for (int j = 1; j < 101; j++)
- {
- if (GameUty.FileSystemOld.IsExistentFile(string.Format(format, j)))
- {
- return true;
- }
- }
- }
- return false;
- }
- private static bool IsExistKaraokeCSV(int number)
- {
- string format = "karaoke_music_enable_list_{0:000}.nei";
- return GameUty.FileSystem.IsExistentFile(string.Format(format, number));
- }
- private void ReadCSV(string fileName, Action<CsvParser> callback)
- {
- if (!GameUty.FileSystem.FileOpen(fileName).IsValid())
- {
- return;
- }
- using (AFileBase afileBase = GameUty.FileSystem.FileOpen(fileName))
- {
- using (CsvParser csvParser = new CsvParser())
- {
- bool condition = csvParser.Open(afileBase);
- NDebug.Assert(condition, fileName + "\nopen failed.");
- callback(csvParser);
- }
- }
- Debug.Log(string.Format("[KaraokeManager]csvファイル「{0}」読み込み完了", fileName));
- }
- private CsvParser GetCSV(string fileName)
- {
- CsvParser csvParser = new CsvParser();
- if (!GameUty.FileSystem.FileOpen(fileName).IsValid())
- {
- return null;
- }
- using (AFileBase afileBase = GameUty.FileSystem.FileOpen(fileName))
- {
- using (csvParser)
- {
- bool condition = csvParser.Open(afileBase);
- NDebug.Assert(condition, fileName + "\nopen failed.");
- }
- }
- return csvParser;
- }
- private void LoadFoodData()
- {
- Dictionary<int, string> enableIDList = new Dictionary<int, string>();
- for (int i = 0; i < 100; i++)
- {
- this.ReadCSV(string.Format("karaoke_food_enable_list_{0:000}.nei", i + 1), delegate(CsvParser csv)
- {
- for (int j = 1; j < csv.max_cell_y; j++)
- {
- if (csv.IsCellToExistData(0, j))
- {
- int cellAsInteger = csv.GetCellAsInteger(0, j);
- string cellAsString = csv.GetCellAsString(1, j);
- if (!enableIDList.ContainsKey(cellAsInteger))
- {
- enableIDList.Add(cellAsInteger, cellAsString);
- }
- else
- {
- enableIDList[cellAsInteger] = cellAsString;
- }
- }
- }
- });
- }
- this.ReadCSV("karaoke_food.nei", delegate(CsvParser csv)
- {
- for (int j = 3; j < csv.max_cell_y; j++)
- {
- if (csv.IsCellToExistData(0, j))
- {
- KaraokeDataManager.FoodData foodData = new KaraokeDataManager.FoodData(csv, enableIDList, j);
- this.m_FoodDataArray.Add(foodData.ID, foodData);
- if (!string.IsNullOrEmpty(foodData.strTempFlagName1) && !this.m_FoodDataTempFlagArray.Contains(foodData.strTempFlagName1))
- {
- this.m_FoodDataTempFlagArray.Add(foodData.strTempFlagName1);
- }
- if (!string.IsNullOrEmpty(foodData.strTempFlagName2) && !this.m_FoodDataTempFlagArray.Contains(foodData.strTempFlagName2))
- {
- this.m_FoodDataTempFlagArray.Add(foodData.strTempFlagName2);
- }
- if (!string.IsNullOrEmpty(foodData.strTempFlagName3) && !this.m_FoodDataTempFlagArray.Contains(foodData.strTempFlagName3))
- {
- this.m_FoodDataTempFlagArray.Add(foodData.strTempFlagName3);
- }
- }
- }
- });
- }
- private void LoadMusicData()
- {
- Dictionary<int, string> enableIDList = new Dictionary<int, string>();
- for (int i = 0; i < 100; i++)
- {
- this.ReadCSV(string.Format("karaoke_music_enable_list_{0:000}.nei", i + 1), delegate(CsvParser csv)
- {
- for (int j = 1; j < csv.max_cell_y; j++)
- {
- if (csv.IsCellToExistData(0, j))
- {
- int cellAsInteger = csv.GetCellAsInteger(0, j);
- string cellAsString = csv.GetCellAsString(1, j);
- if (!enableIDList.ContainsKey(cellAsInteger))
- {
- enableIDList.Add(cellAsInteger, cellAsString);
- }
- else
- {
- enableIDList[cellAsInteger] = cellAsString;
- }
- }
- }
- });
- }
- this.ReadCSV("karaoke_music.nei", delegate(CsvParser csv)
- {
- for (int j = 1; j < csv.max_cell_y; j++)
- {
- if (csv.IsCellToExistData(0, j))
- {
- KaraokeDataManager.MusicData musicData = new KaraokeDataManager.MusicData(csv, enableIDList, j);
- this.m_MusicDataArray.Add(musicData.ID, musicData);
- }
- }
- });
- }
- private void LoadBackgroundData()
- {
- Dictionary<int, string> enableIDList = new Dictionary<int, string>();
- for (int i = 0; i < 100; i++)
- {
- this.ReadCSV(string.Format("karaoke_back_ground_enable_list_{0:000}.nei", i + 1), delegate(CsvParser csv)
- {
- for (int j = 1; j < csv.max_cell_y; j++)
- {
- if (csv.IsCellToExistData(0, j))
- {
- int cellAsInteger = csv.GetCellAsInteger(0, j);
- string cellAsString = csv.GetCellAsString(1, j);
- if (!enableIDList.ContainsKey(cellAsInteger))
- {
- enableIDList.Add(cellAsInteger, cellAsString);
- }
- else
- {
- enableIDList[cellAsInteger] = cellAsString;
- }
- }
- }
- });
- }
- this.ReadCSV("karaoke_back_ground.nei", delegate(CsvParser csv)
- {
- for (int j = 1; j < csv.max_cell_y; j++)
- {
- if (csv.IsCellToExistData(0, j))
- {
- KaraokeDataManager.BackgroundData backgroundData = new KaraokeDataManager.BackgroundData(csv, enableIDList, j);
- this.m_BackgroundDataArray.Add(backgroundData.ID, backgroundData);
- }
- }
- });
- }
- public static bool IsEnablePersonalKaraoke003(Maid maid)
- {
- return KaraokeDataManager.IsEnablePersonalKaraoke003(maid.status.personal.uniqueName);
- }
- public static bool IsEnablePersonalKaraoke004(Maid maid)
- {
- return KaraokeDataManager.IsEnablePersonalKaraoke004(maid.status.personal.uniqueName);
- }
- public static bool IsEnablePersonalKaraoke003(string personalUniqueName)
- {
- List<string> list = new List<string>
- {
- "Muku",
- "Majime",
- "Rindere",
- "Pure",
- "Cool",
- "Pride"
- };
- return list.Contains(personalUniqueName);
- }
- public static bool IsEnablePersonalKaraoke004(string personalUniqueName)
- {
- List<string> list = new List<string>
- {
- "Muku",
- "Majime",
- "Rindere",
- "Pure",
- "Cool",
- "Pride"
- };
- return list.Contains(personalUniqueName);
- }
- public static void GetMaidListAdditional(List<Maid> draw_list)
- {
- List<Maid> list = new List<Maid>();
- List<Maid> list2 = new List<Maid>();
- CharacterSelectManager.DefaultMaidList(list2);
- for (int i = 0; i < list2.Count; i++)
- {
- Maid maid = list2[i];
- if (maid.status.heroineType != HeroineType.Sub)
- {
- if (maid.ActiveSlotNo == -1)
- {
- if (KaraokeDataManager.IsEnablePersonalKaraoke003(maid))
- {
- list.Add(maid);
- }
- }
- }
- }
- draw_list.Clear();
- draw_list.AddRange(list);
- }
- public static void GetMaidListKaraoke(List<Maid> draw_list)
- {
- List<string> list = new List<string>
- {
- "Pure",
- "Cool",
- "Pride",
- "Yandere",
- "Anesan",
- "Genki",
- "Sadist",
- "Muku",
- "Majime",
- "Rindere"
- };
- if (GameMain.Instance.CMSystem.GetTmpGenericFlag("Silent_KARAOKE") == 1)
- {
- list.Add("Silent");
- }
- if (GameMain.Instance.CMSystem.GetTmpGenericFlag("Devilish_KARAOKE") == 1)
- {
- list.Add("Devilish");
- }
- if (GameMain.Instance.CMSystem.GetTmpGenericFlag("Ladylike_KARAOKE") == 1)
- {
- list.Add("Ladylike");
- }
- if (GameMain.Instance.CMSystem.GetTmpGenericFlag("Secretary_KARAOKE") == 1)
- {
- list.Add("Secretary");
- }
- if (GameMain.Instance.CMSystem.GetTmpGenericFlag("Sister_KARAOKE") == 1)
- {
- list.Add("Sister");
- }
- List<Maid> list2 = new List<Maid>();
- List<Maid> list3 = new List<Maid>();
- CharacterSelectManager.DefaultMaidList(list3);
- for (int i = 0; i < list3.Count; i++)
- {
- Maid maid = list3[i];
- if (maid.status.heroineType != HeroineType.Sub)
- {
- if (list.Contains(maid.status.personal.uniqueName))
- {
- list2.Add(maid);
- }
- }
- }
- draw_list.Clear();
- draw_list.AddRange(list2);
- }
- private void Awake()
- {
- this.LoadMusicData();
- this.LoadFoodData();
- this.LoadBackgroundData();
- if (SceneVRCommunication.Instance && !SceneVRCommunication.Instance.KaraokeMode)
- {
- this.m_NowBGIndex = 1;
- this.m_NowSelectingBGIndex = 1;
- }
- }
- private void Start()
- {
- Action<GameObject, Camera> action = delegate(GameObject targetCanvasObj, Camera targetCamera)
- {
- Canvas component2 = targetCanvasObj.GetComponent<Canvas>();
- if (component2 == null)
- {
- return;
- }
- component2.worldCamera = targetCamera;
- };
- Camera componentInChildren = EventSystem.current.gameObject.GetComponentInChildren<Camera>();
- action(this.m_CanvasVRConfig.gameObject, componentInChildren);
- action(this.m_CanvasKaraokeMainMenu.gameObject, componentInChildren);
- if (VRDialogMenu.CreateDialog())
- {
- action(VRDialogMenu.CreateDialog().gameObject, componentInChildren);
- }
- if (VRSelectorMenu.CreateSelector())
- {
- action(VRSelectorMenu.CreateSelector().gameObject, componentInChildren);
- }
- action(this.m_CanvasDialogMenu.gameObject, componentInChildren);
- action(this.m_CanvasSelectorMenu.gameObject, componentInChildren);
- VRCanvasManagerMini component = VRCanvasManager.Instance.GetComponent<VRCanvasManagerMini>();
- if (component)
- {
- component.AddCanvas(this.m_CanvasKaraokeMainMenu.GetComponent<Canvas>());
- component.AddCanvas(this.m_CanvasVRConfig.GetComponent<Canvas>());
- }
- }
- public KaraokeDataManager.FoodData[] GetFoodDataArray(bool enableDataOnly = true)
- {
- List<KaraokeDataManager.FoodData> list = new List<KaraokeDataManager.FoodData>(this.m_FoodDataArray.Values);
- if (!enableDataOnly)
- {
- return list.ToArray();
- }
- List<KaraokeDataManager.FoodData> list2 = new List<KaraokeDataManager.FoodData>();
- for (int i = 0; i < list.Count; i++)
- {
- if (list[i].IsEnable)
- {
- list2.Add(list[i]);
- }
- }
- return list2.ToArray();
- }
- public KaraokeDataManager.MusicData[] GetMusicDataArray(bool enableDataOnly = true)
- {
- List<KaraokeDataManager.MusicData> list = new List<KaraokeDataManager.MusicData>(this.m_MusicDataArray.Values);
- if (!enableDataOnly)
- {
- return list.ToArray();
- }
- List<KaraokeDataManager.MusicData> list2 = new List<KaraokeDataManager.MusicData>();
- for (int i = 0; i < list.Count; i++)
- {
- if (list[i].IsEnable)
- {
- list2.Add(list[i]);
- }
- }
- return list2.ToArray();
- }
- public KaraokeDataManager.BackgroundData[] GetBackgroundDataArray(bool enableDataOnly = true)
- {
- List<KaraokeDataManager.BackgroundData> list = new List<KaraokeDataManager.BackgroundData>(this.m_BackgroundDataArray.Values);
- if (!enableDataOnly)
- {
- return list.ToArray();
- }
- List<KaraokeDataManager.BackgroundData> list2 = new List<KaraokeDataManager.BackgroundData>();
- for (int i = 0; i < list.Count; i++)
- {
- if (list[i].IsEnable)
- {
- list2.Add(list[i]);
- }
- }
- return list2.ToArray();
- }
- public KaraokeDataManager.MusicData GetMusicData(int id)
- {
- if (!this.m_MusicDataArray.ContainsKey(id))
- {
- return null;
- }
- return this.m_MusicDataArray[id];
- }
- public bool IsExistMusicData(int musicID)
- {
- return this.m_MusicDataArray.ContainsKey(musicID);
- }
- public void StartKaraoke(int musicID)
- {
- if (this.IsExistMusicData(musicID))
- {
- KaraokeDataManager.MusicData musicData = this.m_MusicDataArray[musicID];
- Debug.Log(string.Format("[KaraokeManager]選択された楽曲の情報\r\n楽曲サムネイル:{0}\r\n楽曲シーン名:{1}\r\n音声ファイル名:{2}\r\n", musicData.strThumbnailName, musicData.strSceneName, musicData.strFileNameOgg));
- GameMain.Instance.MainCamera.FadeOut(0.5f, false, delegate
- {
- ScriptManager scriptMgr = GameMain.Instance.ScriptMgr;
- KaraokeDataManager.BackgroundData backgroundData = this.GetBackgroundDataArray(true)[this.m_NowSelectingBGIndex];
- if (backgroundData != null)
- {
- string bgname = GameMain.Instance.BgMgr.GetBGName();
- string text = GameMain.Instance.BgMgr.GetBGName();
- if (SceneVRCommunication.Instance.GetNowTime() == SceneVRCommunication.VR_TIME.NIGHT)
- {
- text = backgroundData.strFileNameNight;
- }
- else
- {
- text = backgroundData.strFileName;
- }
- if (bgname != text)
- {
- GameMain.Instance.BgMgr.ChangeBg(text);
- }
- this.m_NowBGIndex = this.m_NowSelectingBGIndex;
- this.SetTempFlag(backgroundData.strFlagName, backgroundData.flagValue);
- }
- KaraokeDataManager.FoodData foodData = null;
- if (this.m_FoodDataArray.ContainsKey(this.m_BeforeSelectedFoodIndex))
- {
- foodData = this.m_FoodDataArray[this.m_BeforeSelectedFoodIndex];
- }
- if (foodData != null)
- {
- this.SetTempFlag(foodData.strTempFlagName4, foodData.tempFlagValue4);
- this.SetTempFlag(foodData.strTempFlagName5, foodData.tempFlagValue5);
- this.SetTempFlag(foodData.strTempFlagName6, foodData.tempFlagValue6);
- }
- this.SetTempFlag("VRカラオケ曲番号", musicData.ID);
- scriptMgr.EvalScript("global.__karaoke_music_file_name = '" + musicData.strFileNameOgg + "';");
- scriptMgr.EvalScript("global.__karaoke_scene_file_name = '" + musicData.strSceneName + "';");
- scriptMgr.LoadAdvScenarioScript("karaoke_start_9999.ks", "*karaoke_start");
- scriptMgr.adv_kag.Exec();
- }, true, default(Color));
- }
- else
- {
- Debug.Log(string.Format("[KaraokeDataManager]カラオケのデータが見つからない\n楽曲データのインデックス:{0}", musicID));
- }
- }
- public void SetBGIndex(int index)
- {
- this.m_NowSelectingBGIndex = index;
- }
- public int GetNowBGIndex()
- {
- return this.m_NowBGIndex;
- }
- public int GetNowSelectingBGIndex()
- {
- return this.m_NowSelectingBGIndex;
- }
- public void SetFoodData(int index)
- {
- KaraokeDataManager.FoodData foodData = this.m_FoodDataArray[index];
- this.AddTempFlag(foodData.strTempFlagName1);
- this.AddTempFlag(foodData.strTempFlagName2);
- this.AddTempFlag(foodData.strTempFlagName3);
- this.ResetTempFlag(new string[]
- {
- foodData.strTempFlagName1,
- foodData.strTempFlagName2,
- foodData.strTempFlagName3
- });
- KaraokeDataManager.BackgroundData backgroundData = this.GetBackgroundDataArray(true)[this.m_NowBGIndex];
- if (backgroundData != null)
- {
- this.SetTempFlag(backgroundData.strFlagName, backgroundData.flagValue);
- }
- else
- {
- this.SetTempFlag("カラオケ_背景", 0);
- Debug.LogWarning("[KaraokeDatamanager]背景が「KaraokeRoom」「Villa」のどちらでもなかったので、「KaraokeRoom」の値に設定します");
- }
- KaraokeDataManager.FoodData foodData2 = null;
- if (this.m_FoodDataArray.ContainsKey(this.m_BeforeSelectedFoodIndex))
- {
- foodData2 = this.m_FoodDataArray[this.m_BeforeSelectedFoodIndex];
- }
- if (foodData2 != null)
- {
- this.SetTempFlag(foodData2.strTempFlagName4, foodData2.tempFlagValue4);
- this.SetTempFlag(foodData2.strTempFlagName5, foodData2.tempFlagValue5);
- this.SetTempFlag(foodData2.strTempFlagName6, foodData2.tempFlagValue6);
- }
- this.m_BeforeSelectedFoodIndex = index;
- string str = this.ReplacePersonal(foodData.strScenarioFile);
- if (string.IsNullOrEmpty(foodData.strScenarioLabel))
- {
- GameMain.Instance.ScriptMgr.LoadAdvScenarioScript(str + ".ks", string.Empty);
- }
- else
- {
- GameMain.Instance.ScriptMgr.LoadAdvScenarioScript(str + ".ks", "*" + foodData.strScenarioLabel);
- }
- GameMain.Instance.ScriptMgr.adv_kag.Exec();
- StringBuilder stringBuilder = new StringBuilder();
- stringBuilder.Append("[KaraokeDataManager]現在のフラグ\n");
- for (int i = 0; i < this.m_FoodDataTempFlagArray.Count; i++)
- {
- string text = this.m_FoodDataTempFlagArray[i];
- int tmpGenericFlag = GameMain.Instance.CMSystem.GetTmpGenericFlag(text);
- stringBuilder.Append(string.Format("{0}, {1}\n", text, tmpGenericFlag));
- }
- stringBuilder.Append(string.Format("前回の料理, {0}\n", GameMain.Instance.CMSystem.GetTmpGenericFlag("前回の料理")));
- Debug.Log(stringBuilder.ToString());
- }
- public void ButtonExit()
- {
- UICanvasFade mainMenu = this.m_CanvasKaraokeMainMenu;
- mainMenu.FadeOut(mainMenu.fadeTime, mainMenu.isTimeScaling, delegate()
- {
- VRDialogMenu dialog = VRDialogMenu.CreateDialog();
- if (dialog)
- {
- dialog.GetComponent<UICanvasFade>().FadeIn();
- dialog.OpenDialog("カラオケモードを終了しますか?", (VRDialogMenu.TYPE_STYLE)3, delegate(VRDialogMenu.TYPE_STYLE type)
- {
- dialog.CloseDialog();
- if (type != VRDialogMenu.TYPE_STYLE.YES)
- {
- mainMenu.FadeIn();
- return;
- }
- VRCanvasManager instance = VRCanvasManager.Instance;
- if (!instance)
- {
- Debug.LogWarning("[KaraokeDataManager]VRCanvasManagerが見つからなかった");
- return;
- }
- instance.EndKaraokeMode();
- GameMain.Instance.CMSystem.SetTmpGenericFlag("カラオケメイド追加", 0);
- });
- }
- });
- }
- private void AddTempFlag(string tempFlagName)
- {
- if (string.IsNullOrEmpty(tempFlagName))
- {
- return;
- }
- int tmpGenericFlag = GameMain.Instance.CMSystem.GetTmpGenericFlag(tempFlagName);
- GameMain.Instance.CMSystem.SetTmpGenericFlag(tempFlagName, tmpGenericFlag + 1);
- }
- private void SetTempFlag(string tempFlagName, int value)
- {
- if (string.IsNullOrEmpty(tempFlagName))
- {
- return;
- }
- GameMain.Instance.CMSystem.SetTmpGenericFlag(tempFlagName, value);
- }
- private void ResetTempFlag(params string[] exclusionTempFlagName)
- {
- for (int i = 0; i < this.m_FoodDataTempFlagArray.Count; i++)
- {
- string text = this.m_FoodDataTempFlagArray[i];
- bool flag = false;
- for (int j = 0; j < exclusionTempFlagName.Length; j++)
- {
- if (!(text != exclusionTempFlagName[j]))
- {
- flag = true;
- break;
- }
- }
- if (!flag)
- {
- GameMain.Instance.CMSystem.SetTmpGenericFlag(text, 0);
- }
- }
- }
- private void Update()
- {
- CanvasGroup component = base.GetComponent<CanvasGroup>();
- CanvasGroup parentCanvas = this.m_ParentCanvas;
- if (!GameMain.Instance.OvrMgr.OvrCamera.IsUIShow)
- {
- parentCanvas.interactable = false;
- parentCanvas.blocksRaycasts = false;
- parentCanvas.alpha = 0f;
- component.interactable = false;
- component.blocksRaycasts = false;
- component.alpha = 0f;
- return;
- }
- parentCanvas.alpha = 1f;
- component.alpha = 1f;
- bool isFallThrough = GameMain.Instance.OvrMgr.OvrCamera.IsFallThrough;
- if (isFallThrough)
- {
- parentCanvas.interactable = true;
- parentCanvas.blocksRaycasts = true;
- component.interactable = true;
- component.blocksRaycasts = true;
- }
- else
- {
- parentCanvas.interactable = false;
- parentCanvas.blocksRaycasts = false;
- component.interactable = false;
- component.blocksRaycasts = false;
- }
- bool isRotDown = GameMain.Instance.OvrMgr.OvrCamera.OvrTablet.IsRotDown;
- bool isSideBack = GameMain.Instance.OvrMgr.OvrCamera.OvrTablet.IsSideBack;
- Vector3 zero = Vector3.zero;
- zero.z = ((!isRotDown) ? 0f : 180f);
- zero.y = ((!isSideBack) ? 0f : 180f);
- zero.x = ((!isSideBack) ? 90f : -90f);
- base.transform.localEulerAngles = zero;
- }
- private void LateUpdate()
- {
- bool isUIShow = GameMain.Instance.OvrMgr.OvrCamera.IsUIShow;
- bool isFreeMode = SceneVRCommunication.Instance.IsFreeMode;
- bool uiNoHomeMode = SceneVRCommunication.Instance.UiNoHomeMode;
- bool flag = GameMain.Instance.MainCamera.IsFadeProc();
- bool flag2 = GameMain.Instance.MainCamera.IsFadeOut();
- bool isEnableSkip = SceneVRCommunication.Instance.IsEnableSkip;
- CanvasGroup parentCanvas = this.m_ParentCanvas;
- if (isUIShow)
- {
- if (uiNoHomeMode)
- {
- parentCanvas.blocksRaycasts = false;
- parentCanvas.alpha = 0f;
- }
- else
- {
- parentCanvas.alpha = 1f;
- }
- }
- if (!isFreeMode || !isUIShow)
- {
- parentCanvas.interactable = false;
- parentCanvas.blocksRaycasts = false;
- parentCanvas.alpha = 0f;
- }
- else if (!uiNoHomeMode)
- {
- parentCanvas.interactable = true;
- parentCanvas.blocksRaycasts = true;
- parentCanvas.alpha = 1f;
- }
- if (flag || flag2)
- {
- parentCanvas.blocksRaycasts = false;
- }
- }
- public void ButtonEventOpenVRConfig()
- {
- UICanvasFade canvasKaraokeMainMenu = this.m_CanvasKaraokeMainMenu;
- canvasKaraokeMainMenu.FadeOut(canvasKaraokeMainMenu.fadeTime, canvasKaraokeMainMenu.isTimeScaling, delegate()
- {
- this.m_CanvasVRConfig.FadeIn();
- });
- }
- public void ButtonEventOpenKaraokeMainMenu()
- {
- UICanvasFade canvasVRConfig = this.m_CanvasVRConfig;
- canvasVRConfig.FadeOut(canvasVRConfig.fadeTime, canvasVRConfig.isTimeScaling, delegate()
- {
- this.m_CanvasKaraokeMainMenu.FadeIn();
- });
- }
- private string ReplacePersonal(string fileName)
- {
- Maid maid = GameMain.Instance.CharacterMgr.GetMaid(0);
- fileName = ((!(maid == null)) ? ScriptManager.ReplacePersonal(maid, fileName) : fileName);
- return fileName;
- }
- public const string STR_MAID_ADD_CALL_FLAG = "カラオケメイド追加";
- public const string STR_PERSONAL_SILENT_ENABLED_FLAG = "Silent_KARAOKE";
- public const string STR_PERSONAL_DEVILISH_ENABLED_FLAG = "Devilish_KARAOKE";
- public const string STR_PERSONAL_LADYLIKE_ENABLED_FLAG = "Ladylike_KARAOKE";
- public const string STR_PERSONAL_SECRETARY_ENABLED_FLAG = "Secretary_KARAOKE";
- public const string STR_PERSONAL_SISTER_ENABLED_FLAG = "Sister_KARAOKE";
- private Dictionary<int, KaraokeDataManager.MusicData> m_MusicDataArray = new Dictionary<int, KaraokeDataManager.MusicData>();
- private Dictionary<int, KaraokeDataManager.BackgroundData> m_BackgroundDataArray = new Dictionary<int, KaraokeDataManager.BackgroundData>();
- private Dictionary<int, KaraokeDataManager.FoodData> m_FoodDataArray = new Dictionary<int, KaraokeDataManager.FoodData>();
- private List<string> m_FoodDataTempFlagArray = new List<string>();
- private int m_BeforeSelectedFoodIndex = -1;
- private int m_NowSelectingBGIndex;
- private int m_NowBGIndex;
- [SerializeField]
- private CanvasGroup m_ParentCanvas;
- [SerializeField]
- private UICanvasFade m_CanvasVRConfig;
- [SerializeField]
- private UICanvasFade m_CanvasKaraokeMainMenu;
- [SerializeField]
- private VRDialogMenu m_CanvasDialogMenu;
- [SerializeField]
- private VRSelectorMenu m_CanvasSelectorMenu;
- public class FoodData
- {
- public FoodData(CsvParser csv, Dictionary<int, string> enable_list, int y)
- {
- int num = 0;
- this.ID = csv.GetCellAsInteger(num++, y);
- num++;
- this.strThumbnailName = csv.GetCellAsString(num++, y);
- this.strScenarioFile = csv.GetCellAsString(num++, y);
- this.strScenarioLabel = csv.GetCellAsString(num++, y);
- this.strTempFlagName1 = csv.GetCellAsString(num++, y);
- this.strTempFlagName2 = csv.GetCellAsString(num++, y);
- this.strTempFlagName3 = csv.GetCellAsString(num++, y);
- this.GetFlagAndValue(csv.GetCellAsString(num++, y), ref this.strTempFlagName4, ref this.tempFlagValue4);
- this.GetFlagAndValue(csv.GetCellAsString(num++, y), ref this.strTempFlagName5, ref this.tempFlagValue5);
- this.GetFlagAndValue(csv.GetCellAsString(num++, y), ref this.strTempFlagName6, ref this.tempFlagValue6);
- this.isEnableID = enable_list.ContainsKey(this.ID);
- string text = string.Empty;
- if (this.isEnableID)
- {
- text = enable_list[this.ID];
- }
- if (!string.IsNullOrEmpty(text))
- {
- this.pluginType = text.ToLower();
- }
- }
- private void GetFlagAndValue(string strCellData, ref string strFlag, ref int value)
- {
- if (string.IsNullOrEmpty(strCellData))
- {
- return;
- }
- string[] array = strCellData.Split(new char[]
- {
- ','
- });
- strFlag = array[0];
- value = int.Parse(array[1]);
- }
- public bool IsEnable
- {
- get
- {
- bool flag = string.IsNullOrEmpty(this.pluginType) || PluginData.IsEnabled(this.pluginType);
- if (this.pluginType == "karaoke002" && this.isEnableID && !flag)
- {
- flag = KaraokeDataManager.IsExistKaraokeCSV(2);
- Debug.Log("カラオケパック002\u3000新ファイルシステム:" + flag);
- }
- return this.isEnableID && flag;
- }
- }
- public int ID;
- public string strThumbnailName = string.Empty;
- public string strScenarioFile = string.Empty;
- public string strScenarioLabel = string.Empty;
- public string strTempFlagName1 = string.Empty;
- public string strTempFlagName2 = string.Empty;
- public string strTempFlagName3 = string.Empty;
- public string strTempFlagName4 = string.Empty;
- public string strTempFlagName5 = string.Empty;
- public string strTempFlagName6 = string.Empty;
- public int tempFlagValue4;
- public int tempFlagValue5;
- public int tempFlagValue6;
- public string pluginType = string.Empty;
- private bool isEnableID;
- public static readonly int ID_BUTTON_MAID_ADDITIONAL = 140;
- public static readonly int ID_BUTTON_MAID_ = 150;
- }
- public class MusicData
- {
- public MusicData(CsvParser csv_default, Dictionary<int, string> enable_list, int y)
- {
- int num = 0;
- this.ID = csv_default.GetCellAsInteger(num++, y);
- num++;
- this.strThumbnailName = csv_default.GetCellAsString(num++, y);
- num++;
- this.strSceneName = csv_default.GetCellAsString(num++, y);
- this.strFileNameOgg = csv_default.GetCellAsString(num++, y);
- this.isEnableID = enable_list.ContainsKey(this.ID);
- string text = string.Empty;
- if (this.isEnableID)
- {
- text = enable_list[this.ID];
- }
- if (!string.IsNullOrEmpty(text))
- {
- this.pluginType = text.ToLower();
- }
- }
- public bool IsEnable
- {
- get
- {
- bool flag = string.IsNullOrEmpty(this.pluginType) || PluginData.IsEnabled(this.pluginType);
- if (this.pluginType == "karaoke002" && this.isEnableID && !flag)
- {
- flag = KaraokeDataManager.IsExistKaraokeCSV(2);
- Debug.Log("カラオケパック002\u3000新ファイルシステム:" + flag);
- }
- return this.isEnableID && flag;
- }
- }
- public int ID;
- public string strThumbnailName = string.Empty;
- public string strSceneName = string.Empty;
- public string strFileNameOgg = string.Empty;
- public string pluginType = string.Empty;
- private bool isEnableID;
- }
- public class BackgroundData
- {
- public BackgroundData(CsvParser csv, Dictionary<int, string> enable_list, int y)
- {
- int num = 0;
- this.ID = csv.GetCellAsInteger(num++, y);
- this.strThumbnailName = csv.GetCellAsString(num++, y);
- this.strFileName = csv.GetCellAsString(num++, y);
- this.strFileNameNight = csv.GetCellAsString(num++, y);
- this.strFlagName = csv.GetCellAsString(num++, y);
- this.flagValue = csv.GetCellAsInteger(num++, y);
- this.isEnableID = enable_list.ContainsKey(this.ID);
- string text = string.Empty;
- if (this.isEnableID)
- {
- text = enable_list[this.ID];
- }
- if (!string.IsNullOrEmpty(text))
- {
- this.pluginType = text.ToLower();
- }
- }
- public bool IsEnable
- {
- get
- {
- bool flag = string.IsNullOrEmpty(this.pluginType) || PluginData.IsEnabled(this.pluginType);
- if (this.pluginType == "karaoke002" && this.isEnableID && !flag)
- {
- flag = KaraokeDataManager.IsExistKaraokeCSV(2);
- Debug.Log("カラオケパック002\u3000新ファイルシステム:" + flag);
- }
- return this.isEnableID && flag;
- }
- }
- public int ID;
- public string strThumbnailName = string.Empty;
- public string strFileName = string.Empty;
- public string strFileNameNight = string.Empty;
- public string strFlagName = string.Empty;
- public int flagValue = -1;
- public string pluginType = string.Empty;
- private bool isEnableID;
- }
- }
|