GameUty.cs 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515
  1. using System;
  2. using System.Collections.Generic;
  3. using System.IO;
  4. using System.Text;
  5. using System.Text.RegularExpressions;
  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 num13 = 2; num13 <= check_ver_no; num13++)
  293. {
  294. AddFolderOrArchive(text31 + "_" + num13);
  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 num13 = 2; num13 <= check_ver_no; num13++)
  316. {
  317. AddFolderOrArchive(string.Concat(new object[]
  318. {
  319. name,
  320. "_",
  321. text30,
  322. "_",
  323. num13
  324. }));
  325. }
  326. }
  327. }
  328. };
  329. Action<string> action3 = delegate(string name)
  330. {
  331. foreach (string text30 in GameUty.PathList)
  332. {
  333. if (AddFolderOrArchive(name + "_" + text30))
  334. {
  335. if (name == "csv")
  336. {
  337. GameUty.ExistCsvPathList.Add(text30);
  338. }
  339. for (int num13 = 2; num13 <= check_ver_no; num13++)
  340. {
  341. AddFolderOrArchive(string.Concat(new object[]
  342. {
  343. name,
  344. "_",
  345. text30,
  346. "_",
  347. num13
  348. }));
  349. }
  350. }
  351. }
  352. };
  353. string str = string.Empty;
  354. str = "必用アーカイブがありません。GameData\\";
  355. GameUty.m_FileSystem.SetBaseDirectory(text);
  356. AddFolderOrArchive("product");
  357. Product.Initialize(GameUty.m_FileSystem);
  358. Debug.Log("IsEnabledCompatibilityMode:" + GameUty.IsEnabledCompatibilityMode.ToString());
  359. string gameTitle = Product.gameTitle;
  360. string str2 = "カスタムメイド3D 2";
  361. Debug.Log(string.Concat(new string[]
  362. {
  363. gameTitle,
  364. " GameVersion ",
  365. GameUty.GetGameVersionText(),
  366. "(BuildVersion : ",
  367. GameUty.GetBuildVersionText(),
  368. ")"
  369. }));
  370. if (!string.IsNullOrEmpty(GameMain.Instance.CMSystem.CM3D2Path))
  371. {
  372. Debug.Log(str2 + " GameVersion " + GameUty.GetLegacyGameVersionText());
  373. }
  374. if (Product.type != Product.Type.JpAdult)
  375. {
  376. GameUty.UpdateFileSystemPathToNewProduct();
  377. }
  378. else
  379. {
  380. StopWatch stopWatch = new StopWatch();
  381. if (GameUty.IsEnabledCompatibilityMode)
  382. {
  383. Debug.Log("■■■■■■■■ Archive Log[2.0] (CM3D2 GameData) ■■■■■■■■");
  384. GameUty.m_FileSystem.SetBaseDirectory(GameMain.Instance.CMSystem.CM3D2Path);
  385. GameUty.PathList = GameUty.PathListOld;
  386. AddFolderOrArchive("material");
  387. foreach (string text2 in GameUty.PathListOld)
  388. {
  389. string str3 = "material";
  390. if (text2 == "denkigai2015wTowelR")
  391. {
  392. AddFolderOrArchive(str3 + "_denkigai2015wTowel");
  393. }
  394. string text3 = str3 + "_" + text2;
  395. bool flag = AddFolderOrArchive(text3);
  396. if (flag && !addedLegacyArchives.Contains(text3))
  397. {
  398. addedLegacyArchives.Add(text3);
  399. }
  400. if (flag)
  401. {
  402. for (int i2 = 2; i2 <= check_ver_no; i2++)
  403. {
  404. AddFolderOrArchive(text3 + "_" + i2);
  405. }
  406. }
  407. }
  408. AddFolderOrArchive("material2");
  409. AddFolderOrArchive("menu");
  410. action("menu");
  411. AddFolderOrArchive("menu2");
  412. AddFolderOrArchive("model");
  413. action("model");
  414. AddFolderOrArchive("model2");
  415. AddFolderOrArchive("texture");
  416. action("texture");
  417. AddFolderOrArchive("texture2");
  418. AddFolderOrArchive("texture3");
  419. AddFolderOrArchive("prioritymaterial");
  420. Debug.Log("■■■■■■■■■■■■■■■■■■■■");
  421. }
  422. Debug.Log("■■■■■■■■ Archive Log[2.1 Compatibility] (GameData_20) ■■■■■■■■");
  423. gameDataPath = "GameData_20";
  424. GameUty.m_FileSystem.SetBaseDirectory(text);
  425. if (GameUty.IsEnabledCompatibilityMode)
  426. {
  427. GameUty.m_FileSystem.AddPatchDecryptPreferredSearchDirectory(GameMain.Instance.CMSystem.CM3D2Path + "\\GameData");
  428. }
  429. GameUty.PathList = GameUty.ReadAutoPathFile("[2.1Compatibility]", text + gameDataPath + "\\paths.dat");
  430. if (GameUty.PathList != null && 0 < GameUty.PathList.Count)
  431. {
  432. foreach (string text4 in GameUty.PathList)
  433. {
  434. string text5 = "material";
  435. if (text4 == "denkigai2015wTowelR")
  436. {
  437. AddFolderOrArchive(text5 + "_denkigai2015wTowel");
  438. }
  439. string text6 = text5 + "_" + text4;
  440. bool flag2 = AddFolderOrArchive(text6);
  441. if (!flag2 && addedLegacyArchives.Contains(text6))
  442. {
  443. flag2 = true;
  444. }
  445. if (flag2)
  446. {
  447. for (int j = 2; j <= check_ver_no; j++)
  448. {
  449. AddFolderOrArchive(string.Concat(new object[]
  450. {
  451. text5,
  452. "_",
  453. text4,
  454. "_",
  455. j
  456. }));
  457. }
  458. }
  459. }
  460. action2("menu");
  461. action2("model");
  462. action2("texture");
  463. AddFolderOrArchive("prioritymaterial");
  464. List<string> pathList = GameUty.PathList;
  465. GameUty.PathList = new List<string>();
  466. GameUty.PathList.Add("vp001");
  467. action2("bg");
  468. action2("motion");
  469. GameUty.PathList = pathList;
  470. }
  471. GameUty.m_FileSystem.ClearPatchDecryptPreferredSearchDirectory();
  472. Debug.Log("■■■■■■■■■■■■■■■■■■■■");
  473. Debug.Log("■■■■■■■■ Archive Log[2.1] (GameData) ■■■■■■■■");
  474. gameDataPath = "GameData";
  475. GameUty.PathList = GameUty.ReadAutoPathFile("[2.1]", text + gameDataPath + "\\paths.dat");
  476. if (GameUty.PathList == null)
  477. {
  478. GameUty.PathList = new List<string>();
  479. NDebug.Assert("paths.datを読み込めませんでした", false);
  480. }
  481. GameUty.PathList.Add("jp");
  482. AddFolderOrArchive("csv");
  483. foreach (string text7 in GameUty.PathList)
  484. {
  485. string text8 = "csv";
  486. if (AddFolderOrArchive(text8 + "_" + text7))
  487. {
  488. for (int k = 2; k <= check_ver_no; k++)
  489. {
  490. AddFolderOrArchive(string.Concat(new object[]
  491. {
  492. text8,
  493. "_",
  494. text7,
  495. "_",
  496. k
  497. }));
  498. }
  499. }
  500. }
  501. AddFolderOrArchive("prioritymaterial");
  502. NDebug.Assert(AddFolderOrArchive("motion"), str + "motion");
  503. foreach (string text9 in GameUty.PathList)
  504. {
  505. string text10 = "motion";
  506. if (AddFolderOrArchive(text10 + "_" + text9))
  507. {
  508. for (int l = 2; l <= check_ver_no; l++)
  509. {
  510. AddFolderOrArchive(string.Concat(new object[]
  511. {
  512. text10,
  513. "_",
  514. text9,
  515. "_",
  516. l
  517. }));
  518. }
  519. }
  520. }
  521. AddFolderOrArchive("motion2");
  522. NDebug.Assert(AddFolderOrArchive("script"), str + "script");
  523. foreach (string text11 in GameUty.PathList)
  524. {
  525. string text12 = "script";
  526. if (AddFolderOrArchive(text12 + "_" + text11))
  527. {
  528. for (int m = 2; m <= check_ver_no; m++)
  529. {
  530. AddFolderOrArchive(string.Concat(new object[]
  531. {
  532. text12,
  533. "_",
  534. text11,
  535. "_",
  536. m
  537. }));
  538. }
  539. }
  540. }
  541. AddFolderOrArchive("script_share");
  542. foreach (string text13 in GameUty.PathList)
  543. {
  544. string text14 = "script_share";
  545. if (AddFolderOrArchive(text14 + "_" + text13))
  546. {
  547. for (int n = 2; n <= check_ver_no; n++)
  548. {
  549. AddFolderOrArchive(string.Concat(new object[]
  550. {
  551. text14,
  552. "_",
  553. text13,
  554. "_",
  555. n
  556. }));
  557. }
  558. }
  559. }
  560. AddFolderOrArchive("script_share2");
  561. NDebug.Assert(AddFolderOrArchive("sound"), str + "sound");
  562. foreach (string text15 in GameUty.PathList)
  563. {
  564. string text16 = "sound";
  565. if (AddFolderOrArchive(text16 + "_" + text15))
  566. {
  567. for (int num = 2; num <= check_ver_no; num++)
  568. {
  569. AddFolderOrArchive(string.Concat(new object[]
  570. {
  571. text16,
  572. "_",
  573. text15,
  574. "_",
  575. num
  576. }));
  577. }
  578. }
  579. }
  580. AddFolderOrArchive("sound2");
  581. NDebug.Assert(AddFolderOrArchive("system"), str + "system");
  582. foreach (string text17 in GameUty.PathList)
  583. {
  584. string text18 = "system";
  585. if (AddFolderOrArchive(text18 + "_" + text17))
  586. {
  587. for (int num2 = 2; num2 <= check_ver_no; num2++)
  588. {
  589. AddFolderOrArchive(string.Concat(new object[]
  590. {
  591. text18,
  592. "_",
  593. text17,
  594. "_",
  595. num2
  596. }));
  597. }
  598. }
  599. }
  600. AddFolderOrArchive("system2");
  601. AddFolderOrArchive("language");
  602. foreach (string text19 in GameUty.PathList)
  603. {
  604. string text20 = "language";
  605. if (AddFolderOrArchive(text20 + "_" + text19))
  606. {
  607. for (int num3 = 2; num3 <= check_ver_no; num3++)
  608. {
  609. AddFolderOrArchive(string.Concat(new object[]
  610. {
  611. text20,
  612. "_",
  613. text19,
  614. "_",
  615. num3
  616. }));
  617. }
  618. }
  619. }
  620. foreach (string text21 in GameUty.PathList)
  621. {
  622. string text22 = "bg";
  623. if (AddFolderOrArchive(text22 + "_" + text21))
  624. {
  625. for (int num4 = 2; num4 <= check_ver_no; num4++)
  626. {
  627. AddFolderOrArchive(string.Concat(new object[]
  628. {
  629. text22,
  630. "_",
  631. text21,
  632. "_",
  633. num4
  634. }));
  635. }
  636. }
  637. }
  638. if (Product.isEnglish && !Product.isPublic)
  639. {
  640. string text23 = "bg-en";
  641. NDebug.Assert(AddFolderOrArchive(text23), str + text23);
  642. foreach (string text24 in GameUty.PathList)
  643. {
  644. if (AddFolderOrArchive(text23 + "_" + text24))
  645. {
  646. for (int num5 = 2; num5 <= check_ver_no; num5++)
  647. {
  648. AddFolderOrArchive(string.Concat(new object[]
  649. {
  650. text23,
  651. "_",
  652. text24,
  653. "_",
  654. num5
  655. }));
  656. }
  657. }
  658. }
  659. AddFolderOrArchive("bg-en2");
  660. }
  661. AddFolderOrArchive("voice");
  662. for (int num6 = 0; num6 < 25; num6++)
  663. {
  664. string arg = "voice";
  665. string arg2 = arg + "_" + (char)(97 + num6);
  666. AddFolderOrArchive(arg2);
  667. }
  668. foreach (string text25 in GameUty.PathList)
  669. {
  670. string text26 = "voice";
  671. if (AddFolderOrArchive(text26 + "_" + text25))
  672. {
  673. for (int num7 = 2; num7 <= check_ver_no; num7++)
  674. {
  675. AddFolderOrArchive(string.Concat(new object[]
  676. {
  677. text26,
  678. "_",
  679. text25,
  680. "_",
  681. num7
  682. }));
  683. }
  684. }
  685. }
  686. for (int num8 = 2; num8 <= check_ver_no; num8++)
  687. {
  688. string arg3 = "voice";
  689. AddFolderOrArchive(arg3 + num8);
  690. }
  691. string text27 = "parts";
  692. NDebug.Assert(AddFolderOrArchive(text27), str + text27);
  693. foreach (string text28 in GameUty.PathList)
  694. {
  695. if (AddFolderOrArchive(text27 + "_" + text28))
  696. {
  697. for (int num9 = 2; num9 <= check_ver_no; num9++)
  698. {
  699. AddFolderOrArchive(string.Concat(new object[]
  700. {
  701. text27,
  702. "_",
  703. text28,
  704. "_",
  705. num9
  706. }));
  707. }
  708. }
  709. }
  710. AddFolderOrArchive("parts2");
  711. Debug.Log("■■■■■■■■■■■■■■■■■■■■" + stopWatch.Stop().ToString() + " ms");
  712. }
  713. GameUty.m_FileSystem.AddAutoPathForAllFolder(true);
  714. while (!GameUty.m_FileSystem.IsFinishedAddAutoPathJob(true))
  715. {
  716. }
  717. GameUty.m_FileSystem.ReleaseAddAutoPathJob();
  718. if (Product.isPublic && !GameUty.m_FileSystem.IsExistentFile("21C399027026.dat"))
  719. {
  720. NDebug.MessageBox("Error", Product.type.ToString() + " : 21C399027026.dat");
  721. Application.Quit();
  722. return;
  723. }
  724. GameUty.BgFiles = new Dictionary<string, AFileSystemBase>();
  725. string[] list = GameUty.m_FileSystem.GetList("bg", AFileSystemBase.ListType.AllFile);
  726. if (list != null && 0 < list.Length)
  727. {
  728. foreach (string path in list)
  729. {
  730. string fileName = Path.GetFileName(path);
  731. if (!(Path.GetExtension(fileName) != ".asset_bg") && !GameUty.BgFiles.ContainsKey(fileName))
  732. {
  733. GameUty.BgFiles.Add(fileName, GameUty.m_FileSystem);
  734. }
  735. }
  736. }
  737. if (Product.supportMultiLanguage)
  738. {
  739. list = GameUty.m_FileSystem.GetList("language", AFileSystemBase.ListType.AllFile);
  740. if (list != null && 0 < list.Length)
  741. {
  742. foreach (string path2 in list)
  743. {
  744. string fileName2 = Path.GetFileName(path2);
  745. if (!(Path.GetExtension(fileName2) != ".asset_language"))
  746. {
  747. using (AFileBase afileBase = GameUty.m_FileSystem.FileOpen(fileName2))
  748. {
  749. AssetBundle assetBundle = AssetBundle.LoadFromMemory(afileBase.ReadAll());
  750. LanguageSource languageSource = UnityEngine.Object.Instantiate<LanguageSource>(assetBundle.LoadAllAssets<GameObject>()[0].GetComponent<LanguageSource>());
  751. if (GameMain.Instance.transform.Find("Language") == null)
  752. {
  753. new GameObject("Language").transform.SetParent(GameMain.Instance.transform);
  754. }
  755. languageSource.transform.SetParent(GameMain.Instance.transform.Find("Language"));
  756. assetBundle.Unload(true);
  757. }
  758. }
  759. }
  760. }
  761. foreach (LanguageSource languageSource2 in LocalizationManager.Sources)
  762. {
  763. languageSource2.LoadAllLanguages(false);
  764. }
  765. }
  766. if (Directory.Exists(text + "Mod"))
  767. {
  768. GameUty.m_ModFileSystem = new FileSystemWindows();
  769. GameUty.m_ModFileSystem.SetBaseDirectory(text);
  770. GameUty.m_ModFileSystem.AddFolder("Mod");
  771. string[] list2 = GameUty.m_ModFileSystem.GetList(string.Empty, AFileSystemBase.ListType.AllFolder);
  772. foreach (string text29 in list2)
  773. {
  774. if (!GameUty.m_ModFileSystem.AddAutoPath(text29))
  775. {
  776. Debug.Log("m_ModFileSystemのAddAutoPathには既に " + text29 + " がありました。");
  777. }
  778. }
  779. }
  780. if (GameUty.m_ModFileSystem != null)
  781. {
  782. string[] list3 = GameUty.m_ModFileSystem.GetList(string.Empty, AFileSystemBase.ListType.AllFile);
  783. GameUty.m_aryModOnlysMenuFiles = Array.FindAll<string>(list3, (string i) => new Regex(".*\\.menu$").IsMatch(i));
  784. }
  785. if (GameUty.m_aryModOnlysMenuFiles != null && GameUty.m_aryModOnlysMenuFiles.Length != 0)
  786. {
  787. GameUty.ModPriorityToModFolderInfo = string.Empty;
  788. Debug.Log(GameUty.ModPriorityToModFolderInfo + "■MOD有り。MODフォルダ優先モード" + GameUty.ModPriorityToModFolder.ToString());
  789. }
  790. }
  791. public static void UpdateFileSystemPathToNewProduct()
  792. {
  793. string text = UTY.gameProjectPath + "\\";
  794. string gameDataPath = "GameData";
  795. string str = string.Empty;
  796. str = "必用アーカイブがありません。GameData" + Product.gameDataPath + "\\";
  797. int check_ver_no = 3;
  798. Func<string, bool> AddFolderOrArchive = delegate(string name)
  799. {
  800. string gameDataPath = gameDataPath;
  801. bool flag2 = GameUty.m_FileSystem.AddArchive(gameDataPath + "\\" + name + ".arc");
  802. if (flag2)
  803. {
  804. Debug.Log(string.Concat(new string[]
  805. {
  806. "[",
  807. gameDataPath,
  808. "\\",
  809. name,
  810. ".arc]を読み込みました"
  811. }));
  812. }
  813. if (flag2)
  814. {
  815. GameUty.loadArchiveList.Add(name.ToLower());
  816. }
  817. return flag2;
  818. };
  819. Action<string> action = delegate(string name)
  820. {
  821. foreach (string text28 in GameUty.PathList)
  822. {
  823. string arg5 = name + "_" + text28;
  824. bool flag2 = AddFolderOrArchive(arg5);
  825. if (flag2)
  826. {
  827. if (name == "csv")
  828. {
  829. GameUty.ExistCsvPathList.Add(text28);
  830. }
  831. for (int num10 = 2; num10 <= check_ver_no; num10++)
  832. {
  833. AddFolderOrArchive(string.Concat(new object[]
  834. {
  835. name,
  836. "_",
  837. text28,
  838. "_",
  839. num10
  840. }));
  841. }
  842. }
  843. }
  844. };
  845. Action<string> action2 = delegate(string name)
  846. {
  847. foreach (string text28 in GameUty.PathList)
  848. {
  849. if (AddFolderOrArchive(name + "_" + text28))
  850. {
  851. if (name == "csv")
  852. {
  853. GameUty.ExistCsvPathList.Add(text28);
  854. }
  855. for (int num10 = 2; num10 <= check_ver_no; num10++)
  856. {
  857. AddFolderOrArchive(string.Concat(new object[]
  858. {
  859. name,
  860. "_",
  861. text28,
  862. "_",
  863. num10
  864. }));
  865. }
  866. }
  867. }
  868. };
  869. StopWatch stopWatch = new StopWatch();
  870. Debug.Log("■■■■■■■■ Archive Log[2.1 Compatibility] (GameData_20) ■■■■■■■■");
  871. gameDataPath = "GameData_20";
  872. GameUty.m_FileSystem.SetBaseDirectory(text);
  873. GameUty.PathList = GameUty.ReadAutoPathFile("[2.1Compatibility]", text + gameDataPath + "\\paths.dat");
  874. if (GameUty.PathList != null && 0 < GameUty.PathList.Count)
  875. {
  876. foreach (string text2 in GameUty.PathList)
  877. {
  878. string text3 = "material";
  879. if (text2 == "denkigai2015wTowelR")
  880. {
  881. AddFolderOrArchive(text3 + "_denkigai2015wTowel");
  882. }
  883. string arg = text3 + "_" + text2;
  884. bool flag = AddFolderOrArchive(arg);
  885. if (flag)
  886. {
  887. for (int i = 2; i <= check_ver_no; i++)
  888. {
  889. AddFolderOrArchive(string.Concat(new object[]
  890. {
  891. text3,
  892. "_",
  893. text2,
  894. "_",
  895. i
  896. }));
  897. }
  898. }
  899. }
  900. action("menu");
  901. action("model");
  902. action("texture");
  903. AddFolderOrArchive("prioritymaterial");
  904. List<string> pathList = GameUty.PathList;
  905. GameUty.PathList = new List<string>();
  906. GameUty.PathList.Add("vp001");
  907. action("bg");
  908. action("motion");
  909. GameUty.PathList = pathList;
  910. }
  911. Debug.Log("■■■■■■■■■■■■■■■■■■■■");
  912. Debug.Log("■■■■■■■■ Archive Log[2.1] (GameData) ■■■■■■■■");
  913. gameDataPath = "GameData";
  914. GameUty.PathList = GameUty.ReadAutoPathFile("[2.1]", text + gameDataPath + "\\paths.dat");
  915. if (GameUty.PathList == null)
  916. {
  917. GameUty.PathList = new List<string>();
  918. NDebug.Assert("paths.datを読み込めませんでした", false);
  919. }
  920. GameUty.PathList.Add(Product.gameDataPath.Replace("_", string.Empty));
  921. AddFolderOrArchive("csv");
  922. foreach (string text4 in GameUty.PathList)
  923. {
  924. string text5 = "csv";
  925. if (AddFolderOrArchive(text5 + "_" + text4))
  926. {
  927. for (int j = 2; j <= check_ver_no; j++)
  928. {
  929. AddFolderOrArchive(string.Concat(new object[]
  930. {
  931. text5,
  932. "_",
  933. text4,
  934. "_",
  935. j
  936. }));
  937. }
  938. }
  939. }
  940. AddFolderOrArchive("prioritymaterial");
  941. NDebug.Assert(AddFolderOrArchive("motion"), str + "motion");
  942. foreach (string text6 in GameUty.PathList)
  943. {
  944. string text7 = "motion";
  945. if (AddFolderOrArchive(text7 + "_" + text6))
  946. {
  947. for (int k = 2; k <= check_ver_no; k++)
  948. {
  949. AddFolderOrArchive(string.Concat(new object[]
  950. {
  951. text7,
  952. "_",
  953. text6,
  954. "_",
  955. k
  956. }));
  957. }
  958. }
  959. }
  960. AddFolderOrArchive("motion2");
  961. NDebug.Assert(AddFolderOrArchive("script"), str + "script");
  962. foreach (string text8 in GameUty.PathList)
  963. {
  964. string text9 = "script";
  965. if (AddFolderOrArchive(text9 + "_" + text8))
  966. {
  967. for (int l = 2; l <= check_ver_no; l++)
  968. {
  969. AddFolderOrArchive(string.Concat(new object[]
  970. {
  971. text9,
  972. "_",
  973. text8,
  974. "_",
  975. l
  976. }));
  977. }
  978. }
  979. }
  980. AddFolderOrArchive("script_share");
  981. foreach (string text10 in GameUty.PathList)
  982. {
  983. string text11 = "script_share";
  984. if (AddFolderOrArchive(text11 + "_" + text10))
  985. {
  986. for (int m = 2; m <= check_ver_no; m++)
  987. {
  988. AddFolderOrArchive(string.Concat(new object[]
  989. {
  990. text11,
  991. "_",
  992. text10,
  993. "_",
  994. m
  995. }));
  996. }
  997. }
  998. }
  999. AddFolderOrArchive("script_share2");
  1000. NDebug.Assert(AddFolderOrArchive("sound"), str + "sound");
  1001. foreach (string text12 in GameUty.PathList)
  1002. {
  1003. string text13 = "sound";
  1004. if (AddFolderOrArchive(text13 + "_" + text12))
  1005. {
  1006. for (int n = 2; n <= check_ver_no; n++)
  1007. {
  1008. AddFolderOrArchive(string.Concat(new object[]
  1009. {
  1010. text13,
  1011. "_",
  1012. text12,
  1013. "_",
  1014. n
  1015. }));
  1016. }
  1017. }
  1018. }
  1019. AddFolderOrArchive("sound2");
  1020. NDebug.Assert(AddFolderOrArchive("system"), str + "system");
  1021. foreach (string text14 in GameUty.PathList)
  1022. {
  1023. string text15 = "system";
  1024. if (AddFolderOrArchive(text15 + "_" + text14))
  1025. {
  1026. for (int num = 2; num <= check_ver_no; num++)
  1027. {
  1028. AddFolderOrArchive(string.Concat(new object[]
  1029. {
  1030. text15,
  1031. "_",
  1032. text14,
  1033. "_",
  1034. num
  1035. }));
  1036. }
  1037. }
  1038. }
  1039. AddFolderOrArchive("system2");
  1040. AddFolderOrArchive("language");
  1041. foreach (string text16 in GameUty.PathList)
  1042. {
  1043. string text17 = "language";
  1044. if (AddFolderOrArchive(text17 + "_" + text16))
  1045. {
  1046. for (int num2 = 2; num2 <= check_ver_no; num2++)
  1047. {
  1048. AddFolderOrArchive(string.Concat(new object[]
  1049. {
  1050. text17,
  1051. "_",
  1052. text16,
  1053. "_",
  1054. num2
  1055. }));
  1056. }
  1057. }
  1058. }
  1059. foreach (string text18 in GameUty.PathList)
  1060. {
  1061. string text19 = "bg";
  1062. if (AddFolderOrArchive(text19 + "_" + text18))
  1063. {
  1064. for (int num3 = 2; num3 <= check_ver_no; num3++)
  1065. {
  1066. AddFolderOrArchive(string.Concat(new object[]
  1067. {
  1068. text19,
  1069. "_",
  1070. text18,
  1071. "_",
  1072. num3
  1073. }));
  1074. }
  1075. }
  1076. }
  1077. if (Product.isEnglish && !Product.isPublic)
  1078. {
  1079. string text20 = "bg-en";
  1080. NDebug.Assert(AddFolderOrArchive(text20), str + text20);
  1081. foreach (string text21 in GameUty.PathList)
  1082. {
  1083. if (AddFolderOrArchive(text20 + "_" + text21))
  1084. {
  1085. for (int num4 = 2; num4 <= check_ver_no; num4++)
  1086. {
  1087. AddFolderOrArchive(string.Concat(new object[]
  1088. {
  1089. text20,
  1090. "_",
  1091. text21,
  1092. "_",
  1093. num4
  1094. }));
  1095. }
  1096. }
  1097. }
  1098. AddFolderOrArchive("bg-en2");
  1099. }
  1100. AddFolderOrArchive("voice");
  1101. for (int num5 = 0; num5 < 25; num5++)
  1102. {
  1103. string arg2 = "voice";
  1104. string arg3 = arg2 + "_" + (char)(97 + num5);
  1105. AddFolderOrArchive(arg3);
  1106. }
  1107. foreach (string text22 in GameUty.PathList)
  1108. {
  1109. string text23 = "voice";
  1110. if (AddFolderOrArchive(text23 + "_" + text22))
  1111. {
  1112. for (int num6 = 2; num6 <= check_ver_no; num6++)
  1113. {
  1114. AddFolderOrArchive(string.Concat(new object[]
  1115. {
  1116. text23,
  1117. "_",
  1118. text22,
  1119. "_",
  1120. num6
  1121. }));
  1122. }
  1123. }
  1124. }
  1125. for (int num7 = 2; num7 <= check_ver_no; num7++)
  1126. {
  1127. string arg4 = "voice";
  1128. AddFolderOrArchive(arg4 + num7);
  1129. }
  1130. string text24 = "parts";
  1131. NDebug.Assert(AddFolderOrArchive(text24), str + text24);
  1132. foreach (string text25 in GameUty.PathList)
  1133. {
  1134. if (AddFolderOrArchive(text24 + "_" + text25))
  1135. {
  1136. for (int num8 = 2; num8 <= check_ver_no; num8++)
  1137. {
  1138. AddFolderOrArchive(string.Concat(new object[]
  1139. {
  1140. text24,
  1141. "_",
  1142. text25,
  1143. "_",
  1144. num8
  1145. }));
  1146. }
  1147. }
  1148. }
  1149. AddFolderOrArchive("parts2");
  1150. if (Product.isEnglish && !Product.isPublic)
  1151. {
  1152. string text26 = "parts-en";
  1153. NDebug.Assert(AddFolderOrArchive(text26), str + text26);
  1154. foreach (string text27 in GameUty.PathList)
  1155. {
  1156. if (AddFolderOrArchive(text26 + "_" + text27))
  1157. {
  1158. for (int num9 = 2; num9 <= check_ver_no; num9++)
  1159. {
  1160. AddFolderOrArchive(string.Concat(new object[]
  1161. {
  1162. text26,
  1163. "_",
  1164. text27,
  1165. "_",
  1166. num9
  1167. }));
  1168. }
  1169. }
  1170. }
  1171. AddFolderOrArchive("parts-en2");
  1172. }
  1173. Debug.Log("■■■■■■■■■■■■■■■■■■■■" + stopWatch.Stop().ToString() + " ms");
  1174. }
  1175. public static void UpdateFileSystemPathOld()
  1176. {
  1177. if (!GameUty.IsEnabledCompatibilityMode)
  1178. {
  1179. return;
  1180. }
  1181. FileSystemArchive fileSystem = GameUty.m_FileSystemOld;
  1182. Debug.Log("■■■■■■■■ Archive Log[Legacy]■■■■■■■■");
  1183. Func<string, bool> AddFolderOrArchive = delegate(string name)
  1184. {
  1185. bool flag = fileSystem.AddArchive("GameData\\" + name + ".arc");
  1186. if (flag)
  1187. {
  1188. Debug.Log("[GameData\\" + name + ".arc]を読み込みました");
  1189. }
  1190. return flag;
  1191. };
  1192. int check_ver_no = 3;
  1193. Action<string> action = delegate(string name)
  1194. {
  1195. foreach (string text2 in GameUty.PathListOld)
  1196. {
  1197. if (AddFolderOrArchive(name + "_" + text2))
  1198. {
  1199. if (name == "csv")
  1200. {
  1201. GameUty.ExistCsvPathListOld.Add(text2);
  1202. }
  1203. for (int m = 2; m <= check_ver_no; m++)
  1204. {
  1205. AddFolderOrArchive(string.Concat(new object[]
  1206. {
  1207. name,
  1208. "_",
  1209. text2,
  1210. "_",
  1211. m
  1212. }));
  1213. }
  1214. }
  1215. }
  1216. };
  1217. fileSystem.SetBaseDirectory(GameMain.Instance.CMSystem.CM3D2Path);
  1218. AddFolderOrArchive("csv");
  1219. action("csv");
  1220. AddFolderOrArchive("motion");
  1221. action("motion");
  1222. AddFolderOrArchive("motion2");
  1223. AddFolderOrArchive("script");
  1224. action("script");
  1225. action("script_share");
  1226. AddFolderOrArchive("script_share2");
  1227. AddFolderOrArchive("sound");
  1228. action("sound");
  1229. AddFolderOrArchive("sound2");
  1230. AddFolderOrArchive("texture");
  1231. action("texture");
  1232. AddFolderOrArchive("texture2");
  1233. AddFolderOrArchive("texture3");
  1234. AddFolderOrArchive("system");
  1235. action("system");
  1236. action("bg");
  1237. AddFolderOrArchive("voice");
  1238. AddFolderOrArchive("voice_a");
  1239. AddFolderOrArchive("voice_b");
  1240. AddFolderOrArchive("voice_c");
  1241. foreach (string str in GameUty.PathListOld)
  1242. {
  1243. string str2 = "voice";
  1244. string text = str2 + "_" + str;
  1245. if (AddFolderOrArchive(text))
  1246. {
  1247. for (int i = 2; i <= check_ver_no; i++)
  1248. {
  1249. AddFolderOrArchive(text + "_" + i);
  1250. }
  1251. }
  1252. text = str2 + "_" + str + "a";
  1253. if (AddFolderOrArchive(text))
  1254. {
  1255. for (int j = 2; j <= check_ver_no; j++)
  1256. {
  1257. AddFolderOrArchive(text + "_" + j);
  1258. }
  1259. }
  1260. text = str2 + "_" + str + "b";
  1261. if (AddFolderOrArchive(text))
  1262. {
  1263. for (int k = 2; k <= check_ver_no; k++)
  1264. {
  1265. AddFolderOrArchive(text + "_" + k);
  1266. }
  1267. }
  1268. }
  1269. AddFolderOrArchive("voice2");
  1270. AddFolderOrArchive("voice3");
  1271. fileSystem.AddAutoPathForAllFolder(true);
  1272. while (!fileSystem.IsFinishedAddAutoPathJob(true))
  1273. {
  1274. }
  1275. fileSystem.ReleaseAddAutoPathJob();
  1276. string[] list = fileSystem.GetList("bg", AFileSystemBase.ListType.AllFile);
  1277. if (list != null && 0 < list.Length)
  1278. {
  1279. foreach (string path in list)
  1280. {
  1281. string fileName = Path.GetFileName(path);
  1282. if (!(Path.GetExtension(fileName) != ".asset_bg") && !GameUty.BgFiles.ContainsKey(fileName))
  1283. {
  1284. GameUty.BgFiles.Add(fileName, fileSystem);
  1285. }
  1286. }
  1287. }
  1288. Debug.Log("■■■■■■■■■■■■■■■■■■■■");
  1289. }
  1290. public static AFileBase FileOpen(string fileName, AFileSystemBase priorityFileSystem = null)
  1291. {
  1292. if (priorityFileSystem == null)
  1293. {
  1294. priorityFileSystem = GameUty.m_FileSystem;
  1295. }
  1296. AFileSystemBase[] array;
  1297. if (GameUty.ModPriorityToModFolder)
  1298. {
  1299. array = new AFileSystemBase[]
  1300. {
  1301. GameUty.m_ModFileSystem,
  1302. priorityFileSystem
  1303. };
  1304. }
  1305. else
  1306. {
  1307. array = new AFileSystemBase[]
  1308. {
  1309. priorityFileSystem,
  1310. GameUty.m_ModFileSystem
  1311. };
  1312. }
  1313. AFileBase result = null;
  1314. foreach (AFileSystemBase afileSystemBase in array)
  1315. {
  1316. if (afileSystemBase != null && afileSystemBase.IsExistentFile(fileName))
  1317. {
  1318. result = afileSystemBase.FileOpen(fileName);
  1319. break;
  1320. }
  1321. }
  1322. return result;
  1323. }
  1324. public static bool IsExistFile(string fileName, AFileSystemBase priorityFileSystem = null)
  1325. {
  1326. if (priorityFileSystem == null)
  1327. {
  1328. priorityFileSystem = GameUty.m_FileSystem;
  1329. }
  1330. AFileSystemBase[] array;
  1331. if (GameUty.ModPriorityToModFolder)
  1332. {
  1333. array = new AFileSystemBase[]
  1334. {
  1335. GameUty.m_ModFileSystem,
  1336. priorityFileSystem
  1337. };
  1338. }
  1339. else
  1340. {
  1341. array = new AFileSystemBase[]
  1342. {
  1343. priorityFileSystem,
  1344. GameUty.m_ModFileSystem
  1345. };
  1346. }
  1347. foreach (AFileSystemBase afileSystemBase in array)
  1348. {
  1349. if (afileSystemBase != null && afileSystemBase.IsExistentFile(fileName))
  1350. {
  1351. return true;
  1352. }
  1353. }
  1354. return false;
  1355. }
  1356. public static string GetBuildVersionText()
  1357. {
  1358. int num = 1480;
  1359. return (num >= 1000) ? ((float)num / 1000f).ToString("F2") : ((float)num / 100f).ToString("F2");
  1360. }
  1361. public static string GetGameVersionText()
  1362. {
  1363. string text = "COM3D2x64.exe";
  1364. int num = 1480;
  1365. string path = UTY.gameProjectPath + "\\update.lst";
  1366. string[] array = new string[0];
  1367. if (File.Exists(path))
  1368. {
  1369. try
  1370. {
  1371. array = File.ReadAllLines(path, Encoding.GetEncoding("utf-8"));
  1372. }
  1373. catch (Exception ex)
  1374. {
  1375. Debug.LogError(ex.Message);
  1376. array = new string[0];
  1377. }
  1378. }
  1379. foreach (string text2 in array)
  1380. {
  1381. if (!string.IsNullOrEmpty(text2))
  1382. {
  1383. string[] array3 = text2.Split(new char[]
  1384. {
  1385. ','
  1386. });
  1387. if (array3 != null && array3.Length == 2 && array3[0].Trim().ToLower() == text.ToLower())
  1388. {
  1389. int.TryParse(array3[1].Trim(), out num);
  1390. break;
  1391. }
  1392. }
  1393. }
  1394. string text3 = (num >= 1000) ? ((float)num / 1000f).ToString("F3") : ((float)num / 100f).ToString("F3");
  1395. if (text3.Length == 5)
  1396. {
  1397. text3 = text3.Insert(4, ".");
  1398. }
  1399. return text3;
  1400. }
  1401. public static string GetLegacyGameVersionText()
  1402. {
  1403. if (!GameUty.IsEnabledCompatibilityMode)
  1404. {
  1405. return "0.0";
  1406. }
  1407. string text = "CM3D2x64.exe";
  1408. string path = GameMain.Instance.CMSystem.CM3D2Path + "\\update.lst";
  1409. string[] array = new string[0];
  1410. if (File.Exists(path))
  1411. {
  1412. try
  1413. {
  1414. array = File.ReadAllLines(path, Encoding.GetEncoding("utf-8"));
  1415. }
  1416. catch (Exception ex)
  1417. {
  1418. Debug.LogError(ex.Message);
  1419. array = new string[0];
  1420. }
  1421. }
  1422. int num = 0;
  1423. foreach (string text2 in array)
  1424. {
  1425. if (!string.IsNullOrEmpty(text2))
  1426. {
  1427. string[] array3 = text2.Split(new char[]
  1428. {
  1429. ','
  1430. });
  1431. if (array3 != null && array3.Length == 2 && array3 != null && array3.Length == 2 && array3[0].Trim().ToLower() == text.ToLower())
  1432. {
  1433. int.TryParse(array3[1].Trim(), out num);
  1434. break;
  1435. }
  1436. }
  1437. }
  1438. string text3 = (num >= 1000) ? ((float)num / 1000f).ToString("F3") : ((float)num / 100f).ToString("F3");
  1439. if (text3.Length == 5)
  1440. {
  1441. text3 = text3.Insert(4, ".");
  1442. }
  1443. return text3;
  1444. }
  1445. private static FileSystemArchive m_FileSystem = null;
  1446. private static FileSystemArchive m_FileSystemOld = null;
  1447. private static FileSystemWindows m_ModFileSystem = null;
  1448. public static List<string> PathList = new List<string>();
  1449. public static List<string> ExistCsvPathList = new List<string>();
  1450. public static List<string> PathListOld = new List<string>();
  1451. public static List<string> ExistCsvPathListOld = new List<string>();
  1452. private static string[] m_aryMenuFiles = null;
  1453. private static string[] m_aryModOnlysMenuFiles = new string[0];
  1454. private static Dictionary<int, string> rid_menu_dic_ = new Dictionary<int, string>();
  1455. private static Dictionary<string, AssetBundle> asset_bundle_dic = new Dictionary<string, AssetBundle>();
  1456. private static string ModPriorityToModFolderInfo = "以下のフラグをtrueにするとMODフォルダのファイルが優先されるが、モザイクも安易に外すことが可能になる為に現在はオミット。";
  1457. public static bool ModPriorityToModFolder = false;
  1458. private static string[] m_strSystemMaterialName = new string[]
  1459. {
  1460. "System/Material/2dAlpha",
  1461. "System/Material/2dMultiply",
  1462. "System/Material/InfinityColor",
  1463. "System/Material/TexTo8bitTex"
  1464. };
  1465. private static Material[] m_matSystem = new Material[4];
  1466. public enum SystemMaterial
  1467. {
  1468. Alpha,
  1469. Multiply,
  1470. InfinityColor,
  1471. TexTo8bitTex,
  1472. Max
  1473. }
  1474. }