DanceMain.cs 36 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141
  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 textAsset = Resources.Load("SceneDance/" + fn) as TextAsset;
  137. NDebug.Assert(textAsset != null, "口パクパターンテキストファイルが開けません。" + fn);
  138. string text3 = textAsset.text;
  139. NDebug.Assert(text3.Length != 0, "口パクパターンファイル内が空です。" + fn);
  140. return Regex.Replace(text3, "(\\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)
  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_97D;
  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)
  236. {
  237. maid2 = GameMain.Instance.CharacterMgr.AddStockMaid();
  238. GameMain.Instance.CharacterMgr.SetActiveMaid(maid2, num4);
  239. CharacterMgr.Preset preset;
  240. if (DanceMain.SelectDanceData != null && num4 < DanceMain.SelectDanceData.preset_name.Count && !string.IsNullOrEmpty(DanceMain.SelectDanceData.preset_name[num4]))
  241. {
  242. preset = GameMain.Instance.CharacterMgr.PresetLoadFromResources(DanceMain.SelectDanceData.preset_name[num4]);
  243. }
  244. else
  245. {
  246. preset = GameMain.Instance.CharacterMgr.PresetLoadFromResources(this.m_listTestPreset[num4]);
  247. }
  248. if (preset != null)
  249. {
  250. GameMain.Instance.CharacterMgr.PresetSet(maid2, preset);
  251. }
  252. this.m_listTempMaid.Add(maid2);
  253. maid2.Visible = true;
  254. }
  255. }
  256. if (DanceMain.SelectDanceData != null)
  257. {
  258. for (int num5 = 0; num5 < DanceMain.SelectDanceData.maid_order.Count; num5++)
  259. {
  260. int index2 = DanceMain.SelectDanceData.maid_order[num5];
  261. if (!RhythmAction_Mgr.Instance.FactOrderList[index2])
  262. {
  263. RhythmAction_Mgr.Instance.FactOrderList[index2] = GameMain.Instance.CharacterMgr.GetMaid(num5);
  264. }
  265. }
  266. }
  267. IL_97D:
  268. if (this.m_PresetCopyToDummyChara != null)
  269. {
  270. NDebug.Assert(this.m_PresetCopyToDummyChara.Length <= this.m_listDummyAnimChara.Count<GameObject>(), "PresetCopyToDummyChara は listDummyAnimChara の数以下である必要があります。");
  271. for (int num6 = 0; num6 < this.m_PresetCopyToDummyChara.Length; num6++)
  272. {
  273. int num7 = this.m_PresetCopyToDummyChara[num6];
  274. if (num7 != num6)
  275. {
  276. Maid maid3 = GameMain.Instance.CharacterMgr.GetMaid(num7);
  277. if (maid3)
  278. {
  279. byte[] buffer = GameMain.Instance.CharacterMgr.PresetSaveNotWriteFile(maid3, CharacterMgr.PresetType.All);
  280. BinaryReader binaryReader = new BinaryReader(new MemoryStream(buffer));
  281. CharacterMgr.Preset f_prest = GameMain.Instance.CharacterMgr.PresetLoad(binaryReader, string.Empty);
  282. binaryReader.Close();
  283. Maid maidDest = GameMain.Instance.CharacterMgr.GetMaid(num6);
  284. if (maidDest != null && this.m_listTempMaid.Find((Maid m) => m == maidDest) != null)
  285. {
  286. GameMain.Instance.CharacterMgr.PresetSet(maidDest, f_prest);
  287. maidDest.AllProcPropSeqStart();
  288. }
  289. else
  290. {
  291. Debug.LogError("Presetコピー先メイドが居ないか、一時雇用メイドではありません。");
  292. }
  293. }
  294. }
  295. }
  296. }
  297. this.m_KuchipakuAudioStartTimeAtMaid = new float[this.m_listDummyAnimChara.Count<GameObject>()];
  298. for (int num8 = 0; num8 < this.m_KuchipakuAudioStartTimeAtMaid.Length; num8++)
  299. {
  300. this.m_KuchipakuAudioStartTimeAtMaid[num8] = 0f;
  301. }
  302. }
  303. private void Start()
  304. {
  305. if (GameMain.Instance.VRMode)
  306. {
  307. GameObject gameObject = GameObject.Find("effect");
  308. if (gameObject != null)
  309. {
  310. ParticleSystem[] componentsInChildren = gameObject.GetComponentsInChildren<ParticleSystem>(true);
  311. foreach (ParticleSystem particleSystem in componentsInChildren)
  312. {
  313. Renderer component = particleSystem.GetComponent<Renderer>();
  314. if (component != null)
  315. {
  316. component.shadowCastingMode = ShadowCastingMode.Off;
  317. component.receiveShadows = false;
  318. }
  319. }
  320. }
  321. }
  322. if (!DanceMain.KaraokeMode)
  323. {
  324. GameMain.Instance.BgMgr.DeleteBg();
  325. }
  326. GameMain.Instance.MainLight.Reset();
  327. GameMain.Instance.SoundMgr.StopBGM(0f);
  328. GameMain.Instance.MainCamera.gameObject.SetActive(true);
  329. if (!DanceMain.KaraokeMode)
  330. {
  331. GameMain.Instance.MainCamera.Reset(CameraMain.CameraType.Target, false);
  332. }
  333. for (int j = 0; j < this.m_listEventObject.Count; j++)
  334. {
  335. GameObject gameObject2 = this.m_listEventObject[j];
  336. NDebug.Assert(!this.m_htEventObj.ContainsKey(gameObject2.name), "listEventObjectに複数同じObjectを追加しようとしました。" + this.m_listEventObject[j].name);
  337. this.m_htEventObj.Add(gameObject2.name, gameObject2);
  338. }
  339. this.m_takeNow = this.m_AnimatorData.getTake(this.m_strPlayTakeName);
  340. NDebug.Assert(this.m_takeNow != null, "再生するテイク名PlayTakeNameが不正です。" + this.m_strPlayTakeName);
  341. }
  342. public void SetFace(int f_nMaidNo, string f_strFace)
  343. {
  344. RhythmAction_Mgr.Instance.SetTimeLineFace(f_nMaidNo, f_strFace);
  345. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(f_nMaidNo);
  346. if (RhythmAction_Mgr.Instance.GetMaidFaceStop(f_nMaidNo))
  347. {
  348. return;
  349. }
  350. maid.FaceAnime(f_strFace, 1f, 0);
  351. }
  352. public void SetFaceBlend(int f_nMaidNo, string f_strFace)
  353. {
  354. RhythmAction_Mgr.Instance.SetTimeLineFaceBlend(f_nMaidNo, f_strFace);
  355. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(f_nMaidNo);
  356. if (RhythmAction_Mgr.Instance.GetMaidFaceBlendStop(f_nMaidNo))
  357. {
  358. return;
  359. }
  360. maid.FaceBlend(f_strFace);
  361. }
  362. public void SetMaidVisible(int f_nMaidNo, bool visible)
  363. {
  364. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(f_nMaidNo);
  365. maid.transform.localScale = ((!visible) ? Vector3.zero : Vector3.one);
  366. }
  367. public void SwitchObject(string f_strObjName, bool bEnable)
  368. {
  369. (this.m_htEventObj[f_strObjName] as GameObject).SetActive(bEnable);
  370. }
  371. public void EyeToCam(int f_nMaidNo, string f_strType)
  372. {
  373. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(f_nMaidNo);
  374. try
  375. {
  376. maid.EyeToCamera((Maid.EyeMoveType)Enum.Parse(typeof(Maid.EyeMoveType), f_strType), 0f);
  377. }
  378. catch (Exception ex)
  379. {
  380. NDebug.Assert("EyeToCam 目線タイプ " + f_strType + " は不正です。\n" + ex.Message, false);
  381. }
  382. }
  383. public void FadeOut(float f_fTime)
  384. {
  385. GameMain.Instance.MainCamera.FadeOut(f_fTime, false, null, false, default(Color));
  386. }
  387. public void FadeIn(float f_fTime)
  388. {
  389. GameMain.Instance.MainCamera.FadeIn(f_fTime, false, null, false, true, default(Color));
  390. }
  391. public void ChangeAnimation(int maidNo, string animName, float fadeTime)
  392. {
  393. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(maidNo);
  394. try
  395. {
  396. maid.CrossFade(animName + ".anm", false, false, false, fadeTime, 1f);
  397. }
  398. catch (Exception ex)
  399. {
  400. NDebug.Assert(string.Concat(new object[]
  401. {
  402. "ChangeAnimation メイド ",
  403. maidNo,
  404. " : ",
  405. animName,
  406. " は不正です。\n",
  407. ex.Message
  408. }), false);
  409. }
  410. }
  411. public void ChangeKuchipaku(int maidNo, string kuchipakuName)
  412. {
  413. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(maidNo);
  414. maid.StartKuchipakuPattern((!(this.m_audioNew != null)) ? 0f : (this.m_audioNew.time * -1f), this.m_KuchiPatternCache[kuchipakuName], true);
  415. }
  416. public void SetActiveObj(GameObject targetObj, bool visible)
  417. {
  418. targetObj.SetActive(visible);
  419. }
  420. public void SetEyeTarget(int maidNo, GameObject targetObj)
  421. {
  422. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(maidNo);
  423. maid.EyeToTargetObject(targetObj.transform, 0f);
  424. }
  425. private void ChangeObj(AMTake f_take, string f_strOldObjName, GameObject f_goNew)
  426. {
  427. AMTranslationTrack[] array = f_take.findTranslationTrack(f_strOldObjName);
  428. for (int i = 0; i < array.Length; i++)
  429. {
  430. array[i].changeObject(f_goNew.transform);
  431. }
  432. AMRotationTrack[] array2 = f_take.findRotationTrack(f_strOldObjName);
  433. for (int j = 0; j < array2.Length; j++)
  434. {
  435. array2[j].changeObject(f_goNew.transform);
  436. }
  437. AMPropertyTrack[] array3 = f_take.findPropertyTrack(f_strOldObjName);
  438. for (int k = 0; k < array3.Length; k++)
  439. {
  440. array3[k].changeObject(f_goNew);
  441. }
  442. }
  443. public void OnDestroy()
  444. {
  445. this.Uninit();
  446. NUty.GCFree();
  447. Debug.Log("DanceMain::OnDestroy");
  448. }
  449. private void Uninit()
  450. {
  451. if (this.m_bFinished)
  452. {
  453. return;
  454. }
  455. if (RhythmAction_Mgr.Instance && DanceMain.KaraokeMode)
  456. {
  457. RhythmAction_Mgr.Instance.KaraokeEnd();
  458. }
  459. Debug.Log("DanceMain::Uninit");
  460. this.m_AnimatorData.StopLoop();
  461. if (GameMain.Instance.MainLight != null)
  462. {
  463. GameMain.Instance.MainLight.Reset();
  464. }
  465. if (GameMain.Instance.MainCamera != null)
  466. {
  467. GameMain.Instance.MainCamera.Reset(CameraMain.CameraType.Target, true);
  468. GameMain.Instance.MainCamera.FadeOut(0f, false, null, true, default(Color));
  469. }
  470. if (GameMain.Instance.SoundMgr != null)
  471. {
  472. GameMain.Instance.SoundMgr.StopBGM(0f);
  473. }
  474. if (GameMain.Instance.CharacterMgr != null)
  475. {
  476. GameMain.Instance.CharacterMgr.ResetCharaPosAll();
  477. }
  478. for (int i = 0; i < this.m_listMaid.Count; i++)
  479. {
  480. if (this.m_listMaid[i] != null)
  481. {
  482. this.m_listMaid[i].transform.localScale = Vector3.one;
  483. this.m_listMaid[i].StopKuchipakuPattern();
  484. this.m_listMaid[i].EyeToCamera(Maid.EyeMoveType.目と顔を向ける, 0f);
  485. this.m_listMaid[i].AllIKDetach(0f);
  486. this.m_listMaid[i].SetAutoTwist(Maid.AutoTwist.WristL, true);
  487. this.m_listMaid[i].SetAutoTwist(Maid.AutoTwist.WristR, true);
  488. Transform[] componentsInChildren = this.m_listMaid[i].gameObject.GetComponentsInChildren<Transform>(true);
  489. foreach (Transform transform in componentsInChildren)
  490. {
  491. transform.gameObject.layer = LayerMask.NameToLayer("Charactor");
  492. }
  493. }
  494. }
  495. for (int k = 0; k < this.m_listItemObject.Count; k++)
  496. {
  497. if (this.m_listItemObject[k] != null)
  498. {
  499. UnityEngine.Object.DestroyImmediate(this.m_listItemObject[k]);
  500. }
  501. }
  502. this.m_listItemObject.Clear();
  503. for (int l = 0; l < this.m_listTempMaid.Count; l++)
  504. {
  505. GameMain.Instance.CharacterMgr.BanishmentMaid(this.m_listTempMaid[l]);
  506. }
  507. if (!DanceMain.KaraokeMode)
  508. {
  509. if (this.DanceMaid.Any((Maid maid) => maid != null))
  510. {
  511. GameMain.Instance.CharacterMgr.DeactivateCharaAll();
  512. }
  513. if (this.m_maidUser != null && this.m_maidUser != GameMain.Instance.CharacterMgr.GetMaid(0))
  514. {
  515. GameMain.Instance.CharacterMgr.DeactivateMaid(0);
  516. GameMain.Instance.CharacterMgr.SetActiveMaid(this.m_maidUser, 0);
  517. }
  518. }
  519. this.m_eMode = DanceMain.Mode.Finish;
  520. this.m_bFinished = true;
  521. }
  522. private void ToFinish()
  523. {
  524. this.IsDanceEnd = !this.IsForceDanceEnd;
  525. RhythmAction_Mgr.Instance.RhythmGame_End();
  526. this.Uninit();
  527. if (!DanceMain.IsDanceRecet)
  528. {
  529. DanceSelect.SetNextDance();
  530. }
  531. else
  532. {
  533. NDebug.Assert(!string.IsNullOrEmpty(DanceMain.RecetJumpLabel), "やりなおし時に飛ぶラベルが設定されてません");
  534. }
  535. Debug.Log("Dance ToFinish Script");
  536. if (!string.IsNullOrEmpty(this.m_strScriptLabel))
  537. {
  538. if (DanceMain.IsDanceRecet)
  539. {
  540. Debug.Log("OnEndScene JumpTo " + DanceMain.RecetJumpLabel);
  541. GameMain.Instance.ScriptMgr.adv_kag.JumpLabel(DanceMain.RecetJumpLabel);
  542. }
  543. else
  544. {
  545. if (DanceMain.SelectDanceData != null)
  546. {
  547. GameMain.Instance.ScriptMgr.EvalScript("tf['dance_scene_name'] = '" + DanceMain.SelectDanceData.scene_name + "';");
  548. }
  549. Debug.Log("OnEndScene JumpTo " + this.m_strScriptLabel);
  550. GameMain.Instance.ScriptMgr.adv_kag.JumpLabel(this.m_strScriptLabel);
  551. }
  552. GameMain.Instance.ScriptMgr.adv_kag.Exec();
  553. }
  554. Debug.Log("Dance Finish!!");
  555. }
  556. private IEnumerator LoadMotionScript()
  557. {
  558. if (this.m_AdjustScript.IndexOf(".ks") < 0)
  559. {
  560. this.m_AdjustScript += ".ks";
  561. }
  562. NDebug.Assert(!string.IsNullOrEmpty(this.m_ScriptLabel), string.Format("{0}の飛び先が未指定です。", this.m_AdjustScript));
  563. if (this.m_ScriptLabel.IndexOf("*") < 0)
  564. {
  565. this.m_ScriptLabel = "*" + this.m_ScriptLabel;
  566. }
  567. ScriptManager script_mgr = GameMain.Instance.ScriptMgr;
  568. script_mgr.StopMotionScript();
  569. script_mgr.is_motion_blend = true;
  570. script_mgr.LoadMotionScript(0, false, this.m_AdjustScript, this.m_ScriptLabel, string.Empty, string.Empty, false, true, false);
  571. float timer = 0f;
  572. while (timer <= this.m_LoadScriptTime)
  573. {
  574. timer += Time.deltaTime;
  575. yield return null;
  576. }
  577. script_mgr.StopMotionScript();
  578. this.m_eMode = DanceMain.Mode.LoadAnim;
  579. yield break;
  580. }
  581. private void Update()
  582. {
  583. if (this.m_eMode == DanceMain.Mode.ActiveCam)
  584. {
  585. if (GameMain.Instance.MainCamera.gameObject.activeSelf)
  586. {
  587. GameMain.Instance.MainCamera.FadeOut(0f, false, null, true, default(Color));
  588. GameMain.Instance.MainCamera.SetCameraType(CameraMain.CameraType.Free);
  589. GameMain.Instance.MainCamera.SetControl(false);
  590. if (this.m_camDummyCamera != null)
  591. {
  592. if (!GameMain.Instance.VRMode)
  593. {
  594. AMTranslationTrack amtranslationTrack = this.m_takeNow.findTranslationTrack(this.m_camDummyCamera.gameObject.transform);
  595. amtranslationTrack.obj = GameMain.Instance.MainCamera.gameObject.transform;
  596. foreach (AMAction amaction in amtranslationTrack.cache)
  597. {
  598. AMTranslationAction amtranslationAction = (AMTranslationAction)amaction;
  599. amtranslationAction.obj = GameMain.Instance.MainCamera.gameObject.transform;
  600. }
  601. AMRotationTrack amrotationTrack = this.m_takeNow.findRotationTrack(this.m_camDummyCamera.gameObject.transform);
  602. amrotationTrack.obj = GameMain.Instance.MainCamera.gameObject.transform;
  603. foreach (AMAction amaction2 in amrotationTrack.cache)
  604. {
  605. AMRotationAction amrotationAction = (AMRotationAction)amaction2;
  606. amrotationAction.obj = GameMain.Instance.MainCamera.gameObject.transform;
  607. }
  608. }
  609. else if (GameMain.Instance.CMSystem.GetTmpGenericFlag("ダンスOVRカメラタイプ") != 0)
  610. {
  611. AMTranslationTrack amtranslationTrack2 = this.m_takeNow.findTranslationTrack(this.m_camDummyCamera.gameObject.transform);
  612. amtranslationTrack2.obj = this.m_trOvrDummyCam;
  613. foreach (AMAction amaction3 in amtranslationTrack2.cache)
  614. {
  615. AMTranslationAction amtranslationAction2 = (AMTranslationAction)amaction3;
  616. amtranslationAction2.obj = this.m_trOvrDummyCam;
  617. }
  618. AMRotationTrack amrotationTrack2 = this.m_takeNow.findRotationTrack(this.m_camDummyCamera.gameObject.transform);
  619. amrotationTrack2.obj = this.m_trOvrDummyCam;
  620. foreach (AMAction amaction4 in amrotationTrack2.cache)
  621. {
  622. AMRotationAction amrotationAction2 = (AMRotationAction)amaction4;
  623. amrotationAction2.obj = this.m_trOvrDummyCam;
  624. }
  625. }
  626. this.m_camDummyCamera.gameObject.SetActive(false);
  627. }
  628. if (!GameMain.Instance.VRMode)
  629. {
  630. this.ChangeObj(this.m_takeNow, "CameraMain", GameMain.Instance.MainCamera.gameObject);
  631. }
  632. else if (GameMain.Instance.CMSystem.GetTmpGenericFlag("ダンスOVRカメラタイプ") == 0)
  633. {
  634. if (!DanceMain.KaraokeMode)
  635. {
  636. GameMain.Instance.MainCamera.SetTargetPos(new Vector3(0f, 1.16f, 0f), true);
  637. GameMain.Instance.MainCamera.SetAroundAngle(new Vector2(180f, 0f), true);
  638. GameMain.Instance.MainCamera.SetDistance(5f, true);
  639. }
  640. }
  641. else
  642. {
  643. GameObject y = GameObject.Find("__GameMain__/Camera/CameraMain/CameraMain");
  644. AMBinaryDataBaseObject[] binary_data_list = this.time_line_binary_.binary_data_list;
  645. if (binary_data_list != null)
  646. {
  647. for (int i = 0; i < binary_data_list.Length; i++)
  648. {
  649. if (binary_data_list[i].obj == y)
  650. {
  651. binary_data_list[i].SetGameObject(this.m_trOvrDummyCam.gameObject);
  652. }
  653. }
  654. }
  655. }
  656. this.ChangeObj(this.m_takeNow, "MainDirectionalLight", GameMain.Instance.MainLight.gameObject);
  657. if (DanceMain.SelectDanceData == null || string.IsNullOrEmpty(DanceMain.SelectDanceData.bgm_file_name))
  658. {
  659. GameMain.Instance.SoundMgr.PlayDanceBGM(this.m_strMasterAudioFileName, 0f, true);
  660. }
  661. else
  662. {
  663. GameMain.Instance.SoundMgr.PlayDanceBGM(DanceMain.SelectDanceData.bgm_file_name + ".ogg", 0f, true);
  664. }
  665. AudioSource audioSourceBgm = GameMain.Instance.SoundMgr.GetAudioSourceBgm();
  666. audioSourceBgm.Stop();
  667. AMAudioTrack[] array = this.m_takeNow.findAudioTrack(this.m_strDummyAudioObjectName);
  668. foreach (AMAudioTrack amaudioTrack in array)
  669. {
  670. amaudioTrack.ChangeAudioSource(audioSourceBgm);
  671. }
  672. this.m_audioNew = audioSourceBgm;
  673. if (!this.m_boDebugDummyBody)
  674. {
  675. for (int k = 0; k < this.m_listAnimName.Count; k++)
  676. {
  677. this.m_listMaid.Add(GameMain.Instance.CharacterMgr.GetMaid(k));
  678. }
  679. for (int l = 0; l < this.m_listMaid.Count; l++)
  680. {
  681. this.m_listMaid[l].EyeToCamera(Maid.EyeMoveType.目だけ向ける, 0f);
  682. }
  683. NDebug.Assert(this.m_listKuchiPattern.Length == this.m_listMaid.Count, "メイド数と口パクパターン数が異なります。");
  684. for (int m = 0; m < this.m_listMaid.Count; m++)
  685. {
  686. if (!string.IsNullOrEmpty(this.m_listKuchiPattern[m]))
  687. {
  688. this.m_listMaid[m].StartKuchipakuPattern(0f, this.m_listKuchiPattern[m], true);
  689. }
  690. }
  691. }
  692. this.m_eMode = DanceMain.Mode.LoadChara;
  693. }
  694. }
  695. else if (this.m_eMode == DanceMain.Mode.LoadChara)
  696. {
  697. if (!GameMain.Instance.CharacterMgr.IsBusy() || this.m_listMaid.Count == 0)
  698. {
  699. if (!this.m_boDebugDummyBody)
  700. {
  701. int num = 1;
  702. for (;;)
  703. {
  704. string arg = "f";
  705. AMAnimationTrack amanimationTrack = this.m_takeNow.findAnimationTrack(arg + num);
  706. if (amanimationTrack == null)
  707. {
  708. break;
  709. }
  710. int num2 = num - 1;
  711. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(num2);
  712. IEnumerator enumerator5 = Enum.GetValues(typeof(Maid.AutoTwist)).GetEnumerator();
  713. try
  714. {
  715. while (enumerator5.MoveNext())
  716. {
  717. object obj = enumerator5.Current;
  718. maid.SetAutoTwist((Maid.AutoTwist)obj, true);
  719. }
  720. }
  721. finally
  722. {
  723. IDisposable disposable;
  724. if ((disposable = (enumerator5 as IDisposable)) != null)
  725. {
  726. disposable.Dispose();
  727. }
  728. }
  729. if (!string.IsNullOrEmpty(this.m_listAnimName[num2]))
  730. {
  731. string name = maid.CrossFade(this.m_listAnimName[num2] + ".anm", false, false, false, 0f, 1f);
  732. Animation component = maid.body0.m_Bones.GetComponent<Animation>();
  733. component.Stop();
  734. amanimationTrack.obj = maid.body0.m_Bones;
  735. foreach (AMAction amaction5 in amanimationTrack.cache)
  736. {
  737. AMAnimationAction amanimationAction = (AMAnimationAction)amaction5;
  738. amanimationAction.amClip = component.GetClip(name);
  739. amanimationAction.obj = maid.body0.m_Bones;
  740. }
  741. }
  742. else
  743. {
  744. this.m_focePauseAnim.Add(new DanceMain.AnimTime
  745. {
  746. anim = maid.body0.m_Bones.GetComponent<Animation>()
  747. });
  748. }
  749. if (this.UseFloorHitY)
  750. {
  751. maid.body0.SetBoneHitHeightY(this.m_fFloorY);
  752. }
  753. num++;
  754. }
  755. for (int n = 0; n < this.m_listDummyAnimChara.Count; n++)
  756. {
  757. Maid maid2 = GameMain.Instance.CharacterMgr.GetMaid(n);
  758. for (int num3 = 0; num3 < this.m_listItemObject.Count; num3++)
  759. {
  760. Transform transform = CMT.SearchObjObj(this.m_listDummyAnimChara[n].transform, this.m_listItemObject[num3].transform);
  761. if (transform != null)
  762. {
  763. Transform transform2 = transform;
  764. string name2 = transform2.parent.name;
  765. Transform parent = CMT.SearchObjName(maid2.gameObject.transform, name2, true);
  766. transform2.SetParent(parent, false);
  767. }
  768. }
  769. }
  770. if (this.m_MoveToDummyCharaPos != null)
  771. {
  772. NDebug.Assert(this.m_MoveToDummyCharaPos.Length <= this.m_listDummyAnimChara.Count<GameObject>(), "MoveToDummyCharaPos は listDummyAnimChara の数以下である必要があります。");
  773. for (int num4 = 0; num4 < this.m_MoveToDummyCharaPos.Length; num4++)
  774. {
  775. if (this.m_MoveToDummyCharaPos[num4])
  776. {
  777. Vector3 position = this.m_listDummyAnimChara[num4].transform.position;
  778. Maid maid3 = GameMain.Instance.CharacterMgr.GetMaid(num4);
  779. if (maid3 != null)
  780. {
  781. maid3.SetPos(position);
  782. }
  783. }
  784. }
  785. }
  786. if (this.m_LayerChangeToDummyChara != null)
  787. {
  788. NDebug.Assert(this.m_LayerChangeToDummyChara.Length <= this.m_listDummyAnimChara.Count<GameObject>(), "LayerChangeToDummyChara は listDummyAnimChara の数以下である必要があります。");
  789. for (int num5 = 0; num5 < this.m_LayerChangeToDummyChara.Length; num5++)
  790. {
  791. if (this.m_LayerChangeToDummyChara[num5])
  792. {
  793. int layer = this.m_listDummyAnimChara[num5].layer;
  794. Maid maid4 = GameMain.Instance.CharacterMgr.GetMaid(num5);
  795. if (maid4 != null)
  796. {
  797. Transform[] componentsInChildren = maid4.gameObject.GetComponentsInChildren<Transform>(true);
  798. foreach (Transform transform3 in componentsInChildren)
  799. {
  800. transform3.gameObject.layer = layer;
  801. }
  802. }
  803. }
  804. }
  805. }
  806. if (this.m_EyeTarget != null)
  807. {
  808. NDebug.Assert(this.m_EyeTarget.Length <= this.m_listDummyAnimChara.Count<GameObject>(), "EyeTarget は listDummyAnimChara の数以下である必要があります。");
  809. for (int num7 = 0; num7 < this.m_EyeTarget.Length; num7++)
  810. {
  811. if (this.m_EyeTarget[num7] != null)
  812. {
  813. Maid maid5 = GameMain.Instance.CharacterMgr.GetMaid(num7);
  814. if (maid5 != null)
  815. {
  816. maid5.EyeToCamera(Maid.EyeMoveType.目だけ向ける, 0f);
  817. maid5.body0.trsLookTarget = this.m_EyeTarget[num7].transform;
  818. }
  819. }
  820. }
  821. }
  822. if (this.m_MotionCacheEnable != null)
  823. {
  824. NDebug.Assert(this.m_MotionCacheEnable.Length <= this.m_listDummyAnimChara.Count<GameObject>(), "MotionCacheEnable は listDummyAnimChara の数以下である必要があります。");
  825. for (int num8 = 0; num8 < this.m_MotionCacheEnable.Length; num8++)
  826. {
  827. if (this.m_MotionCacheEnable[num8])
  828. {
  829. Maid maid6 = GameMain.Instance.CharacterMgr.GetMaid(num8);
  830. if (maid6 != null)
  831. {
  832. for (int num9 = 0; num9 < this.m_MotionCacheFileName.Length; num9++)
  833. {
  834. maid6.CacheAnime(this.m_MotionCacheFileName[num9], false, false);
  835. }
  836. }
  837. }
  838. }
  839. }
  840. for (int num10 = 0; num10 < this.m_listDebugObj.Count; num10++)
  841. {
  842. UnityEngine.Object.DestroyImmediate(this.m_listDebugObj[num10]);
  843. }
  844. this.m_listDebugObj.Clear();
  845. }
  846. if (string.IsNullOrEmpty(this.m_AdjustScript))
  847. {
  848. this.m_eMode = DanceMain.Mode.LoadAnim;
  849. }
  850. else
  851. {
  852. base.StartCoroutine(this.LoadMotionScript());
  853. this.m_eMode = DanceMain.Mode.LoadScript;
  854. }
  855. }
  856. }
  857. else if (this.m_eMode == DanceMain.Mode.LoadAnim)
  858. {
  859. this.m_AnimatorData.Play(this.m_takeNow.name, true, 0f, false, this.time_line_binary_.GetTrackIDList());
  860. this.m_fTakeStartRealTime = Time.realtimeSinceStartup;
  861. this.m_fNowRealTime = this.m_fTakeStartRealTime;
  862. this.m_eMode = DanceMain.Mode.Exec;
  863. }
  864. else if (this.m_eMode == DanceMain.Mode.Exec)
  865. {
  866. bool isPause = RhythmAction_Mgr.Instance.IsPause;
  867. if (!isPause)
  868. {
  869. float num11 = RhythmAction_Mgr.Instance.DanceDeltaTime;
  870. if (this.m_audioNew != null && this.m_audioNew.isPlaying)
  871. {
  872. float time = this.m_audioNew.time;
  873. for (int num12 = 0; num12 < this.m_listMaid.Count; num12++)
  874. {
  875. this.m_listMaid[num12].FoceKuchipakuUpdate(time);
  876. }
  877. if (this.m_bAudioFirst)
  878. {
  879. float num13 = time;
  880. num11 = Time.realtimeSinceStartup - this.m_fTakeStartRealTime;
  881. this.m_bAudioFirst = false;
  882. this.m_fOffsetTime = num13 - num11;
  883. RhythmAction_Mgr.Instance.RhythmGame_Start();
  884. }
  885. }
  886. this.m_fNowRealTime += num11;
  887. }
  888. if (isPause != this.m_pauseBack)
  889. {
  890. foreach (DanceMain.AnimTime animTime in this.m_focePauseAnim)
  891. {
  892. if (isPause)
  893. {
  894. IEnumerator enumerator8 = animTime.anim.GetEnumerator();
  895. try
  896. {
  897. while (enumerator8.MoveNext())
  898. {
  899. object obj2 = enumerator8.Current;
  900. AnimationState animationState = (AnimationState)obj2;
  901. animTime.stateTimeList.Add(new DanceMain.AnimTime.StateTime
  902. {
  903. state = animationState,
  904. time = animationState.time
  905. });
  906. animationState.speed = 0f;
  907. }
  908. }
  909. finally
  910. {
  911. IDisposable disposable2;
  912. if ((disposable2 = (enumerator8 as IDisposable)) != null)
  913. {
  914. disposable2.Dispose();
  915. }
  916. }
  917. }
  918. else
  919. {
  920. foreach (DanceMain.AnimTime.StateTime stateTime in animTime.stateTimeList)
  921. {
  922. stateTime.state.time = stateTime.time;
  923. stateTime.state.speed = 1f;
  924. }
  925. animTime.stateTimeList.Clear();
  926. }
  927. }
  928. this.m_pauseBack = isPause;
  929. }
  930. if (this.IsForceDanceEnd || this.m_AnimatorData.takeName == null || this.IsDanceSkip || (DanceMain.KaraokeMode && Input.GetKeyDown(KeyCode.Return)))
  931. {
  932. this.ToFinish();
  933. }
  934. }
  935. else if (this.m_eMode == DanceMain.Mode.Finish)
  936. {
  937. }
  938. if (this.m_AnimatorData.takeName != null)
  939. {
  940. NTime.UpdateNowTime(this.m_fNowRealTime - this.m_fTakeStartRealTime + this.m_fOffsetTime);
  941. this.time_line_binary_.Update(NTime.time);
  942. }
  943. if (GameMain.Instance.VRMode && this.m_trOvrDummyCam != null && this.m_OvrCam != null)
  944. {
  945. this.m_OvrCam.SetPos(this.m_trOvrDummyCam.position);
  946. this.m_OvrCam.SetRotation(this.m_trOvrDummyCam.rotation.eulerAngles);
  947. }
  948. }
  949. private const string m_RhythmMgr_Path = "SceneDance/Rhythm_Action/Prefab/RhythmAction_Mgr";
  950. public static bool IsDanceRecet;
  951. public static DanceData SelectDanceData;
  952. public static bool KaraokeMode;
  953. private DanceMain.Mode m_eMode;
  954. public bool m_boDebugDummyBody;
  955. public Camera m_camDummyCamera;
  956. public List<GameObject> m_listDebugObj;
  957. public AnimatorData m_AnimatorData;
  958. public List<GameObject> m_listDummyAnimChara;
  959. public List<string> m_listAnimName;
  960. public List<GameObject> m_listEventObject;
  961. private Hashtable m_htEventObj = new Hashtable();
  962. public List<string> m_listTestPreset;
  963. public List<GameObject> m_listItemObject = new List<GameObject>();
  964. public List<string> m_listKuchiPakuFile = new List<string>();
  965. private string[] m_listKuchiPattern;
  966. private List<Maid> m_listMaid = new List<Maid>();
  967. public string m_strDummyAudioObjectName;
  968. private AudioSource m_audioNew;
  969. public string m_strMasterAudioFileName;
  970. public string m_strPlayTakeName = "Take1";
  971. private AMTake m_takeNow;
  972. private string m_strScriptLabel = string.Empty;
  973. private List<Maid> m_listTempMaid = new List<Maid>();
  974. private Maid m_maidUser;
  975. [HideInInspector]
  976. public bool IsForceDanceEnd;
  977. [HideInInspector]
  978. public bool IsDanceSkip;
  979. private OvrCamera m_OvrCam;
  980. private Transform m_trOvrDummyCam;
  981. public bool UseBinaryData;
  982. public string BinaryFolderName;
  983. private DanceObjectDataBinary maid_data_binary_;
  984. private DanceObjectDataBinary maid_item_binary_;
  985. private DanceObjectDataBinary maid_event_binary_;
  986. private AWReadBinaryData time_line_binary_;
  987. [Header("物理境界を変更するか?")]
  988. public bool UseFloorHitY;
  989. public float m_fFloorY;
  990. [SerializeField]
  991. [Header("被写界深度の焦点")]
  992. private float m_DepthFocalSize = 1.2f;
  993. [SerializeField]
  994. [Header("マイク位置調整等に使うモーションスクリプト名")]
  995. private string m_AdjustScript = string.Empty;
  996. [SerializeField]
  997. private string m_ScriptLabel = string.Empty;
  998. [SerializeField]
  999. [Header("AdjustScript読み込みに要する時間")]
  1000. private float m_LoadScriptTime = 3f;
  1001. [SerializeField]
  1002. [Header("初期化時にダミーキャラの位置にメイドを移動させるメイド番号スイッチ")]
  1003. public bool[] m_MoveToDummyCharaPos;
  1004. [SerializeField]
  1005. [Header("初期化時にダミーキャラのLayerをメイドに設定させるメイド番号スイッチ")]
  1006. public bool[] m_LayerChangeToDummyChara;
  1007. public Light[] m_OffScreenLight;
  1008. [SerializeField]
  1009. [Header("初期化時にメイドの視線に設定するオブジェクト対メイド番号")]
  1010. public GameObject[] m_EyeTarget;
  1011. [SerializeField]
  1012. [Header("特定メイド番号からダミーメイドへの容姿のコピー(Elementが元メイド番号/値が先メイド番号")]
  1013. public int[] m_PresetCopyToDummyChara;
  1014. [SerializeField]
  1015. [Header("途中でモーションを変えるメイド番号のファイル名リスト")]
  1016. public bool[] m_MotionCacheEnable;
  1017. [SerializeField]
  1018. [Header("途中でモーションを変える場合のファイル名リスト")]
  1019. public string[] m_MotionCacheFileName;
  1020. [SerializeField]
  1021. [Header("途中で口パクを変える場合のファイル名リスト")]
  1022. public string[] m_KuchipakuCacheFileName;
  1023. private Dictionary<string, string> m_KuchiPatternCache = new Dictionary<string, string>();
  1024. public float[] m_KuchipakuAudioStartTimeAtMaid;
  1025. private List<DanceMain.AnimTime> m_focePauseAnim = new List<DanceMain.AnimTime>();
  1026. private bool m_pauseBack;
  1027. private bool m_bFinished;
  1028. private float m_fNowRealTime;
  1029. private float m_fTakeStartRealTime;
  1030. private float m_fOffsetTime;
  1031. private bool m_bAudioFirst = true;
  1032. private enum Mode
  1033. {
  1034. ActiveCam,
  1035. LoadChara,
  1036. LoadAnim,
  1037. Exec,
  1038. Finish,
  1039. LoadScript
  1040. }
  1041. private class AnimTime
  1042. {
  1043. public Animation anim;
  1044. public List<DanceMain.AnimTime.StateTime> stateTimeList = new List<DanceMain.AnimTime.StateTime>();
  1045. public class StateTime
  1046. {
  1047. public AnimationState state;
  1048. public float time;
  1049. }
  1050. }
  1051. }