BgMgr.cs 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705
  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. if (!this.m_dicAttachObj.TryGetValue(f_strName, out gameObject))
  292. {
  293. UnityEngine.Object @object = Resources.Load("Prefab/" + f_strSrc);
  294. if (@object == null)
  295. {
  296. @object = this.CreateAssetBundle(f_strSrc);
  297. }
  298. if (@object == null)
  299. {
  300. return null;
  301. }
  302. gameObject = (UnityEngine.Object.Instantiate(@object) as GameObject);
  303. gameObject.name = f_strName;
  304. this.m_dicAttachObj.Add(f_strName, gameObject);
  305. }
  306. if (gameObject == null)
  307. {
  308. Debug.Log("指定のプレハブが見つかりませんでした。[" + f_strSrc + "]");
  309. return null;
  310. }
  311. GameObject gameObject2;
  312. if (this.m_goBg != null)
  313. {
  314. if (!string.IsNullOrEmpty(f_strDest))
  315. {
  316. gameObject2 = UTY.GetChildObject(this.m_goBg, f_strDest, false);
  317. }
  318. else
  319. {
  320. gameObject2 = this.m_goBg;
  321. }
  322. }
  323. else
  324. {
  325. gameObject2 = this.m_goParent;
  326. }
  327. gameObject.transform.SetParent(gameObject2.transform, false);
  328. gameObject.transform.localPosition = f_vPos;
  329. gameObject.transform.localRotation = Quaternion.Euler(f_vRot);
  330. return gameObject;
  331. }
  332. public GameObject AddAssetsBundleToBg(string f_strSrc, string f_strName, string f_strDest, Vector3 f_vPos, Vector3 f_vRot)
  333. {
  334. GameObject gameObject = null;
  335. if (!this.m_dicAttachObj.TryGetValue(f_strName, out gameObject))
  336. {
  337. UnityEngine.Object @object = this.CreateAssetBundle(f_strSrc);
  338. if (@object == null)
  339. {
  340. Debug.Log("指定のAssetsBundle見つかりませんでした。[" + f_strSrc + "]");
  341. return null;
  342. }
  343. gameObject = (UnityEngine.Object.Instantiate(@object) as GameObject);
  344. gameObject.name = f_strName;
  345. this.m_dicAttachObj.Add(f_strName, gameObject);
  346. }
  347. GameObject gameObject2;
  348. if (this.m_goBg != null)
  349. {
  350. if (!string.IsNullOrEmpty(f_strDest))
  351. {
  352. gameObject2 = UTY.GetChildObject(this.m_goBg, f_strDest, false);
  353. }
  354. else
  355. {
  356. gameObject2 = this.m_goBg;
  357. }
  358. }
  359. else
  360. {
  361. gameObject2 = this.m_goParent;
  362. }
  363. gameObject.transform.SetParent(gameObject2.transform, false);
  364. gameObject.transform.localPosition = f_vPos;
  365. gameObject.transform.localRotation = Quaternion.Euler(f_vRot);
  366. return gameObject;
  367. }
  368. public void PrefabAnimatorSetParam<T>(string f_strName, string f_strParam, T f_value) where T : IConvertible
  369. {
  370. GameObject gameObject = null;
  371. if (this.m_dicAttachObj.TryGetValue(f_strName, out gameObject))
  372. {
  373. Animator component = gameObject.GetComponent<Animator>();
  374. if (component != null)
  375. {
  376. if (f_value.GetType() == typeof(int))
  377. {
  378. component.SetInteger(f_strParam, f_value.ToInt32(null));
  379. }
  380. else if (f_value.GetType() == typeof(float))
  381. {
  382. component.SetFloat(f_strParam, (float)f_value.ToDouble(null));
  383. }
  384. else if (f_value.GetType() == typeof(bool))
  385. {
  386. component.SetBool(f_strParam, f_value.ToBoolean(null));
  387. }
  388. }
  389. }
  390. else
  391. {
  392. Debug.LogWarning("プレハブが見つかりません。" + f_strName);
  393. }
  394. }
  395. public void PrefabAnimatorTrigger(string f_strName, string f_strParam, bool f_bReset)
  396. {
  397. GameObject gameObject = null;
  398. if (this.m_dicAttachObj.TryGetValue(f_strName, out gameObject))
  399. {
  400. Animator component = gameObject.GetComponent<Animator>();
  401. if (component != null)
  402. {
  403. if (f_bReset)
  404. {
  405. component.ResetTrigger(f_strParam);
  406. }
  407. else
  408. {
  409. component.SetTrigger(f_strParam);
  410. }
  411. }
  412. }
  413. else
  414. {
  415. Debug.LogWarning("プレハブが見つかりません。" + f_strName);
  416. }
  417. }
  418. public void MovePrefabToChara(string f_strPrefabName, Maid f_maid, string f_strDestBone, Vector3 f_vOffsPos, Vector3 f_vOffsRot, float f_fTime)
  419. {
  420. BgMgr.MovePfefab value = new BgMgr.MovePfefab(f_strPrefabName, f_maid, f_strDestBone, f_vOffsPos, f_vOffsRot, f_fTime);
  421. base.StartCoroutine("CoWaitMovePrefabToChara", value);
  422. }
  423. private IEnumerator CoWaitMovePrefabToChara(BgMgr.MovePfefab f_mp)
  424. {
  425. float fNowTime = 0f;
  426. if (f_mp.maid == null || f_mp.maid.body0 == null)
  427. {
  428. yield break;
  429. }
  430. GameObject objTarget = null;
  431. Transform trTarget = CMT.SearchObjName(f_mp.maid.body0.m_trBones, f_mp.strDestBone, true);
  432. if (trTarget != null)
  433. {
  434. this.m_dicAttachObj.TryGetValue(f_mp.strPrefabName, out objTarget);
  435. }
  436. if (objTarget == null)
  437. {
  438. yield break;
  439. }
  440. while (!(trTarget == null))
  441. {
  442. objTarget.transform.position = trTarget.position + f_mp.vOffsPos;
  443. yield return null;
  444. if ((fNowTime += Time.deltaTime) > f_mp.fTime)
  445. {
  446. yield break;
  447. }
  448. }
  449. yield break;
  450. }
  451. public GameObject GetPrefabFromBg(string f_strName)
  452. {
  453. if (!this.m_dicAttachObj.ContainsKey(f_strName))
  454. {
  455. return null;
  456. }
  457. return this.m_dicAttachObj[f_strName];
  458. }
  459. public void DelPrefabFromBg(string f_strName)
  460. {
  461. GameObject obj = null;
  462. if (this.m_dicAttachObj.TryGetValue(f_strName, out obj))
  463. {
  464. this.m_dicAttachObj.Remove(f_strName);
  465. UnityEngine.Object.Destroy(obj);
  466. }
  467. }
  468. public void DelPrefabFromBgAll()
  469. {
  470. base.StopCoroutine("CoWaitMovePrefabToChara");
  471. foreach (KeyValuePair<string, GameObject> keyValuePair in this.m_dicAttachObj)
  472. {
  473. if (keyValuePair.Value != null)
  474. {
  475. UnityEngine.Object.DestroyImmediate(keyValuePair.Value);
  476. }
  477. }
  478. this.m_dicAttachObj.Clear();
  479. }
  480. public void OnConnectedToServer()
  481. {
  482. this.SetPos(Vector3.zero);
  483. this.SetRot(Vector3.zero);
  484. }
  485. public void OnSaveDD()
  486. {
  487. this.SaveOvrDDPos(true);
  488. }
  489. private void ShowOvrDD(bool f_bShowForce)
  490. {
  491. if (this.m_goParent == null)
  492. {
  493. return;
  494. }
  495. string text = this.GetBGName();
  496. if (string.IsNullOrEmpty(text))
  497. {
  498. text = "__NoBG";
  499. }
  500. if (!GameMain.Instance.CMSystem.SConfig.OvrDDtoBG)
  501. {
  502. text = "__NoDDtoBG";
  503. }
  504. if (!f_bShowForce)
  505. {
  506. CMSystem.TransDD transDD;
  507. if (!GameMain.Instance.CMSystem.OvrDDBG.TryGetValue(text, out transDD))
  508. {
  509. if (this.desktop_screen_ != null)
  510. {
  511. UnityEngine.Object.DestroyImmediate(this.desktop_screen_);
  512. this.desktop_screen_ = null;
  513. }
  514. return;
  515. }
  516. if (!transDD.m_bShow)
  517. {
  518. if (this.desktop_screen_ != null)
  519. {
  520. UnityEngine.Object.DestroyImmediate(this.desktop_screen_);
  521. this.desktop_screen_ = null;
  522. }
  523. return;
  524. }
  525. }
  526. if (this.desktop_screen_ == null)
  527. {
  528. UnityEngine.Object @object = Resources.Load("Prefab/DesktopScreen");
  529. if (@object != null)
  530. {
  531. this.desktop_screen_ = (UnityEngine.Object.Instantiate(@object) as GameObject);
  532. }
  533. }
  534. if (this.desktop_screen_ != null)
  535. {
  536. this.desktop_screen_.transform.SetParent(this.m_goParent.transform);
  537. this.desktop_screen_.transform.localPosition = new Vector3(0f, 2f, 1f);
  538. this.desktop_screen_.transform.localRotation = Quaternion.identity;
  539. this.desktop_screen_.transform.localScale = Vector3.one;
  540. CMSystem.TransDD transDD2;
  541. if (GameMain.Instance.CMSystem.OvrDDBG.TryGetValue(text, out transDD2))
  542. {
  543. this.desktop_screen_.transform.localPosition = transDD2.m_vPos;
  544. this.desktop_screen_.transform.localRotation = transDD2.m_qRot;
  545. this.desktop_screen_.transform.localScale = transDD2.m_vScale;
  546. }
  547. }
  548. }
  549. private void SaveOvrDDPos(bool f_bShowing)
  550. {
  551. if (this.desktop_screen_ == null)
  552. {
  553. return;
  554. }
  555. string text = this.GetBGName();
  556. if (string.IsNullOrEmpty(text))
  557. {
  558. text = "__NoBG";
  559. }
  560. if (!GameMain.Instance.CMSystem.SConfig.OvrDDtoBG)
  561. {
  562. text = "__NoDDtoBG";
  563. }
  564. CMSystem.TransDD transDD = null;
  565. if (!GameMain.Instance.CMSystem.OvrDDBG.TryGetValue(text, out transDD))
  566. {
  567. transDD = new CMSystem.TransDD();
  568. GameMain.Instance.CMSystem.OvrDDBG.Add(text, transDD);
  569. }
  570. transDD.m_vPos = this.desktop_screen_.transform.localPosition;
  571. transDD.m_qRot = this.desktop_screen_.transform.localRotation;
  572. transDD.m_vScale = this.desktop_screen_.transform.localScale;
  573. transDD.m_bShow = f_bShowing;
  574. }
  575. public void Update()
  576. {
  577. if (Input.GetKeyDown(KeyCode.F10) && NInput.GetKey(KeyCode.LeftShift))
  578. {
  579. this.SetShowDesktopScreen(!this.isShowDesktopScreen);
  580. }
  581. else if (Input.GetKey(KeyCode.F11) && NInput.GetKey(KeyCode.LeftShift))
  582. {
  583. if (this.desktop_screen_ != null)
  584. {
  585. this.desktop_screen_.transform.localScale += new Vector3(0.1f, 0.1f, 0.1f) * Time.deltaTime;
  586. }
  587. }
  588. else if (Input.GetKey(KeyCode.F12) && NInput.GetKey(KeyCode.LeftShift) && this.desktop_screen_ != null)
  589. {
  590. this.desktop_screen_.transform.localScale += new Vector3(0.1f, 0.1f, 0.1f) * -Time.deltaTime;
  591. }
  592. }
  593. public bool isShowDesktopScreen
  594. {
  595. get
  596. {
  597. return this.desktop_screen_ != null;
  598. }
  599. }
  600. public void SetShowDesktopScreen(bool isShow)
  601. {
  602. if (isShow)
  603. {
  604. if (this.desktop_screen_ == null)
  605. {
  606. this.ShowOvrDD(true);
  607. }
  608. }
  609. else if (this.desktop_screen_ != null)
  610. {
  611. this.SaveOvrDDPos(false);
  612. UnityEngine.Object.DestroyImmediate(this.desktop_screen_);
  613. this.desktop_screen_ = null;
  614. }
  615. }
  616. public GameObject current_bg_object
  617. {
  618. get
  619. {
  620. return this.m_goBg;
  621. }
  622. }
  623. public GameObject bg_parent_object
  624. {
  625. get
  626. {
  627. return this.m_goParent;
  628. }
  629. }
  630. private GameObject m_goParent;
  631. private GameObject m_goBg;
  632. private Dictionary<string, BgMgr.AssetBundleObj> asset_bundle_dic = new Dictionary<string, BgMgr.AssetBundleObj>();
  633. private string m_strBGName = string.Empty;
  634. private Dictionary<string, GameObject> m_dicAttachObj = new Dictionary<string, GameObject>();
  635. private GameObject desktop_screen_;
  636. private struct AssetBundleObj
  637. {
  638. public AssetBundle ab;
  639. public UnityEngine.Object obj;
  640. }
  641. private class MovePfefab
  642. {
  643. public MovePfefab(string f_strPrefabName, Maid f_maid, string f_strDestBone, Vector3 f_vOffsPos, Vector3 f_vOffsRot, float f_fTime)
  644. {
  645. this.strPrefabName = f_strPrefabName;
  646. this.maid = f_maid;
  647. this.strDestBone = f_strDestBone;
  648. this.vOffsPos = f_vOffsPos;
  649. this.vOffsRot = f_vOffsRot;
  650. this.fTime = f_fTime;
  651. }
  652. public string strPrefabName;
  653. public Maid maid;
  654. public string strDestBone;
  655. public Vector3 vOffsPos;
  656. public Vector3 vOffsRot;
  657. public float fTime;
  658. }
  659. }