PhotographView.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585
  1. using FairyGUI;
  2. using System;
  3. using System.Collections;
  4. using System.Collections.Generic;
  5. using System.Drawing;
  6. using UI.DressUp;
  7. using UnityEditor;
  8. using UnityEngine;
  9. using UnityEngine.EventSystems;
  10. namespace GFGGame
  11. {
  12. public class PhotographView : BaseView
  13. {
  14. private UI_PhotographUI _ui;
  15. private GameObject _scenePrefab;
  16. private GameObject _sceneObject;
  17. private const int MAX_COUNT = 8;
  18. private const float MaxScale = 2;
  19. private const float MinScale = 0.1f;
  20. private const string BgResPath = "Bg/BgRes";
  21. private const string BorderResPath = "Border/BorderRes";
  22. private const string NpcResPath = "Scene/Npc/NpcRes";
  23. private const string RolePath = "Scene/Role";
  24. private const string RoleName = "Role";
  25. private const string NpcPath = "Scene/Npc";
  26. private const string NpcName = "Npc";
  27. private const string BgResName = "BgRes";
  28. private List<int> _listData = null;//当前选择的资源数据
  29. private List<GameObject> _itemGameObjs;// = new List<GameObject>();
  30. public Dictionary<int, List<int>> _equipSceneData = new Dictionary<int, List<int>>();//当前穿戴的场景数据
  31. private Dictionary<GameObject, float> _equipDistance = new Dictionary<GameObject, float>();
  32. private GameObject hitGameObj;//当前选中的物体(单指拖动,双指缩放旋转)
  33. private GameObject memoryHitGameObj;//当前选中的物体(单指缩放旋转)
  34. private Vector3 distance = Vector3.zero;//点击位置和点击物体原点的距离,用于
  35. private Vector2 lastPos = Vector2.zero;//上一次移动后从物体中心到鼠标位置的方向
  36. private float lastDistance = 0;//上一次移动后从物体中心到鼠标位置的方向
  37. // private float _startDistance;//从物体中心到缩放按钮的距离
  38. private SwipeGesture swipeGesture;
  39. private PinchGesture pinchGesture;
  40. private RotationGesture rotationGesture;
  41. // private int maxLayer = int.MinValue;//最上层的层级数
  42. protected override void OnInit()
  43. {
  44. base.OnInit();
  45. packageName = UI_PhotographUI.PACKAGE_NAME;
  46. _ui = UI_PhotographUI.Create();
  47. viewCom = _ui.target;
  48. isfullScreen = true;
  49. _ui.m_btnBg.onClick.Add(OnClickBtnBg);
  50. _ui.m_loaGuide.onClick.Add(OnClickLoaGuide);
  51. _ui.m_loaGuide1.onClick.Add(OnClickLoaGuide1);
  52. _ui.m_btnChoose.onClick.Add(SetUIView);
  53. _ui.m_btnBack.onClick.Add(OnClickBtnBack);
  54. _ui.m_btnPhotograph.onClick.Add(OnClickBtnPhotograph);
  55. _ui.m_ComSelectRes.m_list.itemRenderer = RenderListItem;
  56. _ui.m_ComSelectRes.m_list.onClickItem.Add(OnListItemClick);
  57. _ui.m_ComSelectRes.m_comBtnTab.m_c1.onChanged.Add(OnContorllerChanged);
  58. _scenePrefab = GFGAsset.Load<GameObject>(ResPathUtil.GetPrefabPath("ScenePhotograph"));
  59. _ui.target.onTouchBegin.Add(OnTouchUIBegin);
  60. _ui.target.onTouchMove.Add(OnTouchUIMove);
  61. _ui.target.onTouchEnd.Add(OnTouchUIEnd);
  62. _ui.m_comSelectBox.m_btnSize.onTouchBegin.Add(OnTouchBtnSizeBegin);
  63. _ui.m_comSelectBox.m_btnSize.onTouchMove.Add(OnTouchBtnSizeMove);
  64. _ui.m_comSelectBox.m_btnSize.onTouchEnd.Add(OnTouchBtnSizeEnd);
  65. _ui.m_comSelectBox.m_btnFlip.onTouchBegin.Add(OnTouchBtnFlipBegin);
  66. _ui.m_comSelectBox.m_btnFlip.onTouchEnd.Add(OnTouchBtnFlipEnd);
  67. _ui.m_comSelectBox.m_btnDelete.onTouchBegin.Add(OnTouchBtnDeleteBegin);
  68. _ui.m_btnUp.onClick.Add(OnClickBtnUp);
  69. _ui.m_btnDown.onClick.Add(OnClickBtnDown);
  70. }
  71. protected override void OnShown()
  72. {
  73. base.OnShown();
  74. Input.multiTouchEnabled = true;
  75. PhotographDataManager.Instance.ClassifyEquipData();
  76. _equipSceneData = PhotographDataManager.Instance._equipSceneData;
  77. PhotographDataManager.Instance.itemGameObjs.Clear();
  78. _itemGameObjs = PhotographDataManager.Instance.itemGameObjs;
  79. if (_sceneObject == null)
  80. {
  81. _sceneObject = GameObject.Instantiate(_scenePrefab);
  82. EquipDataCache.cacher.setSceneObj(_sceneObject);
  83. PhotographSceneManager.Instance.sceneObject = _sceneObject;
  84. }
  85. pinchGesture = new PinchGesture(_ui.target);
  86. pinchGesture.onAction.Add(OnPinch);
  87. rotationGesture = new RotationGesture(_ui.target);
  88. rotationGesture.onAction.Add(OnRotate);
  89. _ui.m_ComSelectRes.m_comBtnTab.m_c1.selectedIndex = 0;
  90. RefreshList(EnumPhotographType.BG);
  91. SetUIView();
  92. PhotographSceneManager.Instance.AddBgItem(ItemCfgArray.Instance.GetCfg(EquipDataCache.cacher.bgId));
  93. PhotographSceneManager.Instance.AddBodyItem();
  94. UpdateScene();
  95. PhotographDataManager.Instance.SetLayer(null, "refresh");
  96. if (GuideDataManager.IsGuideFinish(ConstGuideId.PHOTOGRAPH) > 0)
  97. {
  98. _ui.m_loaGuide.enabled = false;
  99. _ui.m_loaGuide1.enabled = false;
  100. }
  101. else
  102. {
  103. _ui.m_loaGuide.enabled = true;
  104. _ui.m_loaGuide1.enabled = false;
  105. }
  106. // CreatTex();
  107. }
  108. /************************************************************UI界面*********************************************************/
  109. private void OnContorllerChanged(EventContext context)
  110. {
  111. int index = _ui.m_ComSelectRes.m_comBtnTab.m_c1.selectedIndex;
  112. RefreshList((EnumPhotographType)index);
  113. }
  114. private void RefreshList(EnumPhotographType index)
  115. {
  116. _ui.m_ComSelectRes.m_list.numItems = 0;
  117. _listData = PhotographDataManager.Instance.GetListData(index);
  118. _ui.m_ComSelectRes.m_list.numItems = _listData.Count;
  119. if (index == EnumPhotographType.BORDER || index == EnumPhotographType.EFFECT)
  120. {
  121. _ui.m_ComSelectRes.m_list.selectedIndex = 0;
  122. }
  123. }
  124. private void RenderListItem(int index, GObject obj)
  125. {
  126. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_listData[index]);
  127. string resPath = ResPathUtil.GetIconPath(itemCfg);
  128. UI_ListItem item = UI_ListItem.Proxy(obj);
  129. item.target.data = _listData[index];
  130. item.m_loaIcon.url = resPath;
  131. item.m_txtName.text = itemCfg.name;
  132. }
  133. private void OnListItemClick(EventContext context)
  134. {
  135. if (_itemGameObjs.Count >= MAX_COUNT)
  136. {
  137. PromptController.Instance.ShowFloatTextPrompt("最多穿戴" + MAX_COUNT + "件物品");
  138. return;
  139. }
  140. int itemID = (int)((context.data as GObject).data);
  141. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemID);
  142. EnumPhotographType type = (EnumPhotographType)_ui.m_ComSelectRes.m_comBtnTab.m_c1.selectedIndex;
  143. switch (type)
  144. {
  145. case EnumPhotographType.BG:
  146. PhotographSceneManager.Instance.AddBgItem(itemCfg);
  147. break;
  148. case EnumPhotographType.BORDER:
  149. PhotographSceneManager.Instance.AddBorderItem(itemCfg);
  150. break;
  151. case EnumPhotographType.NPC:
  152. PhotographSceneManager.Instance.AddNpcItem(itemCfg);
  153. break;
  154. case EnumPhotographType.SCENE:
  155. AddSceneItem(itemCfg, true);
  156. break;
  157. case EnumPhotographType.EFFECT:
  158. break;
  159. }
  160. }
  161. //添加初始场景道具
  162. private void UpdateScene()
  163. {
  164. ICollection keys = _equipSceneData.Keys;
  165. foreach (int key in keys)
  166. {
  167. for (int i = 0; i < _equipSceneData[key].Count; i++)
  168. {
  169. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(key);
  170. AddSceneItem(itemCfg, false);
  171. }
  172. }
  173. }
  174. private void AddSceneItem(ItemCfg itemCfg, bool setLayer)
  175. {
  176. Vector2 pos = Vector2.zero;
  177. if (itemCfg.resLayer2 > 0)
  178. {
  179. GameObject parentGameObj2 = new GameObject(string.Format("{0}_{1}", itemCfg.id, 2));
  180. PhotographSceneManager.Instance.AddSceneItem(parentGameObj2, itemCfg, itemCfg.resLayer2, setLayer);
  181. if (setLayer)
  182. {
  183. parentGameObj2.transform.localPosition = -parentGameObj2.transform.GetChild(0).localPosition;
  184. pos = parentGameObj2.transform.localPosition;
  185. }
  186. }
  187. if (itemCfg.resLayer1 > 0)
  188. {
  189. GameObject parentGameObj1 = new GameObject(string.Format("{0}_{1}", itemCfg.id, 1));
  190. PhotographSceneManager.Instance.AddSceneItem(parentGameObj1, itemCfg, itemCfg.resLayer1, setLayer);
  191. if (setLayer)
  192. {
  193. if (itemCfg.resLayer2 > 0)
  194. {
  195. parentGameObj1.transform.localPosition = pos;
  196. }
  197. else
  198. {
  199. parentGameObj1.transform.localPosition = -parentGameObj1.transform.GetChild(0).localPosition;
  200. }
  201. }
  202. }
  203. // GameObject parentGameObj2;
  204. }
  205. /************************************************************场景*********************************************************/
  206. private void OnTouchUIBegin(EventContext context)
  207. {
  208. context.CaptureTouch();
  209. if (_ui.m_ComSelectRes.target.visible == true) return;//添加道具不监听场景点击
  210. if (Stage.inst.touchCount > 1 && hitGameObj != null || Stage.inst.touchCount == 1 && context.inputEvent.touchId != 0) return;//两根手指&&两指不是同时按下||一根手指但属于中途换指
  211. if (PhotographDataManager.Instance.IsTouchUI(this.viewCom)) return;
  212. RaycastHit2D[] hit2Ds = Physics2D.RaycastAll(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero);
  213. if (hit2Ds.Length > 0)
  214. {
  215. lastPos = Vector2.zero;
  216. hitGameObj = SceneController.GetFirstHitObj(hit2Ds);
  217. _ui.m_comSelectBox.m_btnDelete.visible = true;
  218. if (hitGameObj.name == "Body")//主角不可删除
  219. {
  220. _ui.m_comSelectBox.m_btnDelete.visible = false;
  221. }
  222. _ui.m_comSelectBox.target.visible = false;
  223. if (hitGameObj.name != BgResName)//背景不可改动层级
  224. {
  225. hitGameObj = hitGameObj.transform.parent.gameObject;
  226. _ui.m_comSelectBox.target.visible = true;
  227. PhotographDataManager.Instance.SetLayer(hitGameObj, "top");
  228. if (!_equipDistance.ContainsKey(hitGameObj))
  229. {
  230. SceneController.SetGameObjectCenter(hitGameObj);
  231. }
  232. }
  233. memoryHitGameObj = hitGameObj;
  234. distance = Input.mousePosition - Camera.main.WorldToScreenPoint(hitGameObj.transform.position);
  235. Vector3 localEulerAngles = hitGameObj.transform.localEulerAngles;
  236. float rotation = 0;
  237. if (localEulerAngles.y == 0)
  238. {
  239. rotation = -hitGameObj.transform.localEulerAngles.z;
  240. }
  241. else
  242. {
  243. if (hitGameObj.transform.localEulerAngles.z > 180)
  244. {
  245. rotation = hitGameObj.transform.localEulerAngles.z - 360;
  246. }
  247. else
  248. {
  249. rotation = hitGameObj.transform.localEulerAngles.z;
  250. }
  251. }
  252. _ui.m_comSelectBox.target.rotation = rotation;
  253. Debug.Log("rotation:" + _ui.m_comSelectBox.target.rotation + " " + _ui.m_comSelectBox.target.rotationX + " " + _ui.m_comSelectBox.target.rotationY);
  254. _ui.m_comSelectBox.target.size = SceneController.GetGameObjectSize(hitGameObj);
  255. ControllerSelectBoxPos();
  256. }
  257. }
  258. private void OnTouchUIMove(EventContext context)
  259. {
  260. if (hitGameObj == null) return;//未选中任何物体
  261. if (Stage.inst.touchCount > 1) return; //只监听1根手指
  262. if (PhotographDataManager.Instance.IsTouchUI(this.viewCom)) return;
  263. Debug.Log("拖动");
  264. ControllerObjectPos();
  265. ControllerSelectBoxPos();
  266. }
  267. private void OnTouchUIEnd(EventContext context)
  268. {
  269. hitGameObj = null;
  270. }
  271. //选中物体的位置
  272. private void ControllerObjectPos()
  273. {
  274. hitGameObj.transform.position = Camera.main.ScreenToWorldPoint(Input.mousePosition - distance);
  275. if (hitGameObj.name == BgResName)
  276. {
  277. PhotographDataManager.Instance.SetBgPos(hitGameObj, _ui.target.size);
  278. }
  279. }
  280. //选中框的位置
  281. private void ControllerSelectBoxPos()
  282. {
  283. Vector2 objScreenPos = Camera.main.WorldToScreenPoint(hitGameObj.transform.position);
  284. Vector2 localPos = this.viewCom.GlobalToLocal(new Vector2(objScreenPos.x, (Screen.height - objScreenPos.y)));
  285. _ui.m_comSelectBox.target.position = localPos;
  286. }
  287. private void OnTouchBtnSizeBegin(EventContext context)
  288. {
  289. InputEvent inputEvent = (InputEvent)context.data;
  290. Vector2 pt0 = this.viewCom.GlobalToLocal(new Vector2(inputEvent.x, inputEvent.y));
  291. Vector2 screenPos = this.viewCom.GlobalToLocal(_ui.m_comSelectBox.m_btnSize.LocalToGlobal(Vector2.zero));
  292. Vector2 pt1 = new Vector2(screenPos.x, screenPos.y);
  293. Vector2 pt2 = new Vector2(_ui.m_comSelectBox.target.x, _ui.m_comSelectBox.target.y);
  294. lastDistance = Vector2.Distance(pt0, pt2);
  295. if (!_equipDistance.ContainsKey(memoryHitGameObj))
  296. {
  297. float distance = Vector2.Distance(pt1, pt2) / memoryHitGameObj.transform.localScale.x;
  298. Debug.Log("distance:" + distance + " pt1:" + pt1 + " pt2:" + pt2);
  299. _equipDistance.Add(memoryHitGameObj, distance);
  300. }
  301. }
  302. private void OnTouchBtnSizeMove(EventContext context)
  303. {
  304. if (memoryHitGameObj == null) return;
  305. InputEvent inputEvent = (InputEvent)context.data;
  306. Vector2 pt1 = this.viewCom.GlobalToLocal(new Vector2(inputEvent.x, inputEvent.y));
  307. Vector2 pt2 = new Vector2(_ui.m_comSelectBox.target.x, _ui.m_comSelectBox.target.y);
  308. Vector2 curPos = pt1 - pt2;
  309. float angle = Vector3.Angle(lastPos, curPos); //求出两向量之间的夹角
  310. Vector3 normal = Vector3.Cross(lastPos, curPos);//叉乘求出法线向量
  311. angle *= Mathf.Sign(Vector3.Dot(normal, Vector3.forward)); //Mathf.Sign()求符号,Vector3.Dot()求方向,求法线向量与物体上方向向量点乘,结果为1或-1,修正旋转方向
  312. lastPos = curPos;
  313. ControllerRotate(angle, memoryHitGameObj);
  314. float dist = Vector2.Distance(pt1, pt2);
  315. float ss = dist / lastDistance;
  316. Debug.Log("dist:" + dist + " lastDistance:" + lastDistance + " ss:" + ss);
  317. float newValue = Mathf.Clamp(ss * memoryHitGameObj.transform.localScale.x, 0.1f, 2);
  318. ControllerScale(newValue, memoryHitGameObj);
  319. if (newValue <= 0.1f) return;
  320. Debug.Log("ss:" + ss + " newValue:" + newValue);
  321. lastDistance = dist;
  322. Debug.Log("newValue:" + newValue);
  323. }
  324. private void OnTouchBtnSizeEnd(EventContext context)
  325. {
  326. lastPos = Vector2.zero;
  327. }
  328. //双指缩放
  329. private void OnPinch(EventContext context)
  330. {
  331. if (hitGameObj == null) return;
  332. if (hitGameObj.name == BgResName) return;//背景不可以缩放、旋转
  333. GTween.Kill(hitGameObj);
  334. PinchGesture gesture = (PinchGesture)context.sender;
  335. float newValue = Mathf.Clamp(hitGameObj.transform.localScale.x + gesture.delta, 0.3f, 2);
  336. Debug.Log("双指缩放:" + newValue);
  337. ControllerScale(newValue, hitGameObj);
  338. }
  339. //双指旋转
  340. private void OnRotate(EventContext context)
  341. {
  342. Debug.Log("双指旋转hitGameObj:" + hitGameObj);
  343. if (hitGameObj == null) return;
  344. Debug.Log("双指旋转name:" + hitGameObj.name);
  345. if (hitGameObj.name == BgResName) return;//背景不可以缩放、旋转
  346. // isTwoTouchPoint = true;
  347. GTween.Kill(hitGameObj.transform);
  348. RotationGesture gesture = (RotationGesture)context.sender;
  349. Debug.Log("双指旋转:" + gesture.delta);
  350. ControllerRotate(gesture.delta, hitGameObj);
  351. }
  352. private void ControllerScale(float value, GameObject gameObject)
  353. {
  354. if (value > MaxScale || value < MinScale) return;
  355. gameObject.transform.localScale = new Vector3(value, value, 1);
  356. Vector2 size = SceneController.GetGameObjectSize(gameObject);
  357. _ui.m_comSelectBox.target.size = size;
  358. }
  359. private void ControllerRotate(float value, GameObject gameObject)
  360. {
  361. gameObject.transform.Rotate(Vector3.forward, -value, Space.World);
  362. _ui.m_comSelectBox.target.rotation += value;
  363. }
  364. private void OnClickBtnBg()
  365. {
  366. _ui.m_ComSelectRes.target.visible = false;
  367. }
  368. private void OnClickLoaGuide()
  369. {
  370. _ui.m_loaGuide1.enabled = true;
  371. _ui.m_loaGuide.enabled = false;
  372. _ui.m_ComSelectRes.target.visible = false;
  373. }
  374. private void OnClickLoaGuide1()
  375. {
  376. _ui.m_loaGuide1.enabled = false;
  377. _ui.m_ComSelectRes.target.visible = false;
  378. }
  379. private void OnTouchBtnFlipBegin()//翻转
  380. {
  381. Transform transform = memoryHitGameObj.transform;
  382. if (memoryHitGameObj.name == RoleName)
  383. {
  384. transform.Rotate(Vector3.up, 180, Space.Self);
  385. return;
  386. }
  387. for (int i = 0; i < transform.childCount; i++)
  388. {
  389. transform.GetChild(i).Rotate(Vector3.up, 180, Space.Self);
  390. }
  391. }
  392. private void OnTouchBtnFlipEnd()
  393. {
  394. }
  395. private void OnTouchBtnDeleteBegin()//删除
  396. {
  397. if (memoryHitGameObj.transform.name == RolePath)
  398. {
  399. return;
  400. }
  401. else if (memoryHitGameObj.transform.name == NpcName)
  402. {
  403. SpriteRenderer spriteRenderer = memoryHitGameObj.transform.GetChild(0).GetComponent<SpriteRenderer>();
  404. if (spriteRenderer != null)
  405. {
  406. GameObject.Destroy(spriteRenderer);
  407. }
  408. }
  409. else
  410. {
  411. GameObject.DestroyImmediate(memoryHitGameObj);
  412. }
  413. _itemGameObjs.Remove(memoryHitGameObj);
  414. _ui.m_comSelectBox.target.visible = false;
  415. }
  416. private void SetUIView()
  417. {
  418. _ui.m_ComSelectRes.target.visible = true;
  419. _ui.m_comSelectBox.target.visible = false;
  420. hitGameObj = null;
  421. memoryHitGameObj = null;
  422. }
  423. private void OnClickBtnUp()
  424. {
  425. PhotographDataManager.Instance.SetLayer(memoryHitGameObj, "up");
  426. }
  427. private void OnClickBtnDown()
  428. {
  429. PhotographDataManager.Instance.SetLayer(memoryHitGameObj, "down");
  430. }
  431. private void OnClickBtnPhotograph()
  432. {
  433. _ui.target.visible = false;
  434. Timers.inst.StartCoroutine(ScreenShotTex());// ();
  435. }
  436. private IEnumerator ScreenShotTex()
  437. {
  438. _ui.target.visible = false;
  439. yield return new WaitForEndOfFrame();
  440. Rect rect = new Rect(0, 0, UnityEngine.Screen.width, UnityEngine.Screen.height);
  441. Texture2D tex = new Texture2D((int)rect.width, (int)rect.height, TextureFormat.ARGB32, false);//新建一个Texture2D对象
  442. tex.ReadPixels(rect, 0, 0);//读取像素,屏幕左下角为0点
  443. tex.Apply();//保存像素信息
  444. ViewManager.Show<PhotographSaveView>(tex);
  445. _ui.target.visible = true;
  446. }
  447. private void OnClickBtnBack()
  448. {
  449. this.Hide();
  450. // ViewManager.Show(ViewName.DRESS_UP_VIEW);
  451. EventAgent.DispatchEvent(ConstMessage.CLOSE_PHOTOGRAPHVIEW);
  452. }
  453. protected override void OnHide()
  454. {
  455. base.OnHide();
  456. if (_sceneObject != null)
  457. {
  458. GameObject.Destroy(_sceneObject);
  459. _sceneObject = null;
  460. }
  461. _equipSceneData.Clear();
  462. hitGameObj = null;
  463. memoryHitGameObj = null;
  464. pinchGesture.onAction.Remove(OnPinch);
  465. rotationGesture.onAction.Remove(OnRotate);
  466. pinchGesture = null;
  467. rotationGesture = null;
  468. }
  469. public override void Dispose()
  470. {
  471. if (_scenePrefab != null)
  472. {
  473. GameObject.Destroy(_scenePrefab);
  474. _scenePrefab = null;
  475. }
  476. base.Dispose();
  477. }
  478. protected override void UpdateToCheckGuide(object param)
  479. {
  480. if (!ViewManager.CheckIsTopView(this.viewCom)) return;
  481. GuideController.TryGuide(_ui.m_ComSelectRes.m_comBtnTab.m_btn0, ConstGuideId.PHOTOGRAPH, 2, "在这里可以选择已获得的背景、道具等,也可以放大缩小物品,增加画面丰富度");
  482. GuideController.TryGuide(_ui.m_btnPhotograph, ConstGuideId.PHOTOGRAPH, 3, "来记录下这一刻吧~~");
  483. GuideController.TryCompleteGuide(ConstGuideId.PHOTOGRAPH, 3);
  484. }
  485. }
  486. }