GameUty.cs 37 KB

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