DanceMain.cs 39 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.IO;
  5. using System.Linq;
  6. using System.Text.RegularExpressions;
  7. using UnityEngine;
  8. using UnityEngine.Rendering;
  9. using UnityEngine.SceneManagement;
  10. public class DanceMain : MonoBehaviour
  11. {
  12. public static string RecetJumpLabel { private get; set; }
  13. public List<Maid> DanceMaid
  14. {
  15. get
  16. {
  17. return this.m_listMaid;
  18. }
  19. }
  20. public Maid UserMaid
  21. {
  22. get
  23. {
  24. return this.m_maidUser;
  25. }
  26. }
  27. public bool IsDanceEnd { get; private set; }
  28. public Transform OvrCamTrans
  29. {
  30. get
  31. {
  32. return this.m_trOvrDummyCam;
  33. }
  34. }
  35. public float DepthFocalSize
  36. {
  37. get
  38. {
  39. return this.m_DepthFocalSize;
  40. }
  41. set
  42. {
  43. this.m_DepthFocalSize = value;
  44. if (RhythmAction_Mgr.Instance)
  45. {
  46. RhythmAction_Mgr.Instance.SetFocalSize(value);
  47. }
  48. }
  49. }
  50. public string GetFolderPathToBinaryData()
  51. {
  52. string binaryFolderName = this.BinaryFolderName;
  53. string text = Path.GetFileNameWithoutExtension(this.BinaryFolderName).ToLower();
  54. return "Assets/Resources/SceneDance/" + Path.GetFileNameWithoutExtension(this.BinaryFolderName).ToLower() + "/";
  55. }
  56. private void Awake()
  57. {
  58. this.m_boDebugDummyBody = false;
  59. NTime.Reset();
  60. string name = SceneManager.GetActiveScene().name;
  61. if (name.ToLower().Contains("_release") && !this.UseBinaryData)
  62. {
  63. Debug.LogError("ダンスシーン:" + name + " でUseBinaryDataがONになっていません。強制でONにします。");
  64. this.UseBinaryData = true;
  65. }
  66. Dictionary<string, string> tag_backup = GameMain.Instance.ScriptMgr.adv_kag.tag_backup;
  67. string strScriptLabel;
  68. if (tag_backup != null && tag_backup.TryGetValue("label", out strScriptLabel))
  69. {
  70. this.m_strScriptLabel = strScriptLabel;
  71. }
  72. NDebug.Assert(this.m_listDummyAnimChara.Count == this.m_listAnimName.Count, "m_listDummyAnimChara と m_listAnimName の数は同一でないといけません。");
  73. NDebug.Assert(this.m_AnimatorData != null, "AnimatorDataが外れています。");
  74. NDebug.Assert(this.m_listTestPreset.Count == this.m_listAnimName.Count, "プリセット数が不正です。");
  75. NDebug.Assert(!string.IsNullOrEmpty(this.m_strMasterAudioFileName), "マスター用MasterAudioFileNameが必要です。");
  76. bool flag = DanceMain.IsDanceRecet;
  77. flag |= (RhythmAction_Mgr.NowState == RhythmAction_Mgr.DanceState.Dance_Second);
  78. flag |= (RhythmAction_Mgr.NowDance == RhythmAction_Mgr.DanceType.Encore);
  79. flag |= RhythmAction_Mgr.IsVSDance;
  80. if (flag && !DanceMain.KaraokeMode)
  81. {
  82. DanceSelect.SelectMaidActive(DanceMain.SelectDanceData);
  83. DanceMain.IsDanceRecet = false;
  84. }
  85. if (this.time_line_binary_ == null)
  86. {
  87. this.maid_data_binary_ = new DanceObjectDataBinary();
  88. this.maid_item_binary_ = new DanceObjectDataBinary();
  89. this.maid_event_binary_ = new DanceObjectDataBinary();
  90. this.time_line_binary_ = new AWReadBinaryData();
  91. if (this.UseBinaryData)
  92. {
  93. string file_name = this.GetFolderPathToBinaryData() + "item_data.bytes";
  94. this.maid_item_binary_.ReadData(file_name);
  95. NDebug.Assert(this.m_listItemObject.Count == this.maid_item_binary_.datas.Length, "アイテム数がバイナリデータと不一致");
  96. this.maid_item_binary_.Restoration(false);
  97. for (int i = 0; i < this.m_listItemObject.Count; i++)
  98. {
  99. if (!(this.m_listItemObject[i] != null))
  100. {
  101. this.m_listItemObject[i] = this.maid_item_binary_.datas[i].obj;
  102. }
  103. }
  104. file_name = this.GetFolderPathToBinaryData() + "event_data.bytes";
  105. this.maid_event_binary_.ReadData(file_name);
  106. NDebug.Assert(this.m_listEventObject.Count == this.maid_event_binary_.datas.Length, "イベント数がバイナリデータと不一致");
  107. this.maid_event_binary_.Restoration(false);
  108. for (int j = 0; j < this.m_listEventObject.Count; j++)
  109. {
  110. if (!(this.m_listEventObject[j] != null))
  111. {
  112. this.m_listEventObject[j] = this.maid_event_binary_.datas[j].obj;
  113. }
  114. }
  115. file_name = this.GetFolderPathToBinaryData() + "maid_data.bytes";
  116. this.maid_data_binary_.ReadData(file_name);
  117. NDebug.Assert(this.m_listDummyAnimChara.Count == this.maid_data_binary_.datas.Length, "メイド数がバイナリデータと不一致");
  118. this.maid_data_binary_.Restoration(true);
  119. for (int k = 0; k < this.m_listDummyAnimChara.Count; k++)
  120. {
  121. if (!(this.m_listDummyAnimChara[k] != null))
  122. {
  123. this.m_listDummyAnimChara[k] = this.maid_data_binary_.datas[k].obj;
  124. this.m_listDebugObj.Add(this.m_listDummyAnimChara[k]);
  125. }
  126. }
  127. file_name = this.GetFolderPathToBinaryData() + "timeline_data.bytes";
  128. this.time_line_binary_.ReadFile(file_name);
  129. this.maid_item_binary_.AttachObject(this.m_AnimatorData.getTake(this.m_strPlayTakeName));
  130. this.maid_event_binary_.AttachObject(this.m_AnimatorData.getTake(this.m_strPlayTakeName));
  131. }
  132. }
  133. this.m_listKuchiPattern = new string[this.m_listKuchiPakuFile.Count];
  134. Func<string, string> func = delegate(string fn)
  135. {
  136. TextAsset textAsset2 = Resources.Load("SceneDance/" + fn) as TextAsset;
  137. NDebug.Assert(textAsset2 != null, "口パクパターンテキストファイルが開けません。" + fn);
  138. string text4 = textAsset2.text;
  139. NDebug.Assert(text4.Length != 0, "口パクパターンファイル内が空です。" + fn);
  140. return Regex.Replace(text4, "(\\r|\\n| )", string.Empty);
  141. };
  142. for (int l = 0; l < this.m_listKuchiPakuFile.Count; l++)
  143. {
  144. string text = this.m_listKuchiPakuFile[l];
  145. if (!string.IsNullOrEmpty(text))
  146. {
  147. this.m_listKuchiPattern[l] = func(text);
  148. }
  149. }
  150. if (this.m_KuchipakuCacheFileName != null)
  151. {
  152. for (int m2 = 0; m2 < this.m_KuchipakuCacheFileName.Length; m2++)
  153. {
  154. string text2 = this.m_KuchipakuCacheFileName[m2];
  155. if (!string.IsNullOrEmpty(text2))
  156. {
  157. this.m_KuchiPatternCache[text2] = func(text2);
  158. }
  159. }
  160. }
  161. this.m_AnimatorData.playOnStart = null;
  162. this.m_AnimatorData.bAutoTimeUpdate = false;
  163. if (GameMain.Instance.VRMode && GameMain.Instance.CMSystem.GetTmpGenericFlag("ダンスOVRカメラタイプ") == 1)
  164. {
  165. this.m_trOvrDummyCam = new GameObject("OvrDummyDanceCam").transform;
  166. this.m_trOvrDummyCam.gameObject.AddComponent<Camera>().enabled = false;
  167. this.m_OvrCam = GameMain.Instance.OvrMgr.OvrCamera;
  168. }
  169. GameObject gameObject = GameObject.Find("RhythmAction_Mgr");
  170. if (!gameObject)
  171. {
  172. gameObject = UnityEngine.Object.Instantiate<GameObject>(Resources.Load<GameObject>("SceneDance/Rhythm_Action/Prefab/RhythmAction_Mgr"));
  173. }
  174. if (!RhythmAction_Mgr.Instance)
  175. {
  176. gameObject.GetComponent<RhythmAction_Mgr>().InstanceInit();
  177. }
  178. for (int n = 0; n < this.m_listTestPreset.Count; n++)
  179. {
  180. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(n);
  181. if (maid)
  182. {
  183. if (!this.m_maidUser)
  184. {
  185. this.m_maidUser = DanceSelect.SelectTopMaid;
  186. }
  187. maid.Visible = true;
  188. }
  189. }
  190. if (!this.m_maidUser)
  191. {
  192. this.m_maidUser = GameMain.Instance.CharacterMgr.GetMaid(0);
  193. }
  194. if (DanceMain.KaraokeMode)
  195. {
  196. return;
  197. }
  198. GameMain.Instance.CharacterMgr.ResetCharaPosAll();
  199. if (DanceMain.SelectDanceData != null)
  200. {
  201. for (int num = 0; num < DanceMain.SelectDanceData.select_chara_num; num++)
  202. {
  203. RhythmAction_Mgr.Instance.FactOrderList.Add(GameMain.Instance.CharacterMgr.GetMaid(num));
  204. }
  205. }
  206. if (RhythmAction_Mgr.NowDance != RhythmAction_Mgr.DanceType.BenchMark && DanceMain.SelectDanceData != null && DanceMain.SelectDanceData.maid_order.Count > 0 && (!RhythmAction_Mgr.IsVSDance || !VsDanceDataMgr.Instance.CurrentSetting.isFixedMaidOrder))
  207. {
  208. List<Maid> list = new List<Maid>();
  209. for (int num2 = 0; num2 < DanceMain.SelectDanceData.maid_order.Count; num2++)
  210. {
  211. list.Add(GameMain.Instance.CharacterMgr.GetMaid(num2));
  212. }
  213. GameMain.Instance.CharacterMgr.DeactivateCharaAll();
  214. GameMain.Instance.CharacterMgr.DeactivateMaid(0);
  215. for (int num3 = 0; num3 < DanceMain.SelectDanceData.maid_order.Count; num3++)
  216. {
  217. int index = DanceMain.SelectDanceData.maid_order[num3];
  218. if (list[index])
  219. {
  220. GameMain.Instance.CharacterMgr.SetActiveMaid(list[index], num3);
  221. list[index].Visible = true;
  222. }
  223. }
  224. }
  225. if (this.m_listTestPreset.Count <= RhythmAction_Mgr.Instance.FactOrderList.Count)
  226. {
  227. if (!RhythmAction_Mgr.Instance.FactOrderList.Any((Maid e) => !e) && DanceMain.SelectDanceData != null)
  228. {
  229. goto IL_AF3;
  230. }
  231. }
  232. for (int num4 = 0; num4 < this.m_listTestPreset.Count; num4++)
  233. {
  234. Maid maid2 = GameMain.Instance.CharacterMgr.GetMaid(num4);
  235. if (!maid2 || DanceMain.SelectDanceData == null)
  236. {
  237. if (!maid2)
  238. {
  239. maid2 = GameMain.Instance.CharacterMgr.AddStockMaid();
  240. GameMain.Instance.CharacterMgr.SetActiveMaid(maid2, num4);
  241. this.m_listTempMaid.Add(maid2);
  242. }
  243. CharacterMgr.Preset preset = null;
  244. bool flag2 = DanceMain.SelectDanceData != null && num4 < DanceMain.SelectDanceData.preset_name.Count && !string.IsNullOrEmpty(DanceMain.SelectDanceData.preset_name[num4]);
  245. string text3 = (!flag2) ? this.m_listTestPreset[num4] : DanceMain.SelectDanceData.preset_name[num4];
  246. byte[] buffer = null;
  247. TextAsset textAsset = Resources.Load("Preset/" + text3) as TextAsset;
  248. if (textAsset == null)
  249. {
  250. using (AFileBase afileBase = GameUty.FileSystem.FileOpen(text3 + ".preset"))
  251. {
  252. if (afileBase.IsValid())
  253. {
  254. buffer = afileBase.ReadAll();
  255. }
  256. else
  257. {
  258. NDebug.Assert(string.Format("{0}はResourcesにもGameDataにもありませんでした。", text3), false);
  259. }
  260. }
  261. }
  262. else
  263. {
  264. buffer = textAsset.bytes;
  265. }
  266. using (MemoryStream memoryStream = new MemoryStream(buffer))
  267. {
  268. using (BinaryReader binaryReader = new BinaryReader(memoryStream))
  269. {
  270. preset = GameMain.Instance.CharacterMgr.PresetLoad(binaryReader, text3);
  271. }
  272. }
  273. if (preset != null)
  274. {
  275. GameMain.Instance.CharacterMgr.PresetSet(maid2, preset);
  276. }
  277. maid2.Visible = true;
  278. }
  279. }
  280. if (DanceMain.SelectDanceData != null)
  281. {
  282. if (DanceMain.SelectDanceData.maid_order.Count > 0)
  283. {
  284. for (int num5 = 0; num5 < DanceMain.SelectDanceData.maid_order.Count; num5++)
  285. {
  286. int index2 = DanceMain.SelectDanceData.maid_order[num5];
  287. if (!RhythmAction_Mgr.Instance.FactOrderList[index2])
  288. {
  289. RhythmAction_Mgr.Instance.FactOrderList[index2] = GameMain.Instance.CharacterMgr.GetMaid(num5);
  290. }
  291. }
  292. }
  293. else
  294. {
  295. for (int num6 = 0; num6 < RhythmAction_Mgr.Instance.FactOrderList.Count; num6++)
  296. {
  297. if (!RhythmAction_Mgr.Instance.FactOrderList[num6])
  298. {
  299. RhythmAction_Mgr.Instance.FactOrderList[num6] = GameMain.Instance.CharacterMgr.GetMaid(num6);
  300. }
  301. }
  302. }
  303. }
  304. IL_AF3:
  305. if (this.m_PresetCopyToDummyChara != null)
  306. {
  307. NDebug.Assert(this.m_PresetCopyToDummyChara.Length <= this.m_listDummyAnimChara.Count<GameObject>(), "PresetCopyToDummyChara は listDummyAnimChara の数以下である必要があります。");
  308. for (int num7 = 0; num7 < this.m_PresetCopyToDummyChara.Length; num7++)
  309. {
  310. int num8 = this.m_PresetCopyToDummyChara[num7];
  311. if (num8 != num7)
  312. {
  313. Maid maid3 = GameMain.Instance.CharacterMgr.GetMaid(num8);
  314. if (maid3)
  315. {
  316. byte[] buffer2 = GameMain.Instance.CharacterMgr.PresetSaveNotWriteFile(maid3, CharacterMgr.PresetType.All);
  317. BinaryReader binaryReader2 = new BinaryReader(new MemoryStream(buffer2));
  318. CharacterMgr.Preset f_prest = GameMain.Instance.CharacterMgr.PresetLoad(binaryReader2, string.Empty);
  319. binaryReader2.Close();
  320. Maid maidDest = GameMain.Instance.CharacterMgr.GetMaid(num7);
  321. if (maidDest != null && this.m_listTempMaid.Find((Maid m) => m == maidDest) != null)
  322. {
  323. GameMain.Instance.CharacterMgr.PresetSet(maidDest, f_prest);
  324. maidDest.AllProcPropSeqStart();
  325. }
  326. else
  327. {
  328. Debug.LogError("Presetコピー先メイドが居ないか、一時雇用メイドではありません。");
  329. }
  330. }
  331. }
  332. }
  333. }
  334. this.m_KuchipakuAudioStartTimeAtMaid = new float[this.m_listDummyAnimChara.Count<GameObject>()];
  335. for (int num9 = 0; num9 < this.m_KuchipakuAudioStartTimeAtMaid.Length; num9++)
  336. {
  337. this.m_KuchipakuAudioStartTimeAtMaid[num9] = 0f;
  338. }
  339. }
  340. private void Start()
  341. {
  342. if (GameMain.Instance.VRMode)
  343. {
  344. GameObject gameObject = GameObject.Find("effect");
  345. if (gameObject != null)
  346. {
  347. ParticleSystem[] componentsInChildren = gameObject.GetComponentsInChildren<ParticleSystem>(true);
  348. foreach (ParticleSystem particleSystem in componentsInChildren)
  349. {
  350. Renderer component = particleSystem.GetComponent<Renderer>();
  351. if (component != null)
  352. {
  353. component.shadowCastingMode = ShadowCastingMode.Off;
  354. component.receiveShadows = false;
  355. }
  356. }
  357. }
  358. }
  359. if (!DanceMain.KaraokeMode)
  360. {
  361. GameMain.Instance.BgMgr.DeleteBg();
  362. }
  363. GameMain.Instance.MainLight.Reset();
  364. GameMain.Instance.SoundMgr.StopBGM(0f);
  365. GameMain.Instance.MainCamera.gameObject.SetActive(true);
  366. if (!DanceMain.KaraokeMode)
  367. {
  368. GameMain.Instance.MainCamera.Reset(CameraMain.CameraType.Target, false);
  369. }
  370. for (int j = 0; j < this.m_listEventObject.Count; j++)
  371. {
  372. GameObject gameObject2 = this.m_listEventObject[j];
  373. NDebug.Assert(!this.m_htEventObj.ContainsKey(gameObject2.name), "listEventObjectに複数同じObjectを追加しようとしました。" + this.m_listEventObject[j].name);
  374. this.m_htEventObj.Add(gameObject2.name, gameObject2);
  375. }
  376. this.m_takeNow = this.m_AnimatorData.getTake(this.m_strPlayTakeName);
  377. NDebug.Assert(this.m_takeNow != null, "再生するテイク名PlayTakeNameが不正です。" + this.m_strPlayTakeName);
  378. }
  379. public void SetFace(int f_nMaidNo, string f_strFace)
  380. {
  381. RhythmAction_Mgr.Instance.SetTimeLineFace(f_nMaidNo, f_strFace);
  382. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(f_nMaidNo);
  383. if (RhythmAction_Mgr.Instance.GetMaidFaceStop(f_nMaidNo))
  384. {
  385. return;
  386. }
  387. maid.FaceAnime(f_strFace, 1f, 0);
  388. }
  389. public void SetFaceBlend(int f_nMaidNo, string f_strFace)
  390. {
  391. RhythmAction_Mgr.Instance.SetTimeLineFaceBlend(f_nMaidNo, f_strFace);
  392. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(f_nMaidNo);
  393. if (RhythmAction_Mgr.Instance.GetMaidFaceBlendStop(f_nMaidNo))
  394. {
  395. return;
  396. }
  397. maid.FaceBlend(f_strFace);
  398. }
  399. public void SetMaidVisible(int f_nMaidNo, bool visible)
  400. {
  401. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(f_nMaidNo);
  402. maid.transform.localScale = ((!visible) ? Vector3.zero : Vector3.one);
  403. }
  404. public void SwitchObject(string f_strObjName, bool bEnable)
  405. {
  406. (this.m_htEventObj[f_strObjName] as GameObject).SetActive(bEnable);
  407. }
  408. public void EyeToCam(int f_nMaidNo, string f_strType)
  409. {
  410. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(f_nMaidNo);
  411. try
  412. {
  413. maid.EyeToCamera((Maid.EyeMoveType)Enum.Parse(typeof(Maid.EyeMoveType), f_strType), 0f);
  414. }
  415. catch (Exception ex)
  416. {
  417. NDebug.Assert("EyeToCam 目線タイプ " + f_strType + " は不正です。\n" + ex.Message, false);
  418. }
  419. }
  420. public void FadeOut(float f_fTime)
  421. {
  422. GameMain.Instance.MainCamera.FadeOut(f_fTime, false, null, false, default(Color));
  423. }
  424. public void FadeIn(float f_fTime)
  425. {
  426. GameMain.Instance.MainCamera.FadeIn(f_fTime, false, null, false, true, default(Color));
  427. }
  428. public void ChangeAnimation(int maidNo, string animName, float fadeTime)
  429. {
  430. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(maidNo);
  431. try
  432. {
  433. maid.CrossFade(animName + ".anm", false, false, false, fadeTime, 1f);
  434. }
  435. catch (Exception ex)
  436. {
  437. NDebug.Assert(string.Concat(new object[]
  438. {
  439. "ChangeAnimation メイド ",
  440. maidNo,
  441. " : ",
  442. animName,
  443. " は不正です。\n",
  444. ex.Message
  445. }), false);
  446. }
  447. }
  448. public void ChangeKuchipaku(int maidNo, string kuchipakuName)
  449. {
  450. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(maidNo);
  451. maid.StartKuchipakuPattern((!(this.m_audioNew != null)) ? 0f : (this.m_audioNew.time * -1f), this.m_KuchiPatternCache[kuchipakuName], true);
  452. }
  453. public void SetActiveObj(GameObject targetObj, bool visible)
  454. {
  455. targetObj.SetActive(visible);
  456. }
  457. public void SetEyeTarget(int maidNo, GameObject targetObj)
  458. {
  459. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(maidNo);
  460. maid.EyeToTargetObject(targetObj.transform, 0f);
  461. }
  462. private void ChangeObj(AMTake f_take, string f_strOldObjName, GameObject f_goNew)
  463. {
  464. AMTranslationTrack[] array = f_take.findTranslationTrack(f_strOldObjName);
  465. for (int i = 0; i < array.Length; i++)
  466. {
  467. array[i].changeObject(f_goNew.transform);
  468. }
  469. AMRotationTrack[] array2 = f_take.findRotationTrack(f_strOldObjName);
  470. for (int j = 0; j < array2.Length; j++)
  471. {
  472. array2[j].changeObject(f_goNew.transform);
  473. }
  474. AMPropertyTrack[] array3 = f_take.findPropertyTrack(f_strOldObjName);
  475. for (int k = 0; k < array3.Length; k++)
  476. {
  477. array3[k].changeObject(f_goNew);
  478. }
  479. }
  480. public void OnDestroy()
  481. {
  482. this.Uninit();
  483. NUty.GCFree();
  484. Debug.Log("DanceMain::OnDestroy");
  485. }
  486. private void Uninit()
  487. {
  488. if (this.m_bFinished)
  489. {
  490. return;
  491. }
  492. if (RhythmAction_Mgr.Instance && DanceMain.KaraokeMode)
  493. {
  494. RhythmAction_Mgr.Instance.KaraokeEnd();
  495. }
  496. Debug.Log("DanceMain::Uninit");
  497. this.m_AnimatorData.StopLoop();
  498. if (GameMain.Instance.MainLight != null)
  499. {
  500. GameMain.Instance.MainLight.Reset();
  501. }
  502. if (GameMain.Instance.MainCamera != null)
  503. {
  504. GameMain.Instance.MainCamera.Reset(CameraMain.CameraType.Target, true);
  505. GameMain.Instance.MainCamera.FadeOut(0f, false, null, true, default(Color));
  506. }
  507. if (GameMain.Instance.SoundMgr != null)
  508. {
  509. GameMain.Instance.SoundMgr.StopBGM(0f);
  510. }
  511. if (GameMain.Instance.CharacterMgr != null)
  512. {
  513. GameMain.Instance.CharacterMgr.ResetCharaPosAll();
  514. }
  515. for (int i = 0; i < this.m_listMaid.Count; i++)
  516. {
  517. if (this.m_listMaid[i] != null)
  518. {
  519. this.m_listMaid[i].transform.localScale = Vector3.one;
  520. this.m_listMaid[i].StopKuchipakuPattern();
  521. this.m_listMaid[i].EyeToCamera(Maid.EyeMoveType.目と顔を向ける, 0f);
  522. this.m_listMaid[i].AllIKDetach(0f);
  523. this.m_listMaid[i].body0.IKCtrl.SetPelvisPull(false);
  524. this.m_listMaid[i].SetAutoTwist(Maid.AutoTwist.WristL, true);
  525. this.m_listMaid[i].SetAutoTwist(Maid.AutoTwist.WristR, true);
  526. Transform[] componentsInChildren = this.m_listMaid[i].gameObject.GetComponentsInChildren<Transform>(true);
  527. foreach (Transform transform in componentsInChildren)
  528. {
  529. transform.gameObject.layer = LayerMask.NameToLayer("Charactor");
  530. }
  531. }
  532. }
  533. for (int k = 0; k < this.m_listItemObject.Count; k++)
  534. {
  535. if (this.m_listItemObject[k] != null)
  536. {
  537. UnityEngine.Object.DestroyImmediate(this.m_listItemObject[k]);
  538. }
  539. }
  540. this.m_listItemObject.Clear();
  541. for (int l = 0; l < this.m_listTempMaid.Count; l++)
  542. {
  543. GameMain.Instance.CharacterMgr.BanishmentMaid(this.m_listTempMaid[l]);
  544. }
  545. if (!DanceMain.KaraokeMode)
  546. {
  547. if (this.DanceMaid.Any((Maid maid) => maid != null))
  548. {
  549. GameMain.Instance.CharacterMgr.DeactivateCharaAll();
  550. }
  551. if (this.m_maidUser != null && this.m_maidUser != GameMain.Instance.CharacterMgr.GetMaid(0))
  552. {
  553. GameMain.Instance.CharacterMgr.DeactivateMaid(0);
  554. GameMain.Instance.CharacterMgr.SetActiveMaid(this.m_maidUser, 0);
  555. }
  556. }
  557. this.m_eMode = DanceMain.Mode.Finish;
  558. this.m_bFinished = true;
  559. }
  560. private void ToFinish()
  561. {
  562. this.IsDanceEnd = !this.IsForceDanceEnd;
  563. RhythmAction_Mgr.Instance.RhythmGame_End();
  564. this.Uninit();
  565. if (!DanceMain.IsDanceRecet)
  566. {
  567. DanceSelect.SetNextDance();
  568. }
  569. else
  570. {
  571. NDebug.Assert(!string.IsNullOrEmpty(DanceMain.RecetJumpLabel), "やりなおし時に飛ぶラベルが設定されてません");
  572. }
  573. Debug.Log("Dance ToFinish Script");
  574. if (!string.IsNullOrEmpty(this.m_strScriptLabel))
  575. {
  576. if (DanceMain.IsDanceRecet)
  577. {
  578. Debug.Log("OnEndScene JumpTo " + DanceMain.RecetJumpLabel);
  579. GameMain.Instance.ScriptMgr.adv_kag.JumpLabel(DanceMain.RecetJumpLabel);
  580. }
  581. else
  582. {
  583. if (DanceMain.SelectDanceData != null)
  584. {
  585. GameMain.Instance.ScriptMgr.EvalScript("tf['dance_scene_name'] = '" + DanceMain.SelectDanceData.scene_name + "';");
  586. }
  587. Debug.Log("OnEndScene JumpTo " + this.m_strScriptLabel);
  588. GameMain.Instance.ScriptMgr.adv_kag.JumpLabel(this.m_strScriptLabel);
  589. }
  590. GameMain.Instance.ScriptMgr.adv_kag.Exec();
  591. }
  592. Debug.Log("Dance Finish!!");
  593. }
  594. private IEnumerator LoadMotionScript()
  595. {
  596. if (this.m_AdjustScript.IndexOf(".ks") < 0)
  597. {
  598. this.m_AdjustScript += ".ks";
  599. }
  600. NDebug.Assert(!string.IsNullOrEmpty(this.m_ScriptLabel), string.Format("{0}の飛び先が未指定です。", this.m_AdjustScript));
  601. if (this.m_ScriptLabel.IndexOf("*") < 0)
  602. {
  603. this.m_ScriptLabel = "*" + this.m_ScriptLabel;
  604. }
  605. ScriptManager script_mgr = GameMain.Instance.ScriptMgr;
  606. script_mgr.StopMotionScript();
  607. script_mgr.is_motion_blend = true;
  608. script_mgr.LoadMotionScript(0, false, this.m_AdjustScript, this.m_ScriptLabel, string.Empty, string.Empty, false, true, false);
  609. float timer = 0f;
  610. while (timer <= this.m_LoadScriptTime)
  611. {
  612. timer += Time.deltaTime;
  613. yield return null;
  614. }
  615. script_mgr.StopMotionScript();
  616. this.m_eMode = DanceMain.Mode.LoadAnim;
  617. yield break;
  618. }
  619. private void Update()
  620. {
  621. if (this.m_eMode == DanceMain.Mode.ActiveCam)
  622. {
  623. if (GameMain.Instance.MainCamera.gameObject.activeSelf)
  624. {
  625. GameMain.Instance.MainCamera.FadeOut(0f, false, null, true, default(Color));
  626. GameMain.Instance.MainCamera.SetCameraType(CameraMain.CameraType.Free);
  627. GameMain.Instance.MainCamera.SetControl(false);
  628. if (this.m_camDummyCamera != null)
  629. {
  630. if (!GameMain.Instance.VRMode)
  631. {
  632. AMTranslationTrack amtranslationTrack = this.m_takeNow.findTranslationTrack(this.m_camDummyCamera.gameObject.transform);
  633. amtranslationTrack.obj = GameMain.Instance.MainCamera.gameObject.transform;
  634. foreach (AMAction amaction in amtranslationTrack.cache)
  635. {
  636. AMTranslationAction amtranslationAction = (AMTranslationAction)amaction;
  637. amtranslationAction.obj = GameMain.Instance.MainCamera.gameObject.transform;
  638. }
  639. AMRotationTrack amrotationTrack = this.m_takeNow.findRotationTrack(this.m_camDummyCamera.gameObject.transform);
  640. amrotationTrack.obj = GameMain.Instance.MainCamera.gameObject.transform;
  641. foreach (AMAction amaction2 in amrotationTrack.cache)
  642. {
  643. AMRotationAction amrotationAction = (AMRotationAction)amaction2;
  644. amrotationAction.obj = GameMain.Instance.MainCamera.gameObject.transform;
  645. }
  646. }
  647. else if (GameMain.Instance.CMSystem.GetTmpGenericFlag("ダンスOVRカメラタイプ") != 0)
  648. {
  649. AMTranslationTrack amtranslationTrack2 = this.m_takeNow.findTranslationTrack(this.m_camDummyCamera.gameObject.transform);
  650. amtranslationTrack2.obj = this.m_trOvrDummyCam;
  651. foreach (AMAction amaction3 in amtranslationTrack2.cache)
  652. {
  653. AMTranslationAction amtranslationAction2 = (AMTranslationAction)amaction3;
  654. amtranslationAction2.obj = this.m_trOvrDummyCam;
  655. }
  656. AMRotationTrack amrotationTrack2 = this.m_takeNow.findRotationTrack(this.m_camDummyCamera.gameObject.transform);
  657. amrotationTrack2.obj = this.m_trOvrDummyCam;
  658. foreach (AMAction amaction4 in amrotationTrack2.cache)
  659. {
  660. AMRotationAction amrotationAction2 = (AMRotationAction)amaction4;
  661. amrotationAction2.obj = this.m_trOvrDummyCam;
  662. }
  663. }
  664. this.m_camDummyCamera.gameObject.SetActive(false);
  665. }
  666. if (!GameMain.Instance.VRMode)
  667. {
  668. this.ChangeObj(this.m_takeNow, "CameraMain", GameMain.Instance.MainCamera.gameObject);
  669. }
  670. else if (GameMain.Instance.CMSystem.GetTmpGenericFlag("ダンスOVRカメラタイプ") == 0)
  671. {
  672. if (!DanceMain.KaraokeMode)
  673. {
  674. GameMain.Instance.MainCamera.SetTargetPos(new Vector3(0f, 1.16f, 0f), true);
  675. GameMain.Instance.MainCamera.SetAroundAngle(new Vector2(180f, 0f), true);
  676. GameMain.Instance.MainCamera.SetDistance(5f, true);
  677. }
  678. }
  679. else
  680. {
  681. GameObject y = GameObject.Find("__GameMain__/Camera/CameraMain/CameraMain");
  682. AMBinaryDataBaseObject[] binary_data_list = this.time_line_binary_.binary_data_list;
  683. if (binary_data_list != null)
  684. {
  685. for (int i = 0; i < binary_data_list.Length; i++)
  686. {
  687. if (binary_data_list[i].obj == y)
  688. {
  689. binary_data_list[i].SetGameObject(this.m_trOvrDummyCam.gameObject);
  690. }
  691. }
  692. }
  693. }
  694. this.ChangeObj(this.m_takeNow, "MainDirectionalLight", GameMain.Instance.MainLight.gameObject);
  695. if (DanceMain.SelectDanceData == null || string.IsNullOrEmpty(DanceMain.SelectDanceData.bgm_file_name))
  696. {
  697. GameMain.Instance.SoundMgr.PlayDanceBGM(this.m_strMasterAudioFileName, 0f, true);
  698. }
  699. else
  700. {
  701. GameMain.Instance.SoundMgr.PlayDanceBGM(DanceMain.SelectDanceData.bgm_file_name + ".ogg", 0f, true);
  702. }
  703. AudioSource audioSourceBgm = GameMain.Instance.SoundMgr.GetAudioSourceBgm();
  704. audioSourceBgm.Stop();
  705. AMAudioTrack[] array = this.m_takeNow.findAudioTrack(this.m_strDummyAudioObjectName);
  706. foreach (AMAudioTrack amaudioTrack in array)
  707. {
  708. amaudioTrack.ChangeAudioSource(audioSourceBgm);
  709. }
  710. this.m_audioNew = audioSourceBgm;
  711. if (!this.m_boDebugDummyBody)
  712. {
  713. for (int k = 0; k < this.m_listAnimName.Count; k++)
  714. {
  715. this.m_listMaid.Add(GameMain.Instance.CharacterMgr.GetMaid(k));
  716. }
  717. for (int l = 0; l < this.m_listMaid.Count; l++)
  718. {
  719. this.m_listMaid[l].EyeToCamera(Maid.EyeMoveType.目だけ向ける, 0f);
  720. }
  721. NDebug.Assert(this.m_listKuchiPattern.Length == this.m_listMaid.Count, "メイド数と口パクパターン数が異なります。");
  722. for (int m = 0; m < this.m_listMaid.Count; m++)
  723. {
  724. if (!string.IsNullOrEmpty(this.m_listKuchiPattern[m]))
  725. {
  726. this.m_listMaid[m].StartKuchipakuPattern(0f, this.m_listKuchiPattern[m], true);
  727. }
  728. }
  729. }
  730. this.m_eMode = DanceMain.Mode.LoadChara;
  731. }
  732. }
  733. else if (this.m_eMode == DanceMain.Mode.LoadChara)
  734. {
  735. if (!GameMain.Instance.CharacterMgr.IsBusy() || this.m_listMaid.Count == 0)
  736. {
  737. if (!this.m_boDebugDummyBody)
  738. {
  739. int num = 1;
  740. for (;;)
  741. {
  742. string arg = "f";
  743. AMAnimationTrack amanimationTrack = this.m_takeNow.findAnimationTrack(arg + num);
  744. if (amanimationTrack == null)
  745. {
  746. break;
  747. }
  748. int num2 = num - 1;
  749. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(num2);
  750. IEnumerator enumerator5 = Enum.GetValues(typeof(Maid.AutoTwist)).GetEnumerator();
  751. try
  752. {
  753. while (enumerator5.MoveNext())
  754. {
  755. object obj = enumerator5.Current;
  756. maid.SetAutoTwist((Maid.AutoTwist)obj, true);
  757. }
  758. }
  759. finally
  760. {
  761. IDisposable disposable;
  762. if ((disposable = (enumerator5 as IDisposable)) != null)
  763. {
  764. disposable.Dispose();
  765. }
  766. }
  767. if (this.m_AutoTwistShoulderL != null && num2 < this.m_AutoTwistShoulderL.Length)
  768. {
  769. maid.SetAutoTwist(Maid.AutoTwist.ShoulderL, this.m_AutoTwistShoulderL[num2]);
  770. }
  771. if (this.m_AutoTwistShoulderR != null && num2 < this.m_AutoTwistShoulderR.Length)
  772. {
  773. maid.SetAutoTwist(Maid.AutoTwist.ShoulderR, this.m_AutoTwistShoulderR[num2]);
  774. }
  775. if (this.m_AutoTwistWristL != null && num2 < this.m_AutoTwistWristL.Length)
  776. {
  777. maid.SetAutoTwist(Maid.AutoTwist.WristL, this.m_AutoTwistWristL[num2]);
  778. }
  779. if (this.m_AutoTwistWristR != null && num2 < this.m_AutoTwistWristR.Length)
  780. {
  781. maid.SetAutoTwist(Maid.AutoTwist.WristR, this.m_AutoTwistWristR[num2]);
  782. }
  783. if (this.m_AutoTwistThighL != null && num2 < this.m_AutoTwistThighL.Length)
  784. {
  785. maid.SetAutoTwist(Maid.AutoTwist.ThighL, this.m_AutoTwistThighL[num2]);
  786. }
  787. if (this.m_AutoTwistThighR != null && num2 < this.m_AutoTwistThighR.Length)
  788. {
  789. maid.SetAutoTwist(Maid.AutoTwist.ThighR, this.m_AutoTwistThighR[num2]);
  790. }
  791. if (!string.IsNullOrEmpty(this.m_listAnimName[num2]))
  792. {
  793. string name = maid.CrossFade(this.m_listAnimName[num2] + ".anm", false, false, false, 0f, 1f);
  794. Animation component = maid.body0.m_Bones.GetComponent<Animation>();
  795. component.Stop();
  796. amanimationTrack.obj = maid.body0.m_Bones;
  797. foreach (AMAction amaction5 in amanimationTrack.cache)
  798. {
  799. AMAnimationAction amanimationAction = (AMAnimationAction)amaction5;
  800. amanimationAction.amClip = component.GetClip(name);
  801. amanimationAction.obj = maid.body0.m_Bones;
  802. }
  803. }
  804. else
  805. {
  806. this.m_focePauseAnim.Add(new DanceMain.AnimTime
  807. {
  808. anim = maid.body0.m_Bones.GetComponent<Animation>()
  809. });
  810. }
  811. if (this.UseFloorHitY)
  812. {
  813. maid.body0.SetBoneHitHeightY(this.m_fFloorY);
  814. }
  815. num++;
  816. }
  817. for (int n = 0; n < this.m_listDummyAnimChara.Count; n++)
  818. {
  819. Maid maid2 = GameMain.Instance.CharacterMgr.GetMaid(n);
  820. for (int num3 = 0; num3 < this.m_listItemObject.Count; num3++)
  821. {
  822. Transform transform = CMT.SearchObjObj(this.m_listDummyAnimChara[n].transform, this.m_listItemObject[num3].transform);
  823. if (transform != null)
  824. {
  825. Transform transform2 = transform;
  826. string name2 = transform2.parent.name;
  827. Transform parent = CMT.SearchObjName(maid2.gameObject.transform, name2, true);
  828. transform2.SetParent(parent, false);
  829. }
  830. }
  831. }
  832. if (this.m_MoveToDummyCharaPos != null)
  833. {
  834. NDebug.Assert(this.m_MoveToDummyCharaPos.Length <= this.m_listDummyAnimChara.Count<GameObject>(), "MoveToDummyCharaPos は listDummyAnimChara の数以下である必要があります。");
  835. for (int num4 = 0; num4 < this.m_MoveToDummyCharaPos.Length; num4++)
  836. {
  837. if (this.m_MoveToDummyCharaPos[num4])
  838. {
  839. Vector3 position = this.m_listDummyAnimChara[num4].transform.position;
  840. Maid maid3 = GameMain.Instance.CharacterMgr.GetMaid(num4);
  841. if (maid3 != null)
  842. {
  843. maid3.SetPos(position);
  844. }
  845. }
  846. }
  847. }
  848. if (this.m_LayerChangeToDummyChara != null)
  849. {
  850. NDebug.Assert(this.m_LayerChangeToDummyChara.Length <= this.m_listDummyAnimChara.Count<GameObject>(), "LayerChangeToDummyChara は listDummyAnimChara の数以下である必要があります。");
  851. for (int num5 = 0; num5 < this.m_LayerChangeToDummyChara.Length; num5++)
  852. {
  853. if (this.m_LayerChangeToDummyChara[num5])
  854. {
  855. int layer = this.m_listDummyAnimChara[num5].layer;
  856. Maid maid4 = GameMain.Instance.CharacterMgr.GetMaid(num5);
  857. if (maid4 != null)
  858. {
  859. Transform[] componentsInChildren = maid4.gameObject.GetComponentsInChildren<Transform>(true);
  860. foreach (Transform transform3 in componentsInChildren)
  861. {
  862. transform3.gameObject.layer = layer;
  863. }
  864. }
  865. }
  866. }
  867. }
  868. if (this.m_EyeTarget != null)
  869. {
  870. NDebug.Assert(this.m_EyeTarget.Length <= this.m_listDummyAnimChara.Count<GameObject>(), "EyeTarget は listDummyAnimChara の数以下である必要があります。");
  871. for (int num7 = 0; num7 < this.m_EyeTarget.Length; num7++)
  872. {
  873. if (this.m_EyeTarget[num7] != null)
  874. {
  875. Maid maid5 = GameMain.Instance.CharacterMgr.GetMaid(num7);
  876. if (maid5 != null)
  877. {
  878. maid5.EyeToCamera(Maid.EyeMoveType.目だけ向ける, 0f);
  879. maid5.body0.trsLookTarget = this.m_EyeTarget[num7].transform;
  880. }
  881. }
  882. }
  883. }
  884. if (this.m_MotionCacheEnable != null)
  885. {
  886. NDebug.Assert(this.m_MotionCacheEnable.Length <= this.m_listDummyAnimChara.Count<GameObject>(), "MotionCacheEnable は listDummyAnimChara の数以下である必要があります。");
  887. for (int num8 = 0; num8 < this.m_MotionCacheEnable.Length; num8++)
  888. {
  889. if (this.m_MotionCacheEnable[num8])
  890. {
  891. Maid maid6 = GameMain.Instance.CharacterMgr.GetMaid(num8);
  892. if (maid6 != null)
  893. {
  894. for (int num9 = 0; num9 < this.m_MotionCacheFileName.Length; num9++)
  895. {
  896. maid6.CacheAnime(this.m_MotionCacheFileName[num9], false, false);
  897. }
  898. }
  899. }
  900. }
  901. }
  902. for (int num10 = 0; num10 < this.m_listDebugObj.Count; num10++)
  903. {
  904. UnityEngine.Object.DestroyImmediate(this.m_listDebugObj[num10]);
  905. }
  906. this.m_listDebugObj.Clear();
  907. }
  908. if (string.IsNullOrEmpty(this.m_AdjustScript))
  909. {
  910. this.m_eMode = DanceMain.Mode.LoadAnim;
  911. }
  912. else
  913. {
  914. base.StartCoroutine(this.LoadMotionScript());
  915. this.m_eMode = DanceMain.Mode.LoadScript;
  916. }
  917. }
  918. }
  919. else if (this.m_eMode == DanceMain.Mode.LoadAnim)
  920. {
  921. this.m_AnimatorData.Play(this.m_takeNow.name, true, 0f, false, this.time_line_binary_.GetTrackIDList());
  922. this.m_fTakeStartRealTime = Time.realtimeSinceStartup;
  923. this.m_fNowRealTime = this.m_fTakeStartRealTime;
  924. this.m_eMode = DanceMain.Mode.Exec;
  925. }
  926. else if (this.m_eMode == DanceMain.Mode.Exec)
  927. {
  928. bool isPause = RhythmAction_Mgr.Instance.IsPause;
  929. if (!isPause)
  930. {
  931. float num11 = RhythmAction_Mgr.Instance.DanceDeltaTime;
  932. if (this.m_audioNew != null && this.m_audioNew.isPlaying)
  933. {
  934. float time = this.m_audioNew.time;
  935. for (int num12 = 0; num12 < this.m_listMaid.Count; num12++)
  936. {
  937. this.m_listMaid[num12].FoceKuchipakuUpdate(time);
  938. }
  939. if (this.m_bAudioFirst)
  940. {
  941. float num13 = time;
  942. num11 = Time.realtimeSinceStartup - this.m_fTakeStartRealTime;
  943. this.m_bAudioFirst = false;
  944. this.m_fOffsetTime = num13 - num11;
  945. RhythmAction_Mgr.Instance.RhythmGame_Start();
  946. }
  947. }
  948. this.m_fNowRealTime += num11;
  949. }
  950. if (isPause != this.m_pauseBack)
  951. {
  952. foreach (DanceMain.AnimTime animTime in this.m_focePauseAnim)
  953. {
  954. if (isPause)
  955. {
  956. IEnumerator enumerator8 = animTime.anim.GetEnumerator();
  957. try
  958. {
  959. while (enumerator8.MoveNext())
  960. {
  961. object obj2 = enumerator8.Current;
  962. AnimationState animationState = (AnimationState)obj2;
  963. animTime.stateTimeList.Add(new DanceMain.AnimTime.StateTime
  964. {
  965. state = animationState,
  966. time = animationState.time
  967. });
  968. animationState.speed = 0f;
  969. }
  970. }
  971. finally
  972. {
  973. IDisposable disposable2;
  974. if ((disposable2 = (enumerator8 as IDisposable)) != null)
  975. {
  976. disposable2.Dispose();
  977. }
  978. }
  979. }
  980. else
  981. {
  982. foreach (DanceMain.AnimTime.StateTime stateTime in animTime.stateTimeList)
  983. {
  984. stateTime.state.time = stateTime.time;
  985. stateTime.state.speed = 1f;
  986. }
  987. animTime.stateTimeList.Clear();
  988. }
  989. }
  990. this.m_pauseBack = isPause;
  991. }
  992. if (this.IsForceDanceEnd || this.m_AnimatorData.takeName == null || this.IsDanceSkip || (DanceMain.KaraokeMode && Input.GetKeyDown(KeyCode.Return)))
  993. {
  994. this.ToFinish();
  995. }
  996. }
  997. else if (this.m_eMode == DanceMain.Mode.Finish)
  998. {
  999. }
  1000. if (this.m_AnimatorData.takeName != null)
  1001. {
  1002. NTime.UpdateNowTime(this.m_fNowRealTime - this.m_fTakeStartRealTime + this.m_fOffsetTime);
  1003. this.time_line_binary_.Update(NTime.time);
  1004. }
  1005. if (GameMain.Instance.VRMode && this.m_trOvrDummyCam != null && this.m_OvrCam != null)
  1006. {
  1007. this.m_OvrCam.SetPos(this.m_trOvrDummyCam.position);
  1008. this.m_OvrCam.SetRotation(this.m_trOvrDummyCam.rotation.eulerAngles);
  1009. }
  1010. }
  1011. private const string m_RhythmMgr_Path = "SceneDance/Rhythm_Action/Prefab/RhythmAction_Mgr";
  1012. public static bool IsDanceRecet;
  1013. public static DanceData SelectDanceData;
  1014. public static bool KaraokeMode;
  1015. private DanceMain.Mode m_eMode;
  1016. public bool m_boDebugDummyBody;
  1017. public Camera m_camDummyCamera;
  1018. public List<GameObject> m_listDebugObj;
  1019. public AnimatorData m_AnimatorData;
  1020. public List<GameObject> m_listDummyAnimChara;
  1021. public List<string> m_listAnimName;
  1022. public List<GameObject> m_listEventObject;
  1023. private Hashtable m_htEventObj = new Hashtable();
  1024. public List<string> m_listTestPreset;
  1025. public List<GameObject> m_listItemObject = new List<GameObject>();
  1026. public List<string> m_listKuchiPakuFile = new List<string>();
  1027. private string[] m_listKuchiPattern;
  1028. private List<Maid> m_listMaid = new List<Maid>();
  1029. public string m_strDummyAudioObjectName;
  1030. private AudioSource m_audioNew;
  1031. public string m_strMasterAudioFileName;
  1032. public string m_strPlayTakeName = "Take1";
  1033. private AMTake m_takeNow;
  1034. private string m_strScriptLabel = string.Empty;
  1035. private List<Maid> m_listTempMaid = new List<Maid>();
  1036. private Maid m_maidUser;
  1037. [HideInInspector]
  1038. public bool IsForceDanceEnd;
  1039. [HideInInspector]
  1040. public bool IsDanceSkip;
  1041. private OvrCamera m_OvrCam;
  1042. private Transform m_trOvrDummyCam;
  1043. public bool UseBinaryData;
  1044. public string BinaryFolderName;
  1045. private DanceObjectDataBinary maid_data_binary_;
  1046. private DanceObjectDataBinary maid_item_binary_;
  1047. private DanceObjectDataBinary maid_event_binary_;
  1048. private AWReadBinaryData time_line_binary_;
  1049. [Header("物理境界を変更するか?")]
  1050. public bool UseFloorHitY;
  1051. public float m_fFloorY;
  1052. [SerializeField]
  1053. [Header("被写界深度の焦点")]
  1054. private float m_DepthFocalSize = 1.2f;
  1055. [SerializeField]
  1056. [Header("マイク位置調整等に使うモーションスクリプト名")]
  1057. private string m_AdjustScript = string.Empty;
  1058. [SerializeField]
  1059. private string m_ScriptLabel = string.Empty;
  1060. [SerializeField]
  1061. [Header("AdjustScript読み込みに要する時間")]
  1062. private float m_LoadScriptTime = 3f;
  1063. [SerializeField]
  1064. [Header("初期化時にダミーキャラの位置にメイドを移動させるメイド番号スイッチ")]
  1065. public bool[] m_MoveToDummyCharaPos;
  1066. [SerializeField]
  1067. [Header("初期化時にダミーキャラのLayerをメイドに設定させるメイド番号スイッチ")]
  1068. public bool[] m_LayerChangeToDummyChara;
  1069. public Light[] m_OffScreenLight;
  1070. [SerializeField]
  1071. [Header("初期化時にメイドの視線に設定するオブジェクト対メイド番号")]
  1072. public GameObject[] m_EyeTarget;
  1073. [SerializeField]
  1074. [Header("特定メイド番号からダミーメイドへの容姿のコピー(Elementが先メイド番号/値が元メイド番号")]
  1075. public int[] m_PresetCopyToDummyChara;
  1076. [SerializeField]
  1077. [Header("途中でモーションを変えるメイド番号のファイル名リスト")]
  1078. public bool[] m_MotionCacheEnable;
  1079. [SerializeField]
  1080. [Header("途中でモーションを変える場合のファイル名リスト")]
  1081. public string[] m_MotionCacheFileName;
  1082. [SerializeField]
  1083. [Header("途中で口パクを変える場合のファイル名リスト")]
  1084. public string[] m_KuchipakuCacheFileName;
  1085. private Dictionary<string, string> m_KuchiPatternCache = new Dictionary<string, string>();
  1086. public float[] m_KuchipakuAudioStartTimeAtMaid;
  1087. [SerializeField]
  1088. [Header("自動捻りボーン(ShoulderL)(Elementがメイド番号)指定無しでON")]
  1089. public bool[] m_AutoTwistShoulderL;
  1090. [SerializeField]
  1091. [Header("自動捻りボーン(ShoulderR)(Elementがメイド番号)指定無しでON")]
  1092. public bool[] m_AutoTwistShoulderR;
  1093. [SerializeField]
  1094. [Header("自動捻りボーン(WristL)(Elementがメイド番号)指定無しでON")]
  1095. public bool[] m_AutoTwistWristL;
  1096. [SerializeField]
  1097. [Header("自動捻りボーン(WristR)(Elementがメイド番号)指定無しでON")]
  1098. public bool[] m_AutoTwistWristR;
  1099. [SerializeField]
  1100. [Header("自動捻りボーン(ThighL)(Elementがメイド番号)指定無しでON")]
  1101. public bool[] m_AutoTwistThighL;
  1102. [SerializeField]
  1103. [Header("自動捻りボーン(ThighR)(Elementがメイド番号)指定無しでON")]
  1104. public bool[] m_AutoTwistThighR;
  1105. private List<DanceMain.AnimTime> m_focePauseAnim = new List<DanceMain.AnimTime>();
  1106. private bool m_pauseBack;
  1107. private bool m_bFinished;
  1108. private float m_fNowRealTime;
  1109. private float m_fTakeStartRealTime;
  1110. private float m_fOffsetTime;
  1111. private bool m_bAudioFirst = true;
  1112. private enum Mode
  1113. {
  1114. ActiveCam,
  1115. LoadChara,
  1116. LoadAnim,
  1117. Exec,
  1118. Finish,
  1119. LoadScript
  1120. }
  1121. private class AnimTime
  1122. {
  1123. public Animation anim;
  1124. public List<DanceMain.AnimTime.StateTime> stateTimeList = new List<DanceMain.AnimTime.StateTime>();
  1125. public class StateTime
  1126. {
  1127. public AnimationState state;
  1128. public float time;
  1129. }
  1130. }
  1131. }