PhotographView.cs 22 KB

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