DanceMain.cs 36 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142
  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 && (!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_99B;
  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_99B:
  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].body0.IKCtrl.SetPelvisPull(false);
  487. this.m_listMaid[i].SetAutoTwist(Maid.AutoTwist.WristL, true);
  488. this.m_listMaid[i].SetAutoTwist(Maid.AutoTwist.WristR, true);
  489. Transform[] componentsInChildren = this.m_listMaid[i].gameObject.GetComponentsInChildren<Transform>(true);
  490. foreach (Transform transform in componentsInChildren)
  491. {
  492. transform.gameObject.layer = LayerMask.NameToLayer("Charactor");
  493. }
  494. }
  495. }
  496. for (int k = 0; k < this.m_listItemObject.Count; k++)
  497. {
  498. if (this.m_listItemObject[k] != null)
  499. {
  500. UnityEngine.Object.DestroyImmediate(this.m_listItemObject[k]);
  501. }
  502. }
  503. this.m_listItemObject.Clear();
  504. for (int l = 0; l < this.m_listTempMaid.Count; l++)
  505. {
  506. GameMain.Instance.CharacterMgr.BanishmentMaid(this.m_listTempMaid[l]);
  507. }
  508. if (!DanceMain.KaraokeMode)
  509. {
  510. if (this.DanceMaid.Any((Maid maid) => maid != null))
  511. {
  512. GameMain.Instance.CharacterMgr.DeactivateCharaAll();
  513. }
  514. if (this.m_maidUser != null && this.m_maidUser != GameMain.Instance.CharacterMgr.GetMaid(0))
  515. {
  516. GameMain.Instance.CharacterMgr.DeactivateMaid(0);
  517. GameMain.Instance.CharacterMgr.SetActiveMaid(this.m_maidUser, 0);
  518. }
  519. }
  520. this.m_eMode = DanceMain.Mode.Finish;
  521. this.m_bFinished = true;
  522. }
  523. private void ToFinish()
  524. {
  525. this.IsDanceEnd = !this.IsForceDanceEnd;
  526. RhythmAction_Mgr.Instance.RhythmGame_End();
  527. this.Uninit();
  528. if (!DanceMain.IsDanceRecet)
  529. {
  530. DanceSelect.SetNextDance();
  531. }
  532. else
  533. {
  534. NDebug.Assert(!string.IsNullOrEmpty(DanceMain.RecetJumpLabel), "やりなおし時に飛ぶラベルが設定されてません");
  535. }
  536. Debug.Log("Dance ToFinish Script");
  537. if (!string.IsNullOrEmpty(this.m_strScriptLabel))
  538. {
  539. if (DanceMain.IsDanceRecet)
  540. {
  541. Debug.Log("OnEndScene JumpTo " + DanceMain.RecetJumpLabel);
  542. GameMain.Instance.ScriptMgr.adv_kag.JumpLabel(DanceMain.RecetJumpLabel);
  543. }
  544. else
  545. {
  546. if (DanceMain.SelectDanceData != null)
  547. {
  548. GameMain.Instance.ScriptMgr.EvalScript("tf['dance_scene_name'] = '" + DanceMain.SelectDanceData.scene_name + "';");
  549. }
  550. Debug.Log("OnEndScene JumpTo " + this.m_strScriptLabel);
  551. GameMain.Instance.ScriptMgr.adv_kag.JumpLabel(this.m_strScriptLabel);
  552. }
  553. GameMain.Instance.ScriptMgr.adv_kag.Exec();
  554. }
  555. Debug.Log("Dance Finish!!");
  556. }
  557. private IEnumerator LoadMotionScript()
  558. {
  559. if (this.m_AdjustScript.IndexOf(".ks") < 0)
  560. {
  561. this.m_AdjustScript += ".ks";
  562. }
  563. NDebug.Assert(!string.IsNullOrEmpty(this.m_ScriptLabel), string.Format("{0}の飛び先が未指定です。", this.m_AdjustScript));
  564. if (this.m_ScriptLabel.IndexOf("*") < 0)
  565. {
  566. this.m_ScriptLabel = "*" + this.m_ScriptLabel;
  567. }
  568. ScriptManager script_mgr = GameMain.Instance.ScriptMgr;
  569. script_mgr.StopMotionScript();
  570. script_mgr.is_motion_blend = true;
  571. script_mgr.LoadMotionScript(0, false, this.m_AdjustScript, this.m_ScriptLabel, string.Empty, string.Empty, false, true, false);
  572. float timer = 0f;
  573. while (timer <= this.m_LoadScriptTime)
  574. {
  575. timer += Time.deltaTime;
  576. yield return null;
  577. }
  578. script_mgr.StopMotionScript();
  579. this.m_eMode = DanceMain.Mode.LoadAnim;
  580. yield break;
  581. }
  582. private void Update()
  583. {
  584. if (this.m_eMode == DanceMain.Mode.ActiveCam)
  585. {
  586. if (GameMain.Instance.MainCamera.gameObject.activeSelf)
  587. {
  588. GameMain.Instance.MainCamera.FadeOut(0f, false, null, true, default(Color));
  589. GameMain.Instance.MainCamera.SetCameraType(CameraMain.CameraType.Free);
  590. GameMain.Instance.MainCamera.SetControl(false);
  591. if (this.m_camDummyCamera != null)
  592. {
  593. if (!GameMain.Instance.VRMode)
  594. {
  595. AMTranslationTrack amtranslationTrack = this.m_takeNow.findTranslationTrack(this.m_camDummyCamera.gameObject.transform);
  596. amtranslationTrack.obj = GameMain.Instance.MainCamera.gameObject.transform;
  597. foreach (AMAction amaction in amtranslationTrack.cache)
  598. {
  599. AMTranslationAction amtranslationAction = (AMTranslationAction)amaction;
  600. amtranslationAction.obj = GameMain.Instance.MainCamera.gameObject.transform;
  601. }
  602. AMRotationTrack amrotationTrack = this.m_takeNow.findRotationTrack(this.m_camDummyCamera.gameObject.transform);
  603. amrotationTrack.obj = GameMain.Instance.MainCamera.gameObject.transform;
  604. foreach (AMAction amaction2 in amrotationTrack.cache)
  605. {
  606. AMRotationAction amrotationAction = (AMRotationAction)amaction2;
  607. amrotationAction.obj = GameMain.Instance.MainCamera.gameObject.transform;
  608. }
  609. }
  610. else if (GameMain.Instance.CMSystem.GetTmpGenericFlag("ダンスOVRカメラタイプ") != 0)
  611. {
  612. AMTranslationTrack amtranslationTrack2 = this.m_takeNow.findTranslationTrack(this.m_camDummyCamera.gameObject.transform);
  613. amtranslationTrack2.obj = this.m_trOvrDummyCam;
  614. foreach (AMAction amaction3 in amtranslationTrack2.cache)
  615. {
  616. AMTranslationAction amtranslationAction2 = (AMTranslationAction)amaction3;
  617. amtranslationAction2.obj = this.m_trOvrDummyCam;
  618. }
  619. AMRotationTrack amrotationTrack2 = this.m_takeNow.findRotationTrack(this.m_camDummyCamera.gameObject.transform);
  620. amrotationTrack2.obj = this.m_trOvrDummyCam;
  621. foreach (AMAction amaction4 in amrotationTrack2.cache)
  622. {
  623. AMRotationAction amrotationAction2 = (AMRotationAction)amaction4;
  624. amrotationAction2.obj = this.m_trOvrDummyCam;
  625. }
  626. }
  627. this.m_camDummyCamera.gameObject.SetActive(false);
  628. }
  629. if (!GameMain.Instance.VRMode)
  630. {
  631. this.ChangeObj(this.m_takeNow, "CameraMain", GameMain.Instance.MainCamera.gameObject);
  632. }
  633. else if (GameMain.Instance.CMSystem.GetTmpGenericFlag("ダンスOVRカメラタイプ") == 0)
  634. {
  635. if (!DanceMain.KaraokeMode)
  636. {
  637. GameMain.Instance.MainCamera.SetTargetPos(new Vector3(0f, 1.16f, 0f), true);
  638. GameMain.Instance.MainCamera.SetAroundAngle(new Vector2(180f, 0f), true);
  639. GameMain.Instance.MainCamera.SetDistance(5f, true);
  640. }
  641. }
  642. else
  643. {
  644. GameObject y = GameObject.Find("__GameMain__/Camera/CameraMain/CameraMain");
  645. AMBinaryDataBaseObject[] binary_data_list = this.time_line_binary_.binary_data_list;
  646. if (binary_data_list != null)
  647. {
  648. for (int i = 0; i < binary_data_list.Length; i++)
  649. {
  650. if (binary_data_list[i].obj == y)
  651. {
  652. binary_data_list[i].SetGameObject(this.m_trOvrDummyCam.gameObject);
  653. }
  654. }
  655. }
  656. }
  657. this.ChangeObj(this.m_takeNow, "MainDirectionalLight", GameMain.Instance.MainLight.gameObject);
  658. if (DanceMain.SelectDanceData == null || string.IsNullOrEmpty(DanceMain.SelectDanceData.bgm_file_name))
  659. {
  660. GameMain.Instance.SoundMgr.PlayDanceBGM(this.m_strMasterAudioFileName, 0f, true);
  661. }
  662. else
  663. {
  664. GameMain.Instance.SoundMgr.PlayDanceBGM(DanceMain.SelectDanceData.bgm_file_name + ".ogg", 0f, true);
  665. }
  666. AudioSource audioSourceBgm = GameMain.Instance.SoundMgr.GetAudioSourceBgm();
  667. audioSourceBgm.Stop();
  668. AMAudioTrack[] array = this.m_takeNow.findAudioTrack(this.m_strDummyAudioObjectName);
  669. foreach (AMAudioTrack amaudioTrack in array)
  670. {
  671. amaudioTrack.ChangeAudioSource(audioSourceBgm);
  672. }
  673. this.m_audioNew = audioSourceBgm;
  674. if (!this.m_boDebugDummyBody)
  675. {
  676. for (int k = 0; k < this.m_listAnimName.Count; k++)
  677. {
  678. this.m_listMaid.Add(GameMain.Instance.CharacterMgr.GetMaid(k));
  679. }
  680. for (int l = 0; l < this.m_listMaid.Count; l++)
  681. {
  682. this.m_listMaid[l].EyeToCamera(Maid.EyeMoveType.目だけ向ける, 0f);
  683. }
  684. NDebug.Assert(this.m_listKuchiPattern.Length == this.m_listMaid.Count, "メイド数と口パクパターン数が異なります。");
  685. for (int m = 0; m < this.m_listMaid.Count; m++)
  686. {
  687. if (!string.IsNullOrEmpty(this.m_listKuchiPattern[m]))
  688. {
  689. this.m_listMaid[m].StartKuchipakuPattern(0f, this.m_listKuchiPattern[m], true);
  690. }
  691. }
  692. }
  693. this.m_eMode = DanceMain.Mode.LoadChara;
  694. }
  695. }
  696. else if (this.m_eMode == DanceMain.Mode.LoadChara)
  697. {
  698. if (!GameMain.Instance.CharacterMgr.IsBusy() || this.m_listMaid.Count == 0)
  699. {
  700. if (!this.m_boDebugDummyBody)
  701. {
  702. int num = 1;
  703. for (;;)
  704. {
  705. string arg = "f";
  706. AMAnimationTrack amanimationTrack = this.m_takeNow.findAnimationTrack(arg + num);
  707. if (amanimationTrack == null)
  708. {
  709. break;
  710. }
  711. int num2 = num - 1;
  712. Maid maid = GameMain.Instance.CharacterMgr.GetMaid(num2);
  713. IEnumerator enumerator5 = Enum.GetValues(typeof(Maid.AutoTwist)).GetEnumerator();
  714. try
  715. {
  716. while (enumerator5.MoveNext())
  717. {
  718. object obj = enumerator5.Current;
  719. maid.SetAutoTwist((Maid.AutoTwist)obj, true);
  720. }
  721. }
  722. finally
  723. {
  724. IDisposable disposable;
  725. if ((disposable = (enumerator5 as IDisposable)) != null)
  726. {
  727. disposable.Dispose();
  728. }
  729. }
  730. if (!string.IsNullOrEmpty(this.m_listAnimName[num2]))
  731. {
  732. string name = maid.CrossFade(this.m_listAnimName[num2] + ".anm", false, false, false, 0f, 1f);
  733. Animation component = maid.body0.m_Bones.GetComponent<Animation>();
  734. component.Stop();
  735. amanimationTrack.obj = maid.body0.m_Bones;
  736. foreach (AMAction amaction5 in amanimationTrack.cache)
  737. {
  738. AMAnimationAction amanimationAction = (AMAnimationAction)amaction5;
  739. amanimationAction.amClip = component.GetClip(name);
  740. amanimationAction.obj = maid.body0.m_Bones;
  741. }
  742. }
  743. else
  744. {
  745. this.m_focePauseAnim.Add(new DanceMain.AnimTime
  746. {
  747. anim = maid.body0.m_Bones.GetComponent<Animation>()
  748. });
  749. }
  750. if (this.UseFloorHitY)
  751. {
  752. maid.body0.SetBoneHitHeightY(this.m_fFloorY);
  753. }
  754. num++;
  755. }
  756. for (int n = 0; n < this.m_listDummyAnimChara.Count; n++)
  757. {
  758. Maid maid2 = GameMain.Instance.CharacterMgr.GetMaid(n);
  759. for (int num3 = 0; num3 < this.m_listItemObject.Count; num3++)
  760. {
  761. Transform transform = CMT.SearchObjObj(this.m_listDummyAnimChara[n].transform, this.m_listItemObject[num3].transform);
  762. if (transform != null)
  763. {
  764. Transform transform2 = transform;
  765. string name2 = transform2.parent.name;
  766. Transform parent = CMT.SearchObjName(maid2.gameObject.transform, name2, true);
  767. transform2.SetParent(parent, false);
  768. }
  769. }
  770. }
  771. if (this.m_MoveToDummyCharaPos != null)
  772. {
  773. NDebug.Assert(this.m_MoveToDummyCharaPos.Length <= this.m_listDummyAnimChara.Count<GameObject>(), "MoveToDummyCharaPos は listDummyAnimChara の数以下である必要があります。");
  774. for (int num4 = 0; num4 < this.m_MoveToDummyCharaPos.Length; num4++)
  775. {
  776. if (this.m_MoveToDummyCharaPos[num4])
  777. {
  778. Vector3 position = this.m_listDummyAnimChara[num4].transform.position;
  779. Maid maid3 = GameMain.Instance.CharacterMgr.GetMaid(num4);
  780. if (maid3 != null)
  781. {
  782. maid3.SetPos(position);
  783. }
  784. }
  785. }
  786. }
  787. if (this.m_LayerChangeToDummyChara != null)
  788. {
  789. NDebug.Assert(this.m_LayerChangeToDummyChara.Length <= this.m_listDummyAnimChara.Count<GameObject>(), "LayerChangeToDummyChara は listDummyAnimChara の数以下である必要があります。");
  790. for (int num5 = 0; num5 < this.m_LayerChangeToDummyChara.Length; num5++)
  791. {
  792. if (this.m_LayerChangeToDummyChara[num5])
  793. {
  794. int layer = this.m_listDummyAnimChara[num5].layer;
  795. Maid maid4 = GameMain.Instance.CharacterMgr.GetMaid(num5);
  796. if (maid4 != null)
  797. {
  798. Transform[] componentsInChildren = maid4.gameObject.GetComponentsInChildren<Transform>(true);
  799. foreach (Transform transform3 in componentsInChildren)
  800. {
  801. transform3.gameObject.layer = layer;
  802. }
  803. }
  804. }
  805. }
  806. }
  807. if (this.m_EyeTarget != null)
  808. {
  809. NDebug.Assert(this.m_EyeTarget.Length <= this.m_listDummyAnimChara.Count<GameObject>(), "EyeTarget は listDummyAnimChara の数以下である必要があります。");
  810. for (int num7 = 0; num7 < this.m_EyeTarget.Length; num7++)
  811. {
  812. if (this.m_EyeTarget[num7] != null)
  813. {
  814. Maid maid5 = GameMain.Instance.CharacterMgr.GetMaid(num7);
  815. if (maid5 != null)
  816. {
  817. maid5.EyeToCamera(Maid.EyeMoveType.目だけ向ける, 0f);
  818. maid5.body0.trsLookTarget = this.m_EyeTarget[num7].transform;
  819. }
  820. }
  821. }
  822. }
  823. if (this.m_MotionCacheEnable != null)
  824. {
  825. NDebug.Assert(this.m_MotionCacheEnable.Length <= this.m_listDummyAnimChara.Count<GameObject>(), "MotionCacheEnable は listDummyAnimChara の数以下である必要があります。");
  826. for (int num8 = 0; num8 < this.m_MotionCacheEnable.Length; num8++)
  827. {
  828. if (this.m_MotionCacheEnable[num8])
  829. {
  830. Maid maid6 = GameMain.Instance.CharacterMgr.GetMaid(num8);
  831. if (maid6 != null)
  832. {
  833. for (int num9 = 0; num9 < this.m_MotionCacheFileName.Length; num9++)
  834. {
  835. maid6.CacheAnime(this.m_MotionCacheFileName[num9], false, false);
  836. }
  837. }
  838. }
  839. }
  840. }
  841. for (int num10 = 0; num10 < this.m_listDebugObj.Count; num10++)
  842. {
  843. UnityEngine.Object.DestroyImmediate(this.m_listDebugObj[num10]);
  844. }
  845. this.m_listDebugObj.Clear();
  846. }
  847. if (string.IsNullOrEmpty(this.m_AdjustScript))
  848. {
  849. this.m_eMode = DanceMain.Mode.LoadAnim;
  850. }
  851. else
  852. {
  853. base.StartCoroutine(this.LoadMotionScript());
  854. this.m_eMode = DanceMain.Mode.LoadScript;
  855. }
  856. }
  857. }
  858. else if (this.m_eMode == DanceMain.Mode.LoadAnim)
  859. {
  860. this.m_AnimatorData.Play(this.m_takeNow.name, true, 0f, false, this.time_line_binary_.GetTrackIDList());
  861. this.m_fTakeStartRealTime = Time.realtimeSinceStartup;
  862. this.m_fNowRealTime = this.m_fTakeStartRealTime;
  863. this.m_eMode = DanceMain.Mode.Exec;
  864. }
  865. else if (this.m_eMode == DanceMain.Mode.Exec)
  866. {
  867. bool isPause = RhythmAction_Mgr.Instance.IsPause;
  868. if (!isPause)
  869. {
  870. float num11 = RhythmAction_Mgr.Instance.DanceDeltaTime;
  871. if (this.m_audioNew != null && this.m_audioNew.isPlaying)
  872. {
  873. float time = this.m_audioNew.time;
  874. for (int num12 = 0; num12 < this.m_listMaid.Count; num12++)
  875. {
  876. this.m_listMaid[num12].FoceKuchipakuUpdate(time);
  877. }
  878. if (this.m_bAudioFirst)
  879. {
  880. float num13 = time;
  881. num11 = Time.realtimeSinceStartup - this.m_fTakeStartRealTime;
  882. this.m_bAudioFirst = false;
  883. this.m_fOffsetTime = num13 - num11;
  884. RhythmAction_Mgr.Instance.RhythmGame_Start();
  885. }
  886. }
  887. this.m_fNowRealTime += num11;
  888. }
  889. if (isPause != this.m_pauseBack)
  890. {
  891. foreach (DanceMain.AnimTime animTime in this.m_focePauseAnim)
  892. {
  893. if (isPause)
  894. {
  895. IEnumerator enumerator8 = animTime.anim.GetEnumerator();
  896. try
  897. {
  898. while (enumerator8.MoveNext())
  899. {
  900. object obj2 = enumerator8.Current;
  901. AnimationState animationState = (AnimationState)obj2;
  902. animTime.stateTimeList.Add(new DanceMain.AnimTime.StateTime
  903. {
  904. state = animationState,
  905. time = animationState.time
  906. });
  907. animationState.speed = 0f;
  908. }
  909. }
  910. finally
  911. {
  912. IDisposable disposable2;
  913. if ((disposable2 = (enumerator8 as IDisposable)) != null)
  914. {
  915. disposable2.Dispose();
  916. }
  917. }
  918. }
  919. else
  920. {
  921. foreach (DanceMain.AnimTime.StateTime stateTime in animTime.stateTimeList)
  922. {
  923. stateTime.state.time = stateTime.time;
  924. stateTime.state.speed = 1f;
  925. }
  926. animTime.stateTimeList.Clear();
  927. }
  928. }
  929. this.m_pauseBack = isPause;
  930. }
  931. if (this.IsForceDanceEnd || this.m_AnimatorData.takeName == null || this.IsDanceSkip || (DanceMain.KaraokeMode && Input.GetKeyDown(KeyCode.Return)))
  932. {
  933. this.ToFinish();
  934. }
  935. }
  936. else if (this.m_eMode == DanceMain.Mode.Finish)
  937. {
  938. }
  939. if (this.m_AnimatorData.takeName != null)
  940. {
  941. NTime.UpdateNowTime(this.m_fNowRealTime - this.m_fTakeStartRealTime + this.m_fOffsetTime);
  942. this.time_line_binary_.Update(NTime.time);
  943. }
  944. if (GameMain.Instance.VRMode && this.m_trOvrDummyCam != null && this.m_OvrCam != null)
  945. {
  946. this.m_OvrCam.SetPos(this.m_trOvrDummyCam.position);
  947. this.m_OvrCam.SetRotation(this.m_trOvrDummyCam.rotation.eulerAngles);
  948. }
  949. }
  950. private const string m_RhythmMgr_Path = "SceneDance/Rhythm_Action/Prefab/RhythmAction_Mgr";
  951. public static bool IsDanceRecet;
  952. public static DanceData SelectDanceData;
  953. public static bool KaraokeMode;
  954. private DanceMain.Mode m_eMode;
  955. public bool m_boDebugDummyBody;
  956. public Camera m_camDummyCamera;
  957. public List<GameObject> m_listDebugObj;
  958. public AnimatorData m_AnimatorData;
  959. public List<GameObject> m_listDummyAnimChara;
  960. public List<string> m_listAnimName;
  961. public List<GameObject> m_listEventObject;
  962. private Hashtable m_htEventObj = new Hashtable();
  963. public List<string> m_listTestPreset;
  964. public List<GameObject> m_listItemObject = new List<GameObject>();
  965. public List<string> m_listKuchiPakuFile = new List<string>();
  966. private string[] m_listKuchiPattern;
  967. private List<Maid> m_listMaid = new List<Maid>();
  968. public string m_strDummyAudioObjectName;
  969. private AudioSource m_audioNew;
  970. public string m_strMasterAudioFileName;
  971. public string m_strPlayTakeName = "Take1";
  972. private AMTake m_takeNow;
  973. private string m_strScriptLabel = string.Empty;
  974. private List<Maid> m_listTempMaid = new List<Maid>();
  975. private Maid m_maidUser;
  976. [HideInInspector]
  977. public bool IsForceDanceEnd;
  978. [HideInInspector]
  979. public bool IsDanceSkip;
  980. private OvrCamera m_OvrCam;
  981. private Transform m_trOvrDummyCam;
  982. public bool UseBinaryData;
  983. public string BinaryFolderName;
  984. private DanceObjectDataBinary maid_data_binary_;
  985. private DanceObjectDataBinary maid_item_binary_;
  986. private DanceObjectDataBinary maid_event_binary_;
  987. private AWReadBinaryData time_line_binary_;
  988. [Header("物理境界を変更するか?")]
  989. public bool UseFloorHitY;
  990. public float m_fFloorY;
  991. [SerializeField]
  992. [Header("被写界深度の焦点")]
  993. private float m_DepthFocalSize = 1.2f;
  994. [SerializeField]
  995. [Header("マイク位置調整等に使うモーションスクリプト名")]
  996. private string m_AdjustScript = string.Empty;
  997. [SerializeField]
  998. private string m_ScriptLabel = string.Empty;
  999. [SerializeField]
  1000. [Header("AdjustScript読み込みに要する時間")]
  1001. private float m_LoadScriptTime = 3f;
  1002. [SerializeField]
  1003. [Header("初期化時にダミーキャラの位置にメイドを移動させるメイド番号スイッチ")]
  1004. public bool[] m_MoveToDummyCharaPos;
  1005. [SerializeField]
  1006. [Header("初期化時にダミーキャラのLayerをメイドに設定させるメイド番号スイッチ")]
  1007. public bool[] m_LayerChangeToDummyChara;
  1008. public Light[] m_OffScreenLight;
  1009. [SerializeField]
  1010. [Header("初期化時にメイドの視線に設定するオブジェクト対メイド番号")]
  1011. public GameObject[] m_EyeTarget;
  1012. [SerializeField]
  1013. [Header("特定メイド番号からダミーメイドへの容姿のコピー(Elementが元メイド番号/値が先メイド番号")]
  1014. public int[] m_PresetCopyToDummyChara;
  1015. [SerializeField]
  1016. [Header("途中でモーションを変えるメイド番号のファイル名リスト")]
  1017. public bool[] m_MotionCacheEnable;
  1018. [SerializeField]
  1019. [Header("途中でモーションを変える場合のファイル名リスト")]
  1020. public string[] m_MotionCacheFileName;
  1021. [SerializeField]
  1022. [Header("途中で口パクを変える場合のファイル名リスト")]
  1023. public string[] m_KuchipakuCacheFileName;
  1024. private Dictionary<string, string> m_KuchiPatternCache = new Dictionary<string, string>();
  1025. public float[] m_KuchipakuAudioStartTimeAtMaid;
  1026. private List<DanceMain.AnimTime> m_focePauseAnim = new List<DanceMain.AnimTime>();
  1027. private bool m_pauseBack;
  1028. private bool m_bFinished;
  1029. private float m_fNowRealTime;
  1030. private float m_fTakeStartRealTime;
  1031. private float m_fOffsetTime;
  1032. private bool m_bAudioFirst = true;
  1033. private enum Mode
  1034. {
  1035. ActiveCam,
  1036. LoadChara,
  1037. LoadAnim,
  1038. Exec,
  1039. Finish,
  1040. LoadScript
  1041. }
  1042. private class AnimTime
  1043. {
  1044. public Animation anim;
  1045. public List<DanceMain.AnimTime.StateTime> stateTimeList = new List<DanceMain.AnimTime.StateTime>();
  1046. public class StateTime
  1047. {
  1048. public AnimationState state;
  1049. public float time;
  1050. }
  1051. }
  1052. }