GameUty.cs 38 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Text.RegularExpressions;
  7. using I2.Loc;
  8. using UnityEngine;
  9. using wf;
  10. public class GameUty
  11. {
  12. public static AFileSystemBase FileSystem
  13. {
  14. get
  15. {
  16. return GameUty.m_FileSystem;
  17. }
  18. }
  19. public static AFileSystemBase FileSystemOld
  20. {
  21. get
  22. {
  23. return GameUty.m_FileSystemOld;
  24. }
  25. }
  26. public static AFileSystemBase FileSystemMod
  27. {
  28. get
  29. {
  30. return GameUty.m_ModFileSystem;
  31. }
  32. }
  33. public static bool IsEnabledCompatibilityMode
  34. {
  35. get
  36. {
  37. return 0 < GameUty.PathListOld.Count && Product.type == Product.Type.JpAdult;
  38. }
  39. }
  40. public static HashSet<string> loadArchiveList { get; private set; }
  41. public static string[] MenuFiles
  42. {
  43. get
  44. {
  45. return GameUty.m_aryMenuFiles;
  46. }
  47. }
  48. public static string[] ModOnlysMenuFiles
  49. {
  50. get
  51. {
  52. return GameUty.m_aryModOnlysMenuFiles;
  53. }
  54. }
  55. public static Dictionary<int, string> RidMenuDic
  56. {
  57. get
  58. {
  59. return GameUty.rid_menu_dic_;
  60. }
  61. }
  62. public static Dictionary<string, AFileSystemBase> BgFiles { get; private set; }
  63. public static float MillisecondToSecond(int millisecond)
  64. {
  65. return (float)millisecond / 1000f;
  66. }
  67. public static Material GetSystemMaterial(GameUty.SystemMaterial f_mat)
  68. {
  69. Material material = GameUty.m_matSystem[(int)f_mat];
  70. if (material == null)
  71. {
  72. UnityEngine.Object original = Resources.Load(GameUty.m_strSystemMaterialName[(int)f_mat]);
  73. material = (UnityEngine.Object.Instantiate(original) as Material);
  74. GameUty.m_matSystem[(int)f_mat] = material;
  75. }
  76. return material;
  77. }
  78. public static GameObject LoadAssetBundle(string file_name)
  79. {
  80. if (GameUty.FileSystem == null || !GameUty.FileSystem.IsExistentFile(file_name))
  81. {
  82. return null;
  83. }
  84. UnityEngine.Object original = null;
  85. if (!GameUty.asset_bundle_dic.ContainsKey(file_name))
  86. {
  87. using (AFileBase afileBase = GameUty.FileSystem.FileOpen(file_name))
  88. {
  89. AssetBundle assetBundle = AssetBundle.LoadFromMemory(afileBase.ReadAll());
  90. if (assetBundle.mainAsset != null)
  91. {
  92. original = assetBundle.mainAsset;
  93. }
  94. else
  95. {
  96. original = assetBundle.LoadAllAssets<GameObject>()[0];
  97. }
  98. GameUty.asset_bundle_dic.Add(file_name, assetBundle);
  99. }
  100. }
  101. else
  102. {
  103. original = GameUty.asset_bundle_dic[file_name].mainAsset;
  104. }
  105. GameObject gameObject = UnityEngine.Object.Instantiate(original) as GameObject;
  106. gameObject.name = gameObject.name.Replace("(Clone)", string.Empty);
  107. return gameObject;
  108. }
  109. public static void DeviceInitialize()
  110. {
  111. }
  112. public static void Init()
  113. {
  114. GameUty.m_FileSystem = new FileSystemArchive();
  115. GameUty.m_FileSystemOld = new FileSystemArchive();
  116. GameUty.loadArchiveList = new HashSet<string>();
  117. GameUty.PathListOld = new List<string>();
  118. if (!string.IsNullOrEmpty(GameMain.Instance.CMSystem.CM3D2Path))
  119. {
  120. GameUty.PathListOld = GameUty.ReadAutoPathFile("[2.0]", GameMain.Instance.CMSystem.CM3D2Path + "\\GameData\\paths.dat");
  121. if (GameUty.PathListOld == null)
  122. {
  123. GameUty.PathListOld = new List<string>();
  124. }
  125. }
  126. GameUty.UpdateFileSystemPath();
  127. GameUty.UpdateFileSystemPathOld();
  128. PluginData.CreateData(GameUty.m_FileSystem, (!GameUty.IsEnabledCompatibilityMode) ? null : GameUty.m_FileSystemOld);
  129. Debug.Log("■■■■■■■■ Plugin Check ■■■■■■■■");
  130. foreach (string text in PluginData.GetAllUniqueNames())
  131. {
  132. Debug.Log(string.Concat(new string[]
  133. {
  134. "[",
  135. PluginData.uniqueNameToId(text).ToString(),
  136. "]",
  137. text,
  138. " : ",
  139. (!PluginData.IsEnabled(text)) ? "×" : "○"
  140. }));
  141. }
  142. Debug.Log("■■■■■■■■■■■■■■■■■■■■");
  143. string windowTitel = Product.windowTitel;
  144. if (!string.IsNullOrEmpty(windowTitel))
  145. {
  146. DllBase.Win32.SetWindowText(DllBase.Win32.GetActiveWindow(), windowTitel);
  147. }
  148. }
  149. public static void Finish()
  150. {
  151. foreach (KeyValuePair<string, AssetBundle> keyValuePair in GameUty.asset_bundle_dic)
  152. {
  153. keyValuePair.Value.Unload(true);
  154. }
  155. GameUty.asset_bundle_dic.Clear();
  156. GameUty.m_FileSystem.Dispose();
  157. GameUty.m_FileSystem = null;
  158. if (GameUty.m_FileSystemOld != null)
  159. {
  160. GameUty.m_FileSystemOld.Dispose();
  161. GameUty.m_FileSystemOld = null;
  162. }
  163. if (GameUty.m_ModFileSystem != null)
  164. {
  165. GameUty.m_ModFileSystem.Dispose();
  166. GameUty.m_ModFileSystem = null;
  167. }
  168. }
  169. public static Dictionary<string, HashSet<string>> GetGameDataResourceList(string gameDataPath)
  170. {
  171. string[] array = new string[]
  172. {
  173. "script_cbl",
  174. "motion_cbl",
  175. "voice_cbl"
  176. };
  177. int length = (gameDataPath + "\\").Length;
  178. string[] directories = Directory.GetDirectories(gameDataPath);
  179. Dictionary<string, HashSet<string>> dictionary = new Dictionary<string, HashSet<string>>();
  180. for (int i = 0; i < directories.Length; i++)
  181. {
  182. string text = directories[i].Substring(length, directories[i].Length - length).ToLower();
  183. int startIndex = 0;
  184. foreach (string text2 in array)
  185. {
  186. if (text.IndexOf(text2) == 0)
  187. {
  188. startIndex = text2.Length;
  189. break;
  190. }
  191. }
  192. int num = text.IndexOf('_', startIndex);
  193. if (0 <= num)
  194. {
  195. string text3 = text.Substring(0, num);
  196. if (!string.IsNullOrEmpty(text3))
  197. {
  198. string text4 = text.Substring(text3.Length + 1, text.Length - (text3.Length + 1));
  199. if (!string.IsNullOrEmpty(text4))
  200. {
  201. if (!dictionary.ContainsKey(text3))
  202. {
  203. dictionary.Add(text3, new HashSet<string>());
  204. }
  205. if (!dictionary[text3].Contains(text4))
  206. {
  207. dictionary[text3].Add(text4);
  208. }
  209. else
  210. {
  211. Debug.LogWarning(text3 + "_" + text4 + "は既にリストに存在します");
  212. }
  213. }
  214. }
  215. }
  216. else if (!dictionary.ContainsKey(text))
  217. {
  218. dictionary.Add(text, new HashSet<string>());
  219. }
  220. else
  221. {
  222. Debug.LogWarning(text + "は既にリストに存在します");
  223. }
  224. }
  225. return dictionary;
  226. }
  227. public static List<string> ReadAutoPathFile(string uniqueName, string filePath)
  228. {
  229. if (!File.Exists(filePath))
  230. {
  231. return null;
  232. }
  233. List<string> list = new List<string>();
  234. using (FileStream fileStream = new FileStream(filePath, FileMode.Open))
  235. {
  236. using (BinaryReader binaryReader = new BinaryReader(fileStream))
  237. {
  238. string a = binaryReader.ReadString();
  239. NDebug.Assert(a == "CM3D2_PATHS", "パスファイルのヘッダーが不正です。");
  240. int num = binaryReader.ReadInt32();
  241. int num2 = binaryReader.ReadInt32();
  242. for (int i = 0; i < num2; i++)
  243. {
  244. string item = binaryReader.ReadString();
  245. list.Add(item);
  246. }
  247. }
  248. }
  249. return list;
  250. }
  251. public static void UpdateFileSystemPath()
  252. {
  253. string text = UTY.gameProjectPath + "\\";
  254. string gameDataPath = "GameData";
  255. int check_ver_no = 3;
  256. Func<string, bool> AddFolderOrArchive = delegate(string name)
  257. {
  258. bool flag3 = GameUty.m_FileSystem.AddArchive(gameDataPath + "\\" + name + ".arc");
  259. if (flag3)
  260. {
  261. Debug.Log(string.Concat(new string[]
  262. {
  263. "[",
  264. gameDataPath,
  265. "\\",
  266. name,
  267. ".arc]を読み込みました"
  268. }));
  269. }
  270. if (flag3)
  271. {
  272. GameUty.loadArchiveList.Add(name.ToLower());
  273. }
  274. return flag3;
  275. };
  276. HashSet<string> addedLegacyArchives = new HashSet<string>();
  277. Action<string> action = delegate(string name)
  278. {
  279. foreach (string text30 in GameUty.PathList)
  280. {
  281. string text31 = name + "_" + text30;
  282. bool flag3 = AddFolderOrArchive(text31);
  283. if (flag3 && !addedLegacyArchives.Contains(text31))
  284. {
  285. addedLegacyArchives.Add(text31);
  286. }
  287. if (flag3)
  288. {
  289. if (name == "csv")
  290. {
  291. GameUty.ExistCsvPathList.Add(text30);
  292. }
  293. for (int num15 = 2; num15 <= check_ver_no; num15++)
  294. {
  295. AddFolderOrArchive(text31 + "_" + num15);
  296. }
  297. }
  298. }
  299. };
  300. Action<string> action2 = delegate(string name)
  301. {
  302. foreach (string text30 in GameUty.PathList)
  303. {
  304. string text31 = name + "_" + text30;
  305. bool flag3 = AddFolderOrArchive(text31);
  306. if (!flag3 && addedLegacyArchives.Contains(text31))
  307. {
  308. flag3 = true;
  309. }
  310. if (flag3)
  311. {
  312. if (name == "csv")
  313. {
  314. GameUty.ExistCsvPathList.Add(text30);
  315. }
  316. for (int num15 = 2; num15 <= check_ver_no; num15++)
  317. {
  318. AddFolderOrArchive(string.Concat(new object[]
  319. {
  320. name,
  321. "_",
  322. text30,
  323. "_",
  324. num15
  325. }));
  326. }
  327. }
  328. }
  329. };
  330. Action<string> action3 = delegate(string name)
  331. {
  332. foreach (string text30 in GameUty.PathList)
  333. {
  334. if (AddFolderOrArchive(name + "_" + text30))
  335. {
  336. if (name == "csv")
  337. {
  338. GameUty.ExistCsvPathList.Add(text30);
  339. }
  340. for (int num15 = 2; num15 <= check_ver_no; num15++)
  341. {
  342. AddFolderOrArchive(string.Concat(new object[]
  343. {
  344. name,
  345. "_",
  346. text30,
  347. "_",
  348. num15
  349. }));
  350. }
  351. }
  352. }
  353. };
  354. string str = string.Empty;
  355. str = "必用アーカイブがありません。GameData\\";
  356. GameUty.m_FileSystem.SetBaseDirectory(text);
  357. AddFolderOrArchive("product");
  358. Product.Initialize(GameUty.m_FileSystem);
  359. Debug.Log("IsEnabledCompatibilityMode:" + GameUty.IsEnabledCompatibilityMode.ToString());
  360. string gameTitle = Product.gameTitle;
  361. string str2 = "カスタムメイド3D 2";
  362. Debug.Log(string.Concat(new string[]
  363. {
  364. gameTitle,
  365. " GameVersion ",
  366. GameUty.GetGameVersionText(),
  367. "(BuildVersion : ",
  368. GameUty.GetBuildVersionText(),
  369. ")"
  370. }));
  371. if (!string.IsNullOrEmpty(GameMain.Instance.CMSystem.CM3D2Path))
  372. {
  373. Debug.Log(str2 + " GameVersion " + GameUty.GetLegacyGameVersionText());
  374. }
  375. if (Product.type != Product.Type.JpAdult)
  376. {
  377. GameUty.UpdateFileSystemPathToNewProduct();
  378. }
  379. else
  380. {
  381. StopWatch stopWatch = new StopWatch();
  382. if (GameUty.IsEnabledCompatibilityMode)
  383. {
  384. Debug.Log("■■■■■■■■ Archive Log[2.0] (CM3D2 GameData) ■■■■■■■■");
  385. GameUty.m_FileSystem.SetBaseDirectory(GameMain.Instance.CMSystem.CM3D2Path);
  386. GameUty.PathList = GameUty.PathListOld;
  387. AddFolderOrArchive("material");
  388. foreach (string text2 in GameUty.PathListOld)
  389. {
  390. string str3 = "material";
  391. if (text2 == "denkigai2015wTowelR")
  392. {
  393. AddFolderOrArchive(str3 + "_denkigai2015wTowel");
  394. }
  395. string text3 = str3 + "_" + text2;
  396. bool flag = AddFolderOrArchive(text3);
  397. if (flag && !addedLegacyArchives.Contains(text3))
  398. {
  399. addedLegacyArchives.Add(text3);
  400. }
  401. if (flag)
  402. {
  403. for (int i2 = 2; i2 <= check_ver_no; i2++)
  404. {
  405. AddFolderOrArchive(text3 + "_" + i2);
  406. }
  407. }
  408. }
  409. AddFolderOrArchive("material2");
  410. AddFolderOrArchive("menu");
  411. action("menu");
  412. AddFolderOrArchive("menu2");
  413. AddFolderOrArchive("model");
  414. action("model");
  415. AddFolderOrArchive("model2");
  416. AddFolderOrArchive("texture");
  417. action("texture");
  418. AddFolderOrArchive("texture2");
  419. AddFolderOrArchive("texture3");
  420. AddFolderOrArchive("prioritymaterial");
  421. Debug.Log("■■■■■■■■■■■■■■■■■■■■");
  422. }
  423. Debug.Log("■■■■■■■■ Archive Log[2.1 Compatibility] (GameData_20) ■■■■■■■■");
  424. gameDataPath = "GameData_20";
  425. GameUty.m_FileSystem.SetBaseDirectory(text);
  426. if (GameUty.IsEnabledCompatibilityMode)
  427. {
  428. GameUty.m_FileSystem.AddPatchDecryptPreferredSearchDirectory(GameMain.Instance.CMSystem.CM3D2Path + "\\GameData");
  429. }
  430. GameUty.PathList = GameUty.ReadAutoPathFile("[2.1Compatibility]", text + gameDataPath + "\\paths.dat");
  431. if (GameUty.PathList != null && 0 < GameUty.PathList.Count)
  432. {
  433. foreach (string text4 in GameUty.PathList)
  434. {
  435. string text5 = "material";
  436. if (text4 == "denkigai2015wTowelR")
  437. {
  438. AddFolderOrArchive(text5 + "_denkigai2015wTowel");
  439. }
  440. string text6 = text5 + "_" + text4;
  441. bool flag2 = AddFolderOrArchive(text6);
  442. if (!flag2 && addedLegacyArchives.Contains(text6))
  443. {
  444. flag2 = true;
  445. }
  446. if (flag2)
  447. {
  448. for (int j = 2; j <= check_ver_no; j++)
  449. {
  450. AddFolderOrArchive(string.Concat(new object[]
  451. {
  452. text5,
  453. "_",
  454. text4,
  455. "_",
  456. j
  457. }));
  458. }
  459. }
  460. }
  461. action2("menu");
  462. action2("model");
  463. action2("texture");
  464. AddFolderOrArchive("prioritymaterial");
  465. List<string> pathList = GameUty.PathList;
  466. GameUty.PathList = new List<string>();
  467. GameUty.PathList.Add("vp001");
  468. action2("bg");
  469. action2("motion");
  470. GameUty.PathList = pathList;
  471. }
  472. GameUty.m_FileSystem.ClearPatchDecryptPreferredSearchDirectory();
  473. Debug.Log("■■■■■■■■■■■■■■■■■■■■");
  474. Debug.Log("■■■■■■■■ Archive Log[2.1] (GameData) ■■■■■■■■");
  475. gameDataPath = "GameData";
  476. GameUty.PathList = GameUty.ReadAutoPathFile("[2.1]", text + gameDataPath + "\\paths.dat");
  477. if (GameUty.PathList == null)
  478. {
  479. GameUty.PathList = new List<string>();
  480. NDebug.Assert("paths.datを読み込めませんでした", false);
  481. }
  482. GameUty.PathList.Add("jp");
  483. AddFolderOrArchive("csv");
  484. foreach (string text7 in GameUty.PathList)
  485. {
  486. string text8 = "csv";
  487. if (AddFolderOrArchive(text8 + "_" + text7))
  488. {
  489. for (int k = 2; k <= check_ver_no; k++)
  490. {
  491. AddFolderOrArchive(string.Concat(new object[]
  492. {
  493. text8,
  494. "_",
  495. text7,
  496. "_",
  497. k
  498. }));
  499. }
  500. }
  501. }
  502. AddFolderOrArchive("prioritymaterial");
  503. NDebug.Assert(AddFolderOrArchive("motion"), str + "motion");
  504. foreach (string text9 in GameUty.PathList)
  505. {
  506. string text10 = "motion";
  507. if (AddFolderOrArchive(text10 + "_" + text9))
  508. {
  509. for (int l = 2; l <= check_ver_no; l++)
  510. {
  511. AddFolderOrArchive(string.Concat(new object[]
  512. {
  513. text10,
  514. "_",
  515. text9,
  516. "_",
  517. l
  518. }));
  519. }
  520. }
  521. }
  522. AddFolderOrArchive("motion2");
  523. NDebug.Assert(AddFolderOrArchive("script"), str + "script");
  524. foreach (string text11 in GameUty.PathList)
  525. {
  526. string text12 = "script";
  527. if (AddFolderOrArchive(text12 + "_" + text11))
  528. {
  529. for (int m = 2; m <= check_ver_no; m++)
  530. {
  531. AddFolderOrArchive(string.Concat(new object[]
  532. {
  533. text12,
  534. "_",
  535. text11,
  536. "_",
  537. m
  538. }));
  539. }
  540. }
  541. }
  542. AddFolderOrArchive("script_share");
  543. foreach (string text13 in GameUty.PathList)
  544. {
  545. string text14 = "script_share";
  546. if (AddFolderOrArchive(text14 + "_" + text13))
  547. {
  548. for (int n = 2; n <= check_ver_no; n++)
  549. {
  550. AddFolderOrArchive(string.Concat(new object[]
  551. {
  552. text14,
  553. "_",
  554. text13,
  555. "_",
  556. n
  557. }));
  558. }
  559. }
  560. }
  561. AddFolderOrArchive("script_share2");
  562. NDebug.Assert(AddFolderOrArchive("sound"), str + "sound");
  563. foreach (string text15 in GameUty.PathList)
  564. {
  565. string text16 = "sound";
  566. if (AddFolderOrArchive(text16 + "_" + text15))
  567. {
  568. for (int num = 2; num <= check_ver_no; num++)
  569. {
  570. AddFolderOrArchive(string.Concat(new object[]
  571. {
  572. text16,
  573. "_",
  574. text15,
  575. "_",
  576. num
  577. }));
  578. }
  579. }
  580. }
  581. AddFolderOrArchive("sound2");
  582. NDebug.Assert(AddFolderOrArchive("system"), str + "system");
  583. foreach (string text17 in GameUty.PathList)
  584. {
  585. string text18 = "system";
  586. if (AddFolderOrArchive(text18 + "_" + text17))
  587. {
  588. for (int num2 = 2; num2 <= check_ver_no; num2++)
  589. {
  590. AddFolderOrArchive(string.Concat(new object[]
  591. {
  592. text18,
  593. "_",
  594. text17,
  595. "_",
  596. num2
  597. }));
  598. }
  599. }
  600. }
  601. AddFolderOrArchive("system2");
  602. AddFolderOrArchive("language");
  603. foreach (string text19 in GameUty.PathList)
  604. {
  605. string text20 = "language";
  606. if (AddFolderOrArchive(text20 + "_" + text19))
  607. {
  608. for (int num3 = 2; num3 <= check_ver_no; num3++)
  609. {
  610. AddFolderOrArchive(string.Concat(new object[]
  611. {
  612. text20,
  613. "_",
  614. text19,
  615. "_",
  616. num3
  617. }));
  618. }
  619. }
  620. }
  621. foreach (string text21 in GameUty.PathList)
  622. {
  623. string text22 = "bg";
  624. if (AddFolderOrArchive(text22 + "_" + text21))
  625. {
  626. for (int num4 = 2; num4 <= check_ver_no; num4++)
  627. {
  628. AddFolderOrArchive(string.Concat(new object[]
  629. {
  630. text22,
  631. "_",
  632. text21,
  633. "_",
  634. num4
  635. }));
  636. }
  637. }
  638. }
  639. if (Product.isEnglish && !Product.isPublic)
  640. {
  641. string text23 = "bg-en";
  642. NDebug.Assert(AddFolderOrArchive(text23), str + text23);
  643. foreach (string text24 in GameUty.PathList)
  644. {
  645. if (AddFolderOrArchive(text23 + "_" + text24))
  646. {
  647. for (int num5 = 2; num5 <= check_ver_no; num5++)
  648. {
  649. AddFolderOrArchive(string.Concat(new object[]
  650. {
  651. text23,
  652. "_",
  653. text24,
  654. "_",
  655. num5
  656. }));
  657. }
  658. }
  659. }
  660. AddFolderOrArchive("bg-en2");
  661. }
  662. AddFolderOrArchive("voice");
  663. for (int num6 = 0; num6 < 25; num6++)
  664. {
  665. string arg = "voice";
  666. string arg2 = arg + "_" + (char)(97 + num6);
  667. AddFolderOrArchive(arg2);
  668. }
  669. foreach (string text25 in GameUty.PathList)
  670. {
  671. string text26 = "voice";
  672. if (AddFolderOrArchive(text26 + "_" + text25))
  673. {
  674. for (int num7 = 2; num7 <= check_ver_no; num7++)
  675. {
  676. AddFolderOrArchive(string.Concat(new object[]
  677. {
  678. text26,
  679. "_",
  680. text25,
  681. "_",
  682. num7
  683. }));
  684. }
  685. }
  686. }
  687. for (int num8 = 2; num8 <= check_ver_no; num8++)
  688. {
  689. string arg3 = "voice";
  690. AddFolderOrArchive(arg3 + num8);
  691. }
  692. string text27 = "parts";
  693. NDebug.Assert(AddFolderOrArchive(text27), str + text27);
  694. foreach (string text28 in GameUty.PathList)
  695. {
  696. if (AddFolderOrArchive(text27 + "_" + text28))
  697. {
  698. for (int num9 = 2; num9 <= check_ver_no; num9++)
  699. {
  700. AddFolderOrArchive(string.Concat(new object[]
  701. {
  702. text27,
  703. "_",
  704. text28,
  705. "_",
  706. num9
  707. }));
  708. }
  709. }
  710. }
  711. AddFolderOrArchive("parts2");
  712. Debug.Log("■■■■■■■■■■■■■■■■■■■■" + stopWatch.Stop().ToString() + " ms");
  713. }
  714. GameUty.m_FileSystem.AddAutoPathForAllFolder();
  715. if (Product.isPublic && !GameUty.m_FileSystem.IsExistentFile("21C399027026.dat"))
  716. {
  717. NDebug.MessageBox("Error", Product.type.ToString() + " : 21C399027026.dat");
  718. Application.Quit();
  719. return;
  720. }
  721. GameUty.BgFiles = new Dictionary<string, AFileSystemBase>();
  722. string[] list = GameUty.m_FileSystem.GetList("bg", AFileSystemBase.ListType.AllFile);
  723. if (list != null && 0 < list.Length)
  724. {
  725. foreach (string path in list)
  726. {
  727. string fileName = Path.GetFileName(path);
  728. if (!(Path.GetExtension(fileName) != ".asset_bg") && !GameUty.BgFiles.ContainsKey(fileName))
  729. {
  730. GameUty.BgFiles.Add(fileName, GameUty.m_FileSystem);
  731. }
  732. }
  733. }
  734. if (Product.supportMultiLanguage)
  735. {
  736. list = GameUty.m_FileSystem.GetList("language", AFileSystemBase.ListType.AllFile);
  737. if (list != null && 0 < list.Length)
  738. {
  739. foreach (string path2 in list)
  740. {
  741. string fileName2 = Path.GetFileName(path2);
  742. if (!(Path.GetExtension(fileName2) != ".asset_language"))
  743. {
  744. using (AFileBase afileBase = GameUty.m_FileSystem.FileOpen(fileName2))
  745. {
  746. AssetBundle assetBundle = AssetBundle.LoadFromMemory(afileBase.ReadAll());
  747. LanguageSource languageSource = UnityEngine.Object.Instantiate<LanguageSource>(assetBundle.LoadAllAssets<GameObject>()[0].GetComponent<LanguageSource>());
  748. if (GameMain.Instance.transform.Find("Language") == null)
  749. {
  750. new GameObject("Language").transform.SetParent(GameMain.Instance.transform);
  751. }
  752. languageSource.transform.SetParent(GameMain.Instance.transform.Find("Language"));
  753. assetBundle.Unload(true);
  754. }
  755. }
  756. }
  757. }
  758. foreach (LanguageSource languageSource2 in LocalizationManager.Sources)
  759. {
  760. languageSource2.LoadAllLanguages(false);
  761. }
  762. }
  763. if (Directory.Exists(text + "Mod"))
  764. {
  765. GameUty.m_ModFileSystem = new FileSystemWindows();
  766. GameUty.m_ModFileSystem.SetBaseDirectory(text);
  767. GameUty.m_ModFileSystem.AddFolder("Mod");
  768. string[] list2 = GameUty.m_ModFileSystem.GetList(string.Empty, AFileSystemBase.ListType.AllFolder);
  769. foreach (string text29 in list2)
  770. {
  771. if (!GameUty.m_ModFileSystem.AddAutoPath(text29))
  772. {
  773. Debug.Log("m_ModFileSystemのAddAutoPathには既に " + text29 + " がありました。");
  774. }
  775. }
  776. }
  777. string[] fileListAtExtension = GameUty.m_FileSystem.GetFileListAtExtension(".menu");
  778. List<string> list3 = new List<string>();
  779. foreach (string path3 in fileListAtExtension)
  780. {
  781. list3.Add(Path.GetFileName(path3));
  782. }
  783. GameUty.m_aryMenuFiles = list3.ToArray();
  784. if (GameUty.m_ModFileSystem != null)
  785. {
  786. string[] list4 = GameUty.m_ModFileSystem.GetList(string.Empty, AFileSystemBase.ListType.AllFile);
  787. GameUty.m_aryModOnlysMenuFiles = Array.FindAll<string>(list4, (string i) => new Regex(".*\\.menu$").IsMatch(i));
  788. GameUty.m_aryMenuFiles = GameUty.m_aryMenuFiles.Concat(GameUty.m_aryModOnlysMenuFiles).ToArray<string>();
  789. }
  790. if (GameUty.m_aryModOnlysMenuFiles != null && GameUty.m_aryModOnlysMenuFiles.Length != 0)
  791. {
  792. GameUty.ModPriorityToModFolderInfo = string.Empty;
  793. Debug.Log(GameUty.ModPriorityToModFolderInfo + "■MOD有り。MODフォルダ優先モード" + GameUty.ModPriorityToModFolder.ToString());
  794. }
  795. if (GameUty.rid_menu_dic_.Count == 0)
  796. {
  797. string[] menuFiles = GameUty.MenuFiles;
  798. GameUty.rid_menu_dic_ = new Dictionary<int, string>();
  799. for (int num14 = 0; num14 < menuFiles.Length; num14++)
  800. {
  801. string fileName3 = Path.GetFileName(menuFiles[num14]);
  802. int hashCode = fileName3.ToLower().GetHashCode();
  803. if (!GameUty.rid_menu_dic_.ContainsKey(hashCode))
  804. {
  805. GameUty.rid_menu_dic_.Add(hashCode, fileName3);
  806. }
  807. else
  808. {
  809. NDebug.Assert(fileName3 == GameUty.rid_menu_dic_[hashCode], string.Concat(new string[]
  810. {
  811. "[",
  812. fileName3,
  813. "]と[",
  814. GameUty.rid_menu_dic_[hashCode],
  815. "]は同じハッシュキーです"
  816. }));
  817. }
  818. }
  819. }
  820. }
  821. public static void UpdateFileSystemPathToNewProduct()
  822. {
  823. string text = UTY.gameProjectPath + "\\";
  824. string gameDataPath = "GameData";
  825. string str = string.Empty;
  826. str = "必用アーカイブがありません。GameData" + Product.gameDataPath + "\\";
  827. int check_ver_no = 3;
  828. Func<string, bool> AddFolderOrArchive = delegate(string name)
  829. {
  830. string gameDataPath = gameDataPath;
  831. bool flag2 = GameUty.m_FileSystem.AddArchive(gameDataPath + "\\" + name + ".arc");
  832. if (flag2)
  833. {
  834. Debug.Log(string.Concat(new string[]
  835. {
  836. "[",
  837. gameDataPath,
  838. "\\",
  839. name,
  840. ".arc]を読み込みました"
  841. }));
  842. }
  843. if (flag2)
  844. {
  845. GameUty.loadArchiveList.Add(name.ToLower());
  846. }
  847. return flag2;
  848. };
  849. Action<string> action = delegate(string name)
  850. {
  851. foreach (string text28 in GameUty.PathList)
  852. {
  853. string arg5 = name + "_" + text28;
  854. bool flag2 = AddFolderOrArchive(arg5);
  855. if (flag2)
  856. {
  857. if (name == "csv")
  858. {
  859. GameUty.ExistCsvPathList.Add(text28);
  860. }
  861. for (int num10 = 2; num10 <= check_ver_no; num10++)
  862. {
  863. AddFolderOrArchive(string.Concat(new object[]
  864. {
  865. name,
  866. "_",
  867. text28,
  868. "_",
  869. num10
  870. }));
  871. }
  872. }
  873. }
  874. };
  875. Action<string> action2 = delegate(string name)
  876. {
  877. foreach (string text28 in GameUty.PathList)
  878. {
  879. if (AddFolderOrArchive(name + "_" + text28))
  880. {
  881. if (name == "csv")
  882. {
  883. GameUty.ExistCsvPathList.Add(text28);
  884. }
  885. for (int num10 = 2; num10 <= check_ver_no; num10++)
  886. {
  887. AddFolderOrArchive(string.Concat(new object[]
  888. {
  889. name,
  890. "_",
  891. text28,
  892. "_",
  893. num10
  894. }));
  895. }
  896. }
  897. }
  898. };
  899. StopWatch stopWatch = new StopWatch();
  900. Debug.Log("■■■■■■■■ Archive Log[2.1 Compatibility] (GameData_20) ■■■■■■■■");
  901. gameDataPath = "GameData_20";
  902. GameUty.m_FileSystem.SetBaseDirectory(text);
  903. GameUty.PathList = GameUty.ReadAutoPathFile("[2.1Compatibility]", text + gameDataPath + "\\paths.dat");
  904. if (GameUty.PathList != null && 0 < GameUty.PathList.Count)
  905. {
  906. foreach (string text2 in GameUty.PathList)
  907. {
  908. string text3 = "material";
  909. if (text2 == "denkigai2015wTowelR")
  910. {
  911. AddFolderOrArchive(text3 + "_denkigai2015wTowel");
  912. }
  913. string arg = text3 + "_" + text2;
  914. bool flag = AddFolderOrArchive(arg);
  915. if (flag)
  916. {
  917. for (int i = 2; i <= check_ver_no; i++)
  918. {
  919. AddFolderOrArchive(string.Concat(new object[]
  920. {
  921. text3,
  922. "_",
  923. text2,
  924. "_",
  925. i
  926. }));
  927. }
  928. }
  929. }
  930. action("menu");
  931. action("model");
  932. action("texture");
  933. AddFolderOrArchive("prioritymaterial");
  934. List<string> pathList = GameUty.PathList;
  935. GameUty.PathList = new List<string>();
  936. GameUty.PathList.Add("vp001");
  937. action("bg");
  938. action("motion");
  939. GameUty.PathList = pathList;
  940. }
  941. Debug.Log("■■■■■■■■■■■■■■■■■■■■");
  942. Debug.Log("■■■■■■■■ Archive Log[2.1] (GameData) ■■■■■■■■");
  943. gameDataPath = "GameData";
  944. GameUty.PathList = GameUty.ReadAutoPathFile("[2.1]", text + gameDataPath + "\\paths.dat");
  945. if (GameUty.PathList == null)
  946. {
  947. GameUty.PathList = new List<string>();
  948. NDebug.Assert("paths.datを読み込めませんでした", false);
  949. }
  950. GameUty.PathList.Add(Product.gameDataPath.Replace("_", string.Empty));
  951. AddFolderOrArchive("csv");
  952. foreach (string text4 in GameUty.PathList)
  953. {
  954. string text5 = "csv";
  955. if (AddFolderOrArchive(text5 + "_" + text4))
  956. {
  957. for (int j = 2; j <= check_ver_no; j++)
  958. {
  959. AddFolderOrArchive(string.Concat(new object[]
  960. {
  961. text5,
  962. "_",
  963. text4,
  964. "_",
  965. j
  966. }));
  967. }
  968. }
  969. }
  970. AddFolderOrArchive("prioritymaterial");
  971. NDebug.Assert(AddFolderOrArchive("motion"), str + "motion");
  972. foreach (string text6 in GameUty.PathList)
  973. {
  974. string text7 = "motion";
  975. if (AddFolderOrArchive(text7 + "_" + text6))
  976. {
  977. for (int k = 2; k <= check_ver_no; k++)
  978. {
  979. AddFolderOrArchive(string.Concat(new object[]
  980. {
  981. text7,
  982. "_",
  983. text6,
  984. "_",
  985. k
  986. }));
  987. }
  988. }
  989. }
  990. AddFolderOrArchive("motion2");
  991. NDebug.Assert(AddFolderOrArchive("script"), str + "script");
  992. foreach (string text8 in GameUty.PathList)
  993. {
  994. string text9 = "script";
  995. if (AddFolderOrArchive(text9 + "_" + text8))
  996. {
  997. for (int l = 2; l <= check_ver_no; l++)
  998. {
  999. AddFolderOrArchive(string.Concat(new object[]
  1000. {
  1001. text9,
  1002. "_",
  1003. text8,
  1004. "_",
  1005. l
  1006. }));
  1007. }
  1008. }
  1009. }
  1010. AddFolderOrArchive("script_share");
  1011. foreach (string text10 in GameUty.PathList)
  1012. {
  1013. string text11 = "script_share";
  1014. if (AddFolderOrArchive(text11 + "_" + text10))
  1015. {
  1016. for (int m = 2; m <= check_ver_no; m++)
  1017. {
  1018. AddFolderOrArchive(string.Concat(new object[]
  1019. {
  1020. text11,
  1021. "_",
  1022. text10,
  1023. "_",
  1024. m
  1025. }));
  1026. }
  1027. }
  1028. }
  1029. AddFolderOrArchive("script_share2");
  1030. NDebug.Assert(AddFolderOrArchive("sound"), str + "sound");
  1031. foreach (string text12 in GameUty.PathList)
  1032. {
  1033. string text13 = "sound";
  1034. if (AddFolderOrArchive(text13 + "_" + text12))
  1035. {
  1036. for (int n = 2; n <= check_ver_no; n++)
  1037. {
  1038. AddFolderOrArchive(string.Concat(new object[]
  1039. {
  1040. text13,
  1041. "_",
  1042. text12,
  1043. "_",
  1044. n
  1045. }));
  1046. }
  1047. }
  1048. }
  1049. AddFolderOrArchive("sound2");
  1050. NDebug.Assert(AddFolderOrArchive("system"), str + "system");
  1051. foreach (string text14 in GameUty.PathList)
  1052. {
  1053. string text15 = "system";
  1054. if (AddFolderOrArchive(text15 + "_" + text14))
  1055. {
  1056. for (int num = 2; num <= check_ver_no; num++)
  1057. {
  1058. AddFolderOrArchive(string.Concat(new object[]
  1059. {
  1060. text15,
  1061. "_",
  1062. text14,
  1063. "_",
  1064. num
  1065. }));
  1066. }
  1067. }
  1068. }
  1069. AddFolderOrArchive("system2");
  1070. AddFolderOrArchive("language");
  1071. foreach (string text16 in GameUty.PathList)
  1072. {
  1073. string text17 = "language";
  1074. if (AddFolderOrArchive(text17 + "_" + text16))
  1075. {
  1076. for (int num2 = 2; num2 <= check_ver_no; num2++)
  1077. {
  1078. AddFolderOrArchive(string.Concat(new object[]
  1079. {
  1080. text17,
  1081. "_",
  1082. text16,
  1083. "_",
  1084. num2
  1085. }));
  1086. }
  1087. }
  1088. }
  1089. foreach (string text18 in GameUty.PathList)
  1090. {
  1091. string text19 = "bg";
  1092. if (AddFolderOrArchive(text19 + "_" + text18))
  1093. {
  1094. for (int num3 = 2; num3 <= check_ver_no; num3++)
  1095. {
  1096. AddFolderOrArchive(string.Concat(new object[]
  1097. {
  1098. text19,
  1099. "_",
  1100. text18,
  1101. "_",
  1102. num3
  1103. }));
  1104. }
  1105. }
  1106. }
  1107. if (Product.isEnglish && !Product.isPublic)
  1108. {
  1109. string text20 = "bg-en";
  1110. NDebug.Assert(AddFolderOrArchive(text20), str + text20);
  1111. foreach (string text21 in GameUty.PathList)
  1112. {
  1113. if (AddFolderOrArchive(text20 + "_" + text21))
  1114. {
  1115. for (int num4 = 2; num4 <= check_ver_no; num4++)
  1116. {
  1117. AddFolderOrArchive(string.Concat(new object[]
  1118. {
  1119. text20,
  1120. "_",
  1121. text21,
  1122. "_",
  1123. num4
  1124. }));
  1125. }
  1126. }
  1127. }
  1128. AddFolderOrArchive("bg-en2");
  1129. }
  1130. AddFolderOrArchive("voice");
  1131. for (int num5 = 0; num5 < 25; num5++)
  1132. {
  1133. string arg2 = "voice";
  1134. string arg3 = arg2 + "_" + (char)(97 + num5);
  1135. AddFolderOrArchive(arg3);
  1136. }
  1137. foreach (string text22 in GameUty.PathList)
  1138. {
  1139. string text23 = "voice";
  1140. if (AddFolderOrArchive(text23 + "_" + text22))
  1141. {
  1142. for (int num6 = 2; num6 <= check_ver_no; num6++)
  1143. {
  1144. AddFolderOrArchive(string.Concat(new object[]
  1145. {
  1146. text23,
  1147. "_",
  1148. text22,
  1149. "_",
  1150. num6
  1151. }));
  1152. }
  1153. }
  1154. }
  1155. for (int num7 = 2; num7 <= check_ver_no; num7++)
  1156. {
  1157. string arg4 = "voice";
  1158. AddFolderOrArchive(arg4 + num7);
  1159. }
  1160. string text24 = "parts";
  1161. NDebug.Assert(AddFolderOrArchive(text24), str + text24);
  1162. foreach (string text25 in GameUty.PathList)
  1163. {
  1164. if (AddFolderOrArchive(text24 + "_" + text25))
  1165. {
  1166. for (int num8 = 2; num8 <= check_ver_no; num8++)
  1167. {
  1168. AddFolderOrArchive(string.Concat(new object[]
  1169. {
  1170. text24,
  1171. "_",
  1172. text25,
  1173. "_",
  1174. num8
  1175. }));
  1176. }
  1177. }
  1178. }
  1179. AddFolderOrArchive("parts2");
  1180. if (Product.isEnglish && !Product.isPublic)
  1181. {
  1182. string text26 = "parts-en";
  1183. NDebug.Assert(AddFolderOrArchive(text26), str + text26);
  1184. foreach (string text27 in GameUty.PathList)
  1185. {
  1186. if (AddFolderOrArchive(text26 + "_" + text27))
  1187. {
  1188. for (int num9 = 2; num9 <= check_ver_no; num9++)
  1189. {
  1190. AddFolderOrArchive(string.Concat(new object[]
  1191. {
  1192. text26,
  1193. "_",
  1194. text27,
  1195. "_",
  1196. num9
  1197. }));
  1198. }
  1199. }
  1200. }
  1201. AddFolderOrArchive("parts-en2");
  1202. }
  1203. Debug.Log("■■■■■■■■■■■■■■■■■■■■" + stopWatch.Stop().ToString() + " ms");
  1204. }
  1205. public static void UpdateFileSystemPathOld()
  1206. {
  1207. if (!GameUty.IsEnabledCompatibilityMode)
  1208. {
  1209. return;
  1210. }
  1211. FileSystemArchive fileSystem = GameUty.m_FileSystemOld;
  1212. Debug.Log("■■■■■■■■ Archive Log[Legacy]■■■■■■■■");
  1213. Func<string, bool> AddFolderOrArchive = delegate(string name)
  1214. {
  1215. bool flag = fileSystem.AddArchive("GameData\\" + name + ".arc");
  1216. if (flag)
  1217. {
  1218. Debug.Log("[GameData\\" + name + ".arc]を読み込みました");
  1219. }
  1220. return flag;
  1221. };
  1222. int check_ver_no = 3;
  1223. Action<string> action = delegate(string name)
  1224. {
  1225. foreach (string text2 in GameUty.PathListOld)
  1226. {
  1227. if (AddFolderOrArchive(name + "_" + text2))
  1228. {
  1229. if (name == "csv")
  1230. {
  1231. GameUty.ExistCsvPathListOld.Add(text2);
  1232. }
  1233. for (int m = 2; m <= check_ver_no; m++)
  1234. {
  1235. AddFolderOrArchive(string.Concat(new object[]
  1236. {
  1237. name,
  1238. "_",
  1239. text2,
  1240. "_",
  1241. m
  1242. }));
  1243. }
  1244. }
  1245. }
  1246. };
  1247. fileSystem.SetBaseDirectory(GameMain.Instance.CMSystem.CM3D2Path);
  1248. AddFolderOrArchive("csv");
  1249. action("csv");
  1250. AddFolderOrArchive("motion");
  1251. action("motion");
  1252. AddFolderOrArchive("motion2");
  1253. AddFolderOrArchive("script");
  1254. action("script");
  1255. action("script_share");
  1256. AddFolderOrArchive("script_share2");
  1257. AddFolderOrArchive("sound");
  1258. action("sound");
  1259. AddFolderOrArchive("sound2");
  1260. AddFolderOrArchive("texture");
  1261. action("texture");
  1262. AddFolderOrArchive("texture2");
  1263. AddFolderOrArchive("texture3");
  1264. AddFolderOrArchive("system");
  1265. action("system");
  1266. action("bg");
  1267. AddFolderOrArchive("voice");
  1268. AddFolderOrArchive("voice_a");
  1269. AddFolderOrArchive("voice_b");
  1270. AddFolderOrArchive("voice_c");
  1271. foreach (string str in GameUty.PathListOld)
  1272. {
  1273. string str2 = "voice";
  1274. string text = str2 + "_" + str;
  1275. if (AddFolderOrArchive(text))
  1276. {
  1277. for (int i = 2; i <= check_ver_no; i++)
  1278. {
  1279. AddFolderOrArchive(text + "_" + i);
  1280. }
  1281. }
  1282. text = str2 + "_" + str + "a";
  1283. if (AddFolderOrArchive(text))
  1284. {
  1285. for (int j = 2; j <= check_ver_no; j++)
  1286. {
  1287. AddFolderOrArchive(text + "_" + j);
  1288. }
  1289. }
  1290. text = str2 + "_" + str + "b";
  1291. if (AddFolderOrArchive(text))
  1292. {
  1293. for (int k = 2; k <= check_ver_no; k++)
  1294. {
  1295. AddFolderOrArchive(text + "_" + k);
  1296. }
  1297. }
  1298. }
  1299. AddFolderOrArchive("voice2");
  1300. AddFolderOrArchive("voice3");
  1301. fileSystem.AddAutoPathForAllFolder();
  1302. string[] list = fileSystem.GetList("bg", AFileSystemBase.ListType.AllFile);
  1303. if (list != null && 0 < list.Length)
  1304. {
  1305. foreach (string path in list)
  1306. {
  1307. string fileName = Path.GetFileName(path);
  1308. if (!(Path.GetExtension(fileName) != ".asset_bg") && !GameUty.BgFiles.ContainsKey(fileName))
  1309. {
  1310. GameUty.BgFiles.Add(fileName, fileSystem);
  1311. }
  1312. }
  1313. }
  1314. Debug.Log("■■■■■■■■■■■■■■■■■■■■");
  1315. }
  1316. public static AFileBase FileOpen(string fileName, AFileSystemBase priorityFileSystem = null)
  1317. {
  1318. if (priorityFileSystem == null)
  1319. {
  1320. priorityFileSystem = GameUty.m_FileSystem;
  1321. }
  1322. AFileSystemBase[] array;
  1323. if (GameUty.ModPriorityToModFolder)
  1324. {
  1325. array = new AFileSystemBase[]
  1326. {
  1327. GameUty.m_ModFileSystem,
  1328. priorityFileSystem
  1329. };
  1330. }
  1331. else
  1332. {
  1333. array = new AFileSystemBase[]
  1334. {
  1335. priorityFileSystem,
  1336. GameUty.m_ModFileSystem
  1337. };
  1338. }
  1339. AFileBase result = null;
  1340. foreach (AFileSystemBase afileSystemBase in array)
  1341. {
  1342. if (afileSystemBase != null && afileSystemBase.IsExistentFile(fileName))
  1343. {
  1344. result = afileSystemBase.FileOpen(fileName);
  1345. break;
  1346. }
  1347. }
  1348. return result;
  1349. }
  1350. public static bool IsExistFile(string fileName, AFileSystemBase priorityFileSystem = null)
  1351. {
  1352. if (priorityFileSystem == null)
  1353. {
  1354. priorityFileSystem = GameUty.m_FileSystem;
  1355. }
  1356. AFileSystemBase[] array;
  1357. if (GameUty.ModPriorityToModFolder)
  1358. {
  1359. array = new AFileSystemBase[]
  1360. {
  1361. GameUty.m_ModFileSystem,
  1362. priorityFileSystem
  1363. };
  1364. }
  1365. else
  1366. {
  1367. array = new AFileSystemBase[]
  1368. {
  1369. priorityFileSystem,
  1370. GameUty.m_ModFileSystem
  1371. };
  1372. }
  1373. foreach (AFileSystemBase afileSystemBase in array)
  1374. {
  1375. if (afileSystemBase != null && afileSystemBase.IsExistentFile(fileName))
  1376. {
  1377. return true;
  1378. }
  1379. }
  1380. return false;
  1381. }
  1382. public static string GetBuildVersionText()
  1383. {
  1384. int num = 1440;
  1385. return (num >= 1000) ? ((float)num / 1000f).ToString("F2") : ((float)num / 100f).ToString("F2");
  1386. }
  1387. public static string GetGameVersionText()
  1388. {
  1389. string text = "COM3D2x64.exe";
  1390. int num = 1440;
  1391. string path = UTY.gameProjectPath + "\\update.lst";
  1392. string[] array = new string[0];
  1393. if (File.Exists(path))
  1394. {
  1395. try
  1396. {
  1397. array = File.ReadAllLines(path, Encoding.GetEncoding("utf-8"));
  1398. }
  1399. catch (Exception ex)
  1400. {
  1401. Debug.LogError(ex.Message);
  1402. array = new string[0];
  1403. }
  1404. }
  1405. foreach (string text2 in array)
  1406. {
  1407. if (!string.IsNullOrEmpty(text2))
  1408. {
  1409. string[] array3 = text2.Split(new char[]
  1410. {
  1411. ','
  1412. });
  1413. if (array3 != null && array3.Length == 2 && array3[0].Trim().ToLower() == text.ToLower())
  1414. {
  1415. int.TryParse(array3[1].Trim(), out num);
  1416. break;
  1417. }
  1418. }
  1419. }
  1420. string text3 = (num >= 1000) ? ((float)num / 1000f).ToString("F3") : ((float)num / 100f).ToString("F3");
  1421. if (text3.Length == 5)
  1422. {
  1423. text3 = text3.Insert(4, ".");
  1424. }
  1425. return text3;
  1426. }
  1427. public static string GetLegacyGameVersionText()
  1428. {
  1429. if (!GameUty.IsEnabledCompatibilityMode)
  1430. {
  1431. return "0.0";
  1432. }
  1433. string text = "CM3D2x64.exe";
  1434. string path = GameMain.Instance.CMSystem.CM3D2Path + "\\update.lst";
  1435. string[] array = new string[0];
  1436. if (File.Exists(path))
  1437. {
  1438. try
  1439. {
  1440. array = File.ReadAllLines(path, Encoding.GetEncoding("utf-8"));
  1441. }
  1442. catch (Exception ex)
  1443. {
  1444. Debug.LogError(ex.Message);
  1445. array = new string[0];
  1446. }
  1447. }
  1448. int num = 0;
  1449. foreach (string text2 in array)
  1450. {
  1451. if (!string.IsNullOrEmpty(text2))
  1452. {
  1453. string[] array3 = text2.Split(new char[]
  1454. {
  1455. ','
  1456. });
  1457. if (array3 != null && array3.Length == 2 && array3 != null && array3.Length == 2 && array3[0].Trim().ToLower() == text.ToLower())
  1458. {
  1459. int.TryParse(array3[1].Trim(), out num);
  1460. break;
  1461. }
  1462. }
  1463. }
  1464. string text3 = (num >= 1000) ? ((float)num / 1000f).ToString("F3") : ((float)num / 100f).ToString("F3");
  1465. if (text3.Length == 5)
  1466. {
  1467. text3 = text3.Insert(4, ".");
  1468. }
  1469. return text3;
  1470. }
  1471. private static FileSystemArchive m_FileSystem = null;
  1472. private static FileSystemArchive m_FileSystemOld = null;
  1473. private static FileSystemWindows m_ModFileSystem = null;
  1474. public static List<string> PathList = new List<string>();
  1475. public static List<string> ExistCsvPathList = new List<string>();
  1476. public static List<string> PathListOld = new List<string>();
  1477. public static List<string> ExistCsvPathListOld = new List<string>();
  1478. private static string[] m_aryMenuFiles = null;
  1479. private static string[] m_aryModOnlysMenuFiles = new string[0];
  1480. private static Dictionary<int, string> rid_menu_dic_ = new Dictionary<int, string>();
  1481. private static Dictionary<string, AssetBundle> asset_bundle_dic = new Dictionary<string, AssetBundle>();
  1482. private static string ModPriorityToModFolderInfo = "以下のフラグをtrueにするとMODフォルダのファイルが優先されるが、モザイクも安易に外すことが可能になる為に現在はオミット。";
  1483. public static bool ModPriorityToModFolder = false;
  1484. private static string[] m_strSystemMaterialName = new string[]
  1485. {
  1486. "System/Material/2dAlpha",
  1487. "System/Material/2dMultiply",
  1488. "System/Material/InfinityColor",
  1489. "System/Material/TexTo8bitTex"
  1490. };
  1491. private static Material[] m_matSystem = new Material[4];
  1492. public enum SystemMaterial
  1493. {
  1494. Alpha,
  1495. Multiply,
  1496. InfinityColor,
  1497. TexTo8bitTex,
  1498. Max
  1499. }
  1500. }