BgMgr.cs 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718
  1. using System;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4. using System.IO;
  5. using MyRoomCustom;
  6. using UnityEngine;
  7. using UnityEngine.Rendering;
  8. public class BgMgr : MonoBehaviour
  9. {
  10. public GameObject Parent
  11. {
  12. get
  13. {
  14. return this.m_goParent;
  15. }
  16. }
  17. public GameObject BgObject
  18. {
  19. get
  20. {
  21. return this.m_goBg;
  22. }
  23. }
  24. private void Awake()
  25. {
  26. this.m_goParent = UTY.GetChildObject(base.gameObject, "BG", false);
  27. NDebug.Assert(this.m_goParent != null, "__GameMain__/BG が見つかりません");
  28. }
  29. public void OnDestroy()
  30. {
  31. foreach (KeyValuePair<string, BgMgr.AssetBundleObj> keyValuePair in this.asset_bundle_dic)
  32. {
  33. keyValuePair.Value.ab.Unload(true);
  34. }
  35. this.asset_bundle_dic.Clear();
  36. }
  37. public void ChangeBg(string f_strPrefubName)
  38. {
  39. if (!string.IsNullOrEmpty(f_strPrefubName) && 0 <= f_strPrefubName.IndexOf("?"))
  40. {
  41. f_strPrefubName = ScriptManager.ReplacePersonal(GameMain.Instance.CharacterMgr.GetMaid(0), f_strPrefubName);
  42. }
  43. base.StopCoroutine("CoWaitMovePrefabToChara");
  44. this.SetPos(Vector3.zero);
  45. this.SetRot(Vector3.zero);
  46. this.DelPrefabFromBgAll();
  47. if (this.m_goBg != null)
  48. {
  49. UnityEngine.Object.Destroy(this.m_goBg);
  50. DeskManager.OnChangeBG(string.Empty, null);
  51. this.m_goBg = null;
  52. this.SaveOvrDDPos(true);
  53. }
  54. this.m_strBGName = string.Empty;
  55. if (!string.IsNullOrEmpty(f_strPrefubName))
  56. {
  57. UnityEngine.Object @object = this.CreateAssetBundle(f_strPrefubName);
  58. if (@object == null)
  59. {
  60. @object = Resources.Load("BG/" + f_strPrefubName);
  61. if (@object == null)
  62. {
  63. @object = Resources.Load("BG/2_0/" + f_strPrefubName);
  64. }
  65. }
  66. if (@object != null)
  67. {
  68. this.m_strBGName = f_strPrefubName;
  69. this.m_goBg = (UnityEngine.Object.Instantiate(@object) as GameObject);
  70. MeshRenderer[] componentsInChildren = this.m_goBg.GetComponentsInChildren<MeshRenderer>();
  71. for (int i = 0; i < componentsInChildren.Length; i++)
  72. {
  73. if (componentsInChildren[i] != null && componentsInChildren[i].gameObject.name.ToLower().IndexOf("castshadow") < 0)
  74. {
  75. componentsInChildren[i].shadowCastingMode = ShadowCastingMode.Off;
  76. }
  77. }
  78. this.m_goBg.transform.SetParent(this.m_goParent.transform, false);
  79. if (GameMain.Instance.VRMode && Application.isPlaying && this.AddHitToBg(f_strPrefubName + "_hit") == null && this.AddPrefabToBg(f_strPrefubName + "_Hit", f_strPrefubName + "_Hit", null, Vector3.zero, Vector3.zero) == null)
  80. {
  81. this.AddPrefabToBg(f_strPrefubName + "_hit", f_strPrefubName + "_hit", null, Vector3.zero, Vector3.zero);
  82. }
  83. this.ShowOvrDD(false);
  84. DeskManager.OnChangeBG(f_strPrefubName.ToLower(), this.m_goBg);
  85. }
  86. else
  87. {
  88. Debug.LogError("BGプレハブが見つかりませんでした。BG/" + f_strPrefubName);
  89. }
  90. }
  91. Resources.UnloadUnusedAssets();
  92. }
  93. public void ChangeBgMyRoom(string guid)
  94. {
  95. base.StopCoroutine("CoWaitMovePrefabToChara");
  96. this.SetPos(Vector3.zero);
  97. this.SetRot(Vector3.zero);
  98. this.DelPrefabFromBgAll();
  99. if (this.m_goBg != null)
  100. {
  101. UnityEngine.Object.Destroy(this.m_goBg);
  102. DeskManager.OnChangeBG(string.Empty, null);
  103. this.m_goBg = null;
  104. this.SaveOvrDDPos(true);
  105. }
  106. this.m_strBGName = string.Empty;
  107. if (!string.IsNullOrEmpty(guid) && CreativeRoomManager.IsExistSaveData(guid))
  108. {
  109. this.m_strBGName = "マイルーム:" + guid;
  110. this.m_goBg = CreativeRoomManager.InstantiateRoom(guid);
  111. MeshRenderer[] componentsInChildren = this.m_goBg.GetComponentsInChildren<MeshRenderer>();
  112. for (int i = 0; i < componentsInChildren.Length; i++)
  113. {
  114. if (componentsInChildren[i] != null && componentsInChildren[i].gameObject.name.ToLower().IndexOf("castshadow") < 0)
  115. {
  116. componentsInChildren[i].shadowCastingMode = ShadowCastingMode.Off;
  117. }
  118. }
  119. this.m_goBg.transform.SetParent(this.m_goParent.transform, false);
  120. DeskManager.OnChangeBG(this.m_strBGName.ToLower(), this.m_goBg);
  121. }
  122. Resources.UnloadUnusedAssets();
  123. }
  124. public GameObject CreateAssetBundle(string name)
  125. {
  126. if (string.IsNullOrEmpty(name))
  127. {
  128. return null;
  129. }
  130. name = name.ToLower();
  131. bool flag = false;
  132. string text = string.Empty;
  133. AFileSystemBase afileSystemBase = null;
  134. if (GameUty.BgFiles.ContainsKey(name + ".asset_bg"))
  135. {
  136. flag = true;
  137. text = name + ".asset_bg";
  138. afileSystemBase = GameUty.BgFiles[name + ".asset_bg"];
  139. }
  140. UnityEngine.Object @object = null;
  141. if (flag && !string.IsNullOrEmpty(text))
  142. {
  143. if (!this.asset_bundle_dic.ContainsKey(text))
  144. {
  145. using (AFileBase afileBase = afileSystemBase.FileOpen(text))
  146. {
  147. byte[] binary = afileBase.ReadAll();
  148. AssetBundle assetBundle = AssetBundle.LoadFromMemory(binary);
  149. BgMgr.AssetBundleObj value = default(BgMgr.AssetBundleObj);
  150. if (assetBundle.mainAsset != null)
  151. {
  152. value.obj = assetBundle.mainAsset;
  153. }
  154. else
  155. {
  156. value.obj = assetBundle.LoadAllAssets<GameObject>()[0];
  157. }
  158. value.ab = assetBundle;
  159. this.asset_bundle_dic.Add(text, value);
  160. @object = value.obj;
  161. string f_strFileName = name + ".asset_bg_shader";
  162. AFileSystemBase afileSystemBase2 = null;
  163. if (GameUty.FileSystem.IsExistentFile(f_strFileName))
  164. {
  165. afileSystemBase2 = GameUty.FileSystem;
  166. }
  167. else if (GameUty.FileSystemOld.IsExistentFile(f_strFileName))
  168. {
  169. afileSystemBase2 = GameUty.FileSystemOld;
  170. }
  171. if (afileSystemBase2 != null)
  172. {
  173. byte[] array = null;
  174. using (AFileBase afileBase2 = afileSystemBase2.FileOpen(f_strFileName))
  175. {
  176. array = afileBase2.ReadAll();
  177. }
  178. if (array != null)
  179. {
  180. this.LoadAssetBgShaderData(@object as GameObject, array);
  181. }
  182. }
  183. }
  184. }
  185. else
  186. {
  187. @object = this.asset_bundle_dic[text].obj;
  188. }
  189. }
  190. return (!(@object == null)) ? (@object as GameObject) : null;
  191. }
  192. private void LoadAssetBgShaderData(GameObject bgObject, byte[] binary)
  193. {
  194. if (binary == null || binary.Length <= 0)
  195. {
  196. return;
  197. }
  198. using (MemoryStream memoryStream = new MemoryStream(binary))
  199. {
  200. using (BinaryReader binaryReader = new BinaryReader(memoryStream))
  201. {
  202. int num = binaryReader.ReadInt32();
  203. List<Shader> list = new List<Shader>();
  204. Dictionary<string, List<int>> dictionary = new Dictionary<string, List<int>>();
  205. int num2 = (int)binaryReader.ReadInt16();
  206. for (int i = 0; i < num2; i++)
  207. {
  208. string text = binaryReader.ReadString();
  209. Shader shader = Shader.Find(text);
  210. if (shader == null)
  211. {
  212. Debug.LogError("shader名[" + text + "]からshaderを特定できませんでした");
  213. }
  214. else
  215. {
  216. list.Add(shader);
  217. }
  218. }
  219. num2 = (int)binaryReader.ReadInt16();
  220. for (int j = 0; j < num2; j++)
  221. {
  222. string key = binaryReader.ReadString();
  223. List<int> list2 = new List<int>();
  224. int num3 = (int)binaryReader.ReadInt16();
  225. for (int k = 0; k < num3; k++)
  226. {
  227. list2.Add(binaryReader.ReadInt32());
  228. }
  229. dictionary.Add(key, list2);
  230. }
  231. Renderer[] componentsInChildren = bgObject.GetComponentsInChildren<Renderer>(true);
  232. foreach (Renderer renderer in componentsInChildren)
  233. {
  234. List<int> list3 = dictionary[renderer.gameObject.name];
  235. int num4 = 0;
  236. foreach (Material material in renderer.sharedMaterials)
  237. {
  238. if (!(material == null))
  239. {
  240. int index = list3[num4];
  241. material.shader = list[index];
  242. num4++;
  243. }
  244. }
  245. }
  246. }
  247. }
  248. }
  249. public void SetPos(Vector3 f_vWorldPos)
  250. {
  251. this.m_goParent.transform.position = f_vWorldPos;
  252. }
  253. public void SetRot(Vector3 f_vWorldRot)
  254. {
  255. this.m_goParent.transform.rotation = Quaternion.Euler(f_vWorldRot);
  256. }
  257. public void DeleteBg()
  258. {
  259. this.ChangeBg(null);
  260. }
  261. public string GetBGName()
  262. {
  263. return this.m_strBGName;
  264. }
  265. public GameObject AddHitToBg(string f_strSrc)
  266. {
  267. UnityEngine.Object @object = Resources.Load("BG_Hit/" + f_strSrc);
  268. if (@object == null)
  269. {
  270. @object = this.CreateAssetBundle(f_strSrc);
  271. }
  272. if (@object == null)
  273. {
  274. return null;
  275. }
  276. GameObject gameObject = UnityEngine.Object.Instantiate(@object) as GameObject;
  277. gameObject.name = f_strSrc;
  278. if (this.m_goBg != null)
  279. {
  280. gameObject.transform.SetParent(this.m_goBg.transform, false);
  281. }
  282. else
  283. {
  284. gameObject.transform.SetParent(this.m_goParent.transform, false);
  285. }
  286. return gameObject;
  287. }
  288. public GameObject AddPrefabToBg(string f_strSrc, string f_strName, string f_strDest, Vector3 f_vPos, Vector3 f_vRot)
  289. {
  290. GameObject gameObject = null;
  291. Func<string, string, GameObject> func = delegate(string src, string name)
  292. {
  293. GameObject gameObject3 = null;
  294. if (!this.m_dicAttachObj.TryGetValue(name, out gameObject3))
  295. {
  296. UnityEngine.Object @object = Resources.Load("Prefab/" + src);
  297. if (@object == null)
  298. {
  299. @object = this.CreateAssetBundle(src);
  300. }
  301. if (@object == null)
  302. {
  303. return null;
  304. }
  305. gameObject3 = (UnityEngine.Object.Instantiate(@object) as GameObject);
  306. gameObject3.name = name;
  307. this.m_dicAttachObj.Add(name, gameObject3);
  308. }
  309. return gameObject3;
  310. };
  311. if (Product.isEnglish && !Product.isPublic)
  312. {
  313. gameObject = func(f_strSrc + "_en", f_strName);
  314. }
  315. if (gameObject == null)
  316. {
  317. gameObject = func(f_strSrc, f_strName);
  318. if (gameObject == null)
  319. {
  320. Debug.Log("指定のプレハブが見つかりませんでした。[" + f_strSrc + "]");
  321. return null;
  322. }
  323. }
  324. GameObject gameObject2;
  325. if (this.m_goBg != null)
  326. {
  327. if (!string.IsNullOrEmpty(f_strDest))
  328. {
  329. gameObject2 = UTY.GetChildObject(this.m_goBg, f_strDest, false);
  330. }
  331. else
  332. {
  333. gameObject2 = this.m_goBg;
  334. }
  335. }
  336. else
  337. {
  338. gameObject2 = this.m_goParent;
  339. }
  340. gameObject.transform.SetParent(gameObject2.transform, false);
  341. gameObject.transform.localPosition = f_vPos;
  342. gameObject.transform.localRotation = Quaternion.Euler(f_vRot);
  343. return gameObject;
  344. }
  345. public GameObject AddAssetsBundleToBg(string f_strSrc, string f_strName, string f_strDest, Vector3 f_vPos, Vector3 f_vRot)
  346. {
  347. GameObject gameObject = null;
  348. if (!this.m_dicAttachObj.TryGetValue(f_strName, out gameObject))
  349. {
  350. UnityEngine.Object @object = this.CreateAssetBundle(f_strSrc);
  351. if (@object == null)
  352. {
  353. Debug.Log("指定のAssetsBundle見つかりませんでした。[" + f_strSrc + "]");
  354. return null;
  355. }
  356. gameObject = (UnityEngine.Object.Instantiate(@object) as GameObject);
  357. gameObject.name = f_strName;
  358. this.m_dicAttachObj.Add(f_strName, gameObject);
  359. }
  360. GameObject gameObject2;
  361. if (this.m_goBg != null)
  362. {
  363. if (!string.IsNullOrEmpty(f_strDest))
  364. {
  365. gameObject2 = UTY.GetChildObject(this.m_goBg, f_strDest, false);
  366. }
  367. else
  368. {
  369. gameObject2 = this.m_goBg;
  370. }
  371. }
  372. else
  373. {
  374. gameObject2 = this.m_goParent;
  375. }
  376. gameObject.transform.SetParent(gameObject2.transform, false);
  377. gameObject.transform.localPosition = f_vPos;
  378. gameObject.transform.localRotation = Quaternion.Euler(f_vRot);
  379. return gameObject;
  380. }
  381. public void PrefabAnimatorSetParam<T>(string f_strName, string f_strParam, T f_value) where T : IConvertible
  382. {
  383. GameObject gameObject = null;
  384. if (this.m_dicAttachObj.TryGetValue(f_strName, out gameObject))
  385. {
  386. Animator component = gameObject.GetComponent<Animator>();
  387. if (component != null)
  388. {
  389. if (f_value.GetType() == typeof(int))
  390. {
  391. component.SetInteger(f_strParam, f_value.ToInt32(null));
  392. }
  393. else if (f_value.GetType() == typeof(float))
  394. {
  395. component.SetFloat(f_strParam, (float)f_value.ToDouble(null));
  396. }
  397. else if (f_value.GetType() == typeof(bool))
  398. {
  399. component.SetBool(f_strParam, f_value.ToBoolean(null));
  400. }
  401. }
  402. }
  403. else
  404. {
  405. Debug.LogWarning("プレハブが見つかりません。" + f_strName);
  406. }
  407. }
  408. public void PrefabAnimatorTrigger(string f_strName, string f_strParam, bool f_bReset)
  409. {
  410. GameObject gameObject = null;
  411. if (this.m_dicAttachObj.TryGetValue(f_strName, out gameObject))
  412. {
  413. Animator component = gameObject.GetComponent<Animator>();
  414. if (component != null)
  415. {
  416. if (f_bReset)
  417. {
  418. component.ResetTrigger(f_strParam);
  419. }
  420. else
  421. {
  422. component.SetTrigger(f_strParam);
  423. }
  424. }
  425. }
  426. else
  427. {
  428. Debug.LogWarning("プレハブが見つかりません。" + f_strName);
  429. }
  430. }
  431. public void MovePrefabToChara(string f_strPrefabName, Maid f_maid, string f_strDestBone, Vector3 f_vOffsPos, Vector3 f_vOffsRot, float f_fTime)
  432. {
  433. BgMgr.MovePfefab value = new BgMgr.MovePfefab(f_strPrefabName, f_maid, f_strDestBone, f_vOffsPos, f_vOffsRot, f_fTime);
  434. base.StartCoroutine("CoWaitMovePrefabToChara", value);
  435. }
  436. private IEnumerator CoWaitMovePrefabToChara(BgMgr.MovePfefab f_mp)
  437. {
  438. float fNowTime = 0f;
  439. if (f_mp.maid == null || f_mp.maid.body0 == null)
  440. {
  441. yield break;
  442. }
  443. GameObject objTarget = null;
  444. Transform trTarget = CMT.SearchObjName(f_mp.maid.body0.m_trBones, f_mp.strDestBone, true);
  445. if (trTarget != null)
  446. {
  447. this.m_dicAttachObj.TryGetValue(f_mp.strPrefabName, out objTarget);
  448. }
  449. if (objTarget == null)
  450. {
  451. yield break;
  452. }
  453. while (!(trTarget == null))
  454. {
  455. objTarget.transform.position = trTarget.position + f_mp.vOffsPos;
  456. yield return null;
  457. if ((fNowTime += Time.deltaTime) > f_mp.fTime)
  458. {
  459. yield break;
  460. }
  461. }
  462. yield break;
  463. }
  464. public GameObject GetPrefabFromBg(string f_strName)
  465. {
  466. if (!this.m_dicAttachObj.ContainsKey(f_strName))
  467. {
  468. return null;
  469. }
  470. return this.m_dicAttachObj[f_strName];
  471. }
  472. public void DelPrefabFromBg(string f_strName)
  473. {
  474. GameObject obj = null;
  475. if (this.m_dicAttachObj.TryGetValue(f_strName, out obj))
  476. {
  477. this.m_dicAttachObj.Remove(f_strName);
  478. UnityEngine.Object.Destroy(obj);
  479. }
  480. }
  481. public void DelPrefabFromBgAll()
  482. {
  483. base.StopCoroutine("CoWaitMovePrefabToChara");
  484. foreach (KeyValuePair<string, GameObject> keyValuePair in this.m_dicAttachObj)
  485. {
  486. if (keyValuePair.Value != null)
  487. {
  488. UnityEngine.Object.DestroyImmediate(keyValuePair.Value);
  489. }
  490. }
  491. this.m_dicAttachObj.Clear();
  492. }
  493. public void OnConnectedToServer()
  494. {
  495. this.SetPos(Vector3.zero);
  496. this.SetRot(Vector3.zero);
  497. }
  498. public void OnSaveDD()
  499. {
  500. this.SaveOvrDDPos(true);
  501. }
  502. private void ShowOvrDD(bool f_bShowForce)
  503. {
  504. if (this.m_goParent == null)
  505. {
  506. return;
  507. }
  508. string text = this.GetBGName();
  509. if (string.IsNullOrEmpty(text))
  510. {
  511. text = "__NoBG";
  512. }
  513. if (!GameMain.Instance.CMSystem.SConfig.OvrDDtoBG)
  514. {
  515. text = "__NoDDtoBG";
  516. }
  517. if (!f_bShowForce)
  518. {
  519. CMSystem.TransDD transDD;
  520. if (!GameMain.Instance.CMSystem.OvrDDBG.TryGetValue(text, out transDD))
  521. {
  522. if (this.desktop_screen_ != null)
  523. {
  524. UnityEngine.Object.DestroyImmediate(this.desktop_screen_);
  525. this.desktop_screen_ = null;
  526. }
  527. return;
  528. }
  529. if (!transDD.m_bShow)
  530. {
  531. if (this.desktop_screen_ != null)
  532. {
  533. UnityEngine.Object.DestroyImmediate(this.desktop_screen_);
  534. this.desktop_screen_ = null;
  535. }
  536. return;
  537. }
  538. }
  539. if (this.desktop_screen_ == null)
  540. {
  541. UnityEngine.Object @object = Resources.Load("Prefab/DesktopScreen");
  542. if (@object != null)
  543. {
  544. this.desktop_screen_ = (UnityEngine.Object.Instantiate(@object) as GameObject);
  545. }
  546. }
  547. if (this.desktop_screen_ != null)
  548. {
  549. this.desktop_screen_.transform.SetParent(this.m_goParent.transform);
  550. this.desktop_screen_.transform.localPosition = new Vector3(0f, 2f, 1f);
  551. this.desktop_screen_.transform.localRotation = Quaternion.identity;
  552. this.desktop_screen_.transform.localScale = Vector3.one;
  553. CMSystem.TransDD transDD2;
  554. if (GameMain.Instance.CMSystem.OvrDDBG.TryGetValue(text, out transDD2))
  555. {
  556. this.desktop_screen_.transform.localPosition = transDD2.m_vPos;
  557. this.desktop_screen_.transform.localRotation = transDD2.m_qRot;
  558. this.desktop_screen_.transform.localScale = transDD2.m_vScale;
  559. }
  560. }
  561. }
  562. private void SaveOvrDDPos(bool f_bShowing)
  563. {
  564. if (this.desktop_screen_ == null)
  565. {
  566. return;
  567. }
  568. string text = this.GetBGName();
  569. if (string.IsNullOrEmpty(text))
  570. {
  571. text = "__NoBG";
  572. }
  573. if (!GameMain.Instance.CMSystem.SConfig.OvrDDtoBG)
  574. {
  575. text = "__NoDDtoBG";
  576. }
  577. CMSystem.TransDD transDD = null;
  578. if (!GameMain.Instance.CMSystem.OvrDDBG.TryGetValue(text, out transDD))
  579. {
  580. transDD = new CMSystem.TransDD();
  581. GameMain.Instance.CMSystem.OvrDDBG.Add(text, transDD);
  582. }
  583. transDD.m_vPos = this.desktop_screen_.transform.localPosition;
  584. transDD.m_qRot = this.desktop_screen_.transform.localRotation;
  585. transDD.m_vScale = this.desktop_screen_.transform.localScale;
  586. transDD.m_bShow = f_bShowing;
  587. }
  588. public void Update()
  589. {
  590. if (Input.GetKeyDown(KeyCode.F10) && NInput.GetKey(KeyCode.LeftShift))
  591. {
  592. this.SetShowDesktopScreen(!this.isShowDesktopScreen);
  593. }
  594. else if (Input.GetKey(KeyCode.F11) && NInput.GetKey(KeyCode.LeftShift))
  595. {
  596. if (this.desktop_screen_ != null)
  597. {
  598. this.desktop_screen_.transform.localScale += new Vector3(0.1f, 0.1f, 0.1f) * Time.deltaTime;
  599. }
  600. }
  601. else if (Input.GetKey(KeyCode.F12) && NInput.GetKey(KeyCode.LeftShift) && this.desktop_screen_ != null)
  602. {
  603. this.desktop_screen_.transform.localScale += new Vector3(0.1f, 0.1f, 0.1f) * -Time.deltaTime;
  604. }
  605. }
  606. public bool isShowDesktopScreen
  607. {
  608. get
  609. {
  610. return this.desktop_screen_ != null;
  611. }
  612. }
  613. public void SetShowDesktopScreen(bool isShow)
  614. {
  615. if (isShow)
  616. {
  617. if (this.desktop_screen_ == null)
  618. {
  619. this.ShowOvrDD(true);
  620. }
  621. }
  622. else if (this.desktop_screen_ != null)
  623. {
  624. this.SaveOvrDDPos(false);
  625. UnityEngine.Object.DestroyImmediate(this.desktop_screen_);
  626. this.desktop_screen_ = null;
  627. }
  628. }
  629. public GameObject current_bg_object
  630. {
  631. get
  632. {
  633. return this.m_goBg;
  634. }
  635. }
  636. public GameObject bg_parent_object
  637. {
  638. get
  639. {
  640. return this.m_goParent;
  641. }
  642. }
  643. private GameObject m_goParent;
  644. private GameObject m_goBg;
  645. private Dictionary<string, BgMgr.AssetBundleObj> asset_bundle_dic = new Dictionary<string, BgMgr.AssetBundleObj>();
  646. private string m_strBGName = string.Empty;
  647. private Dictionary<string, GameObject> m_dicAttachObj = new Dictionary<string, GameObject>();
  648. private GameObject desktop_screen_;
  649. private struct AssetBundleObj
  650. {
  651. public AssetBundle ab;
  652. public UnityEngine.Object obj;
  653. }
  654. private class MovePfefab
  655. {
  656. public MovePfefab(string f_strPrefabName, Maid f_maid, string f_strDestBone, Vector3 f_vOffsPos, Vector3 f_vOffsRot, float f_fTime)
  657. {
  658. this.strPrefabName = f_strPrefabName;
  659. this.maid = f_maid;
  660. this.strDestBone = f_strDestBone;
  661. this.vOffsPos = f_vOffsPos;
  662. this.vOffsRot = f_vOffsRot;
  663. this.fTime = f_fTime;
  664. }
  665. public string strPrefabName;
  666. public Maid maid;
  667. public string strDestBone;
  668. public Vector3 vOffsPos;
  669. public Vector3 vOffsRot;
  670. public float fTime;
  671. }
  672. }