PhotographView.cs 22 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583
  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. }
  120. private void RenderListItem(int index, GObject obj)
  121. {
  122. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(_listData[index]);
  123. string resPath = ResPathUtil.GetIconPath(itemCfg);
  124. UI_ListItem item = UI_ListItem.Proxy(obj);
  125. item.target.data = _listData[index];
  126. item.m_loaIcon.url = resPath;
  127. item.m_txtName.text = itemCfg.name;
  128. }
  129. private void OnListItemClick(EventContext context)
  130. {
  131. if (_itemGameObjs.Count >= MAX_COUNT)
  132. {
  133. PromptController.Instance.ShowFloatTextPrompt("最多穿戴" + MAX_COUNT + "件物品");
  134. return;
  135. }
  136. int itemID = (int)((context.data as GObject).data);
  137. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemID);
  138. EnumPhotographType type = (EnumPhotographType)_ui.m_ComSelectRes.m_comBtnTab.m_c1.selectedIndex;
  139. switch (type)
  140. {
  141. case EnumPhotographType.BG:
  142. PhotographSceneManager.Instance.AddBgItem(itemCfg);
  143. break;
  144. case EnumPhotographType.BORDER:
  145. PhotographSceneManager.Instance.AddBorderItem(itemCfg);
  146. break;
  147. case EnumPhotographType.NPC:
  148. PhotographSceneManager.Instance.AddNpcItem(itemCfg);
  149. break;
  150. case EnumPhotographType.SCENE:
  151. AddSceneItem(itemCfg, true);
  152. break;
  153. case EnumPhotographType.EFFECT:
  154. break;
  155. }
  156. }
  157. //添加初始场景道具
  158. private void UpdateScene()
  159. {
  160. ICollection keys = _equipSceneData.Keys;
  161. foreach (int key in keys)
  162. {
  163. for (int i = 0; i < _equipSceneData[key].Count; i++)
  164. {
  165. ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(key);
  166. AddSceneItem(itemCfg, false);
  167. }
  168. }
  169. }
  170. private void AddSceneItem(ItemCfg itemCfg, bool setLayer)
  171. {
  172. Vector2 pos = Vector2.zero;
  173. if (itemCfg.resLayer2 > 0)
  174. {
  175. GameObject parentGameObj2 = new GameObject(string.Format("{0}_{1}", itemCfg.id, 2));
  176. PhotographSceneManager.Instance.AddSceneItem(parentGameObj2, itemCfg, itemCfg.resLayer2, setLayer);
  177. if (setLayer)
  178. {
  179. parentGameObj2.transform.localPosition = -parentGameObj2.transform.GetChild(0).localPosition;
  180. pos = parentGameObj2.transform.localPosition;
  181. }
  182. }
  183. if (itemCfg.resLayer1 > 0)
  184. {
  185. GameObject parentGameObj1 = new GameObject(string.Format("{0}_{1}", itemCfg.id, 1));
  186. PhotographSceneManager.Instance.AddSceneItem(parentGameObj1, itemCfg, itemCfg.resLayer1, setLayer);
  187. if (setLayer)
  188. {
  189. if (itemCfg.resLayer2 > 0)
  190. {
  191. parentGameObj1.transform.localPosition = pos;
  192. }
  193. else
  194. {
  195. parentGameObj1.transform.localPosition = -parentGameObj1.transform.GetChild(0).localPosition;
  196. }
  197. }
  198. }
  199. // GameObject parentGameObj2;
  200. }
  201. /************************************************************场景*********************************************************/
  202. private void OnTouchUIBegin(EventContext context)
  203. {
  204. context.CaptureTouch();
  205. if (_ui.m_ComSelectRes.target.visible == true) return;//添加道具不监听场景点击
  206. if (Stage.inst.touchCount > 1 && hitGameObj != null || Stage.inst.touchCount == 1 && context.inputEvent.touchId != 0) return;//两根手指&&两指不是同时按下||一根手指但属于中途换指
  207. if (PhotographDataManager.Instance.IsTouchUI(this.viewCom)) return;
  208. RaycastHit2D[] hit2Ds = Physics2D.RaycastAll(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero);
  209. if (hit2Ds.Length > 0)
  210. {
  211. lastPos = Vector2.zero;
  212. hitGameObj = SceneController.GetFirstHitObj(hit2Ds);
  213. _ui.m_comSelectBox.m_btnDelete.visible = true;
  214. if (hitGameObj.name == "Body")//主角不可删除
  215. {
  216. _ui.m_comSelectBox.m_btnDelete.visible = false;
  217. }
  218. _ui.m_comSelectBox.target.visible = false;
  219. if (hitGameObj.name != BgResName)//背景不可改动层级
  220. {
  221. hitGameObj = hitGameObj.transform.parent.gameObject;
  222. _ui.m_comSelectBox.target.visible = true;
  223. PhotographDataManager.Instance.SetLayer(hitGameObj, "top");
  224. if (!_equipDistance.ContainsKey(hitGameObj))
  225. {
  226. SceneController.SetGameObjectCenter(hitGameObj);
  227. }
  228. }
  229. memoryHitGameObj = hitGameObj;
  230. distance = Input.mousePosition - Camera.main.WorldToScreenPoint(hitGameObj.transform.position);
  231. Vector3 localEulerAngles = hitGameObj.transform.localEulerAngles;
  232. float rotation = 0;
  233. if (localEulerAngles.y == 0)
  234. {
  235. rotation = -hitGameObj.transform.localEulerAngles.z;
  236. }
  237. else
  238. {
  239. if (hitGameObj.transform.localEulerAngles.z > 180)
  240. {
  241. rotation = hitGameObj.transform.localEulerAngles.z - 360;
  242. }
  243. else
  244. {
  245. rotation = hitGameObj.transform.localEulerAngles.z;
  246. }
  247. }
  248. _ui.m_comSelectBox.target.rotation = rotation;
  249. Debug.Log("rotation:" + _ui.m_comSelectBox.target.rotation + " " + _ui.m_comSelectBox.target.rotationX + " " + _ui.m_comSelectBox.target.rotationY);
  250. _ui.m_comSelectBox.target.size = SceneController.GetGameObjectSize(hitGameObj);
  251. ControllerSelectBoxPos();
  252. }
  253. }
  254. private void OnTouchUIMove(EventContext context)
  255. {
  256. if (hitGameObj == null) return;//未选中任何物体
  257. if (Stage.inst.touchCount > 1) return; //只监听1根手指
  258. if (PhotographDataManager.Instance.IsTouchUI(this.viewCom)) return;
  259. Debug.Log("拖动");
  260. ControllerObjectPos();
  261. ControllerSelectBoxPos();
  262. }
  263. private void OnTouchUIEnd(EventContext context)
  264. {
  265. hitGameObj = null;
  266. }
  267. //选中物体的位置
  268. private void ControllerObjectPos()
  269. {
  270. hitGameObj.transform.position = Camera.main.ScreenToWorldPoint(Input.mousePosition - distance);
  271. if (hitGameObj.name == BgResName)
  272. {
  273. PhotographDataManager.Instance.SetBgPos(hitGameObj, _ui.target.size);
  274. }
  275. }
  276. //选中框的位置
  277. private void ControllerSelectBoxPos()
  278. {
  279. Vector2 objScreenPos = Camera.main.WorldToScreenPoint(hitGameObj.transform.position);
  280. Vector2 localPos = this.viewCom.GlobalToLocal(new Vector2(objScreenPos.x, (Screen.height - objScreenPos.y)));
  281. _ui.m_comSelectBox.target.position = localPos;
  282. }
  283. private void OnTouchBtnSizeBegin(EventContext context)
  284. {
  285. InputEvent inputEvent = (InputEvent)context.data;
  286. Vector2 pt0 = this.viewCom.GlobalToLocal(new Vector2(inputEvent.x, inputEvent.y));
  287. Vector2 screenPos = this.viewCom.GlobalToLocal(_ui.m_comSelectBox.m_btnSize.LocalToGlobal(Vector2.zero));
  288. Vector2 pt1 = new Vector2(screenPos.x, screenPos.y);
  289. Vector2 pt2 = new Vector2(_ui.m_comSelectBox.target.x, _ui.m_comSelectBox.target.y);
  290. lastDistance = Vector2.Distance(pt0, pt2);
  291. if (!_equipDistance.ContainsKey(memoryHitGameObj))
  292. {
  293. float distance = Vector2.Distance(pt1, pt2) / memoryHitGameObj.transform.localScale.x;
  294. Debug.Log("distance:" + distance + " pt1:" + pt1 + " pt2:" + pt2);
  295. _equipDistance.Add(memoryHitGameObj, distance);
  296. }
  297. }
  298. private void OnTouchBtnSizeMove(EventContext context)
  299. {
  300. if (memoryHitGameObj == null) return;
  301. InputEvent inputEvent = (InputEvent)context.data;
  302. Vector2 pt1 = this.viewCom.GlobalToLocal(new Vector2(inputEvent.x, inputEvent.y));
  303. Vector2 pt2 = new Vector2(_ui.m_comSelectBox.target.x, _ui.m_comSelectBox.target.y);
  304. Vector2 curPos = pt1 - pt2;
  305. float angle = Vector3.Angle(lastPos, curPos); //求出两向量之间的夹角
  306. Vector3 normal = Vector3.Cross(lastPos, curPos);//叉乘求出法线向量
  307. angle *= Mathf.Sign(Vector3.Dot(normal, Vector3.forward)); //Mathf.Sign()求符号,Vector3.Dot()求方向,求法线向量与物体上方向向量点乘,结果为1或-1,修正旋转方向
  308. lastPos = curPos;
  309. ControllerRotate(angle, memoryHitGameObj);
  310. float dist = Vector2.Distance(pt1, pt2);
  311. float ss = dist / lastDistance;
  312. Debug.Log("dist:" + dist + " lastDistance:" + lastDistance + " ss:" + ss);
  313. float newValue = Mathf.Clamp(ss * memoryHitGameObj.transform.localScale.x, 0.1f, 2);
  314. ControllerScale(newValue, memoryHitGameObj);
  315. if (newValue <= 0.1f) return;
  316. Debug.Log("ss:" + ss + " newValue:" + newValue);
  317. lastDistance = dist;
  318. Debug.Log("newValue:" + newValue);
  319. }
  320. private void OnTouchBtnSizeEnd(EventContext context)
  321. {
  322. lastPos = Vector2.zero;
  323. }
  324. //双指缩放
  325. private void OnPinch(EventContext context)
  326. {
  327. if (hitGameObj == null) return;
  328. if (hitGameObj.name == BgResName) return;//背景不可以缩放、旋转
  329. GTween.Kill(hitGameObj);
  330. PinchGesture gesture = (PinchGesture)context.sender;
  331. float newValue = Mathf.Clamp(hitGameObj.transform.localScale.x + gesture.delta, 0.3f, 2);
  332. Debug.Log("双指缩放:" + newValue);
  333. ControllerScale(newValue, hitGameObj);
  334. }
  335. //双指旋转
  336. private void OnRotate(EventContext context)
  337. {
  338. Debug.Log("双指旋转hitGameObj:" + hitGameObj);
  339. if (hitGameObj == null) return;
  340. Debug.Log("双指旋转name:" + hitGameObj.name);
  341. if (hitGameObj.name == BgResName) return;//背景不可以缩放、旋转
  342. // isTwoTouchPoint = true;
  343. GTween.Kill(hitGameObj.transform);
  344. RotationGesture gesture = (RotationGesture)context.sender;
  345. Debug.Log("双指旋转:" + gesture.delta);
  346. ControllerRotate(gesture.delta, hitGameObj);
  347. }
  348. private void ControllerScale(float value, GameObject gameObject)
  349. {
  350. if (value > MaxScale || value < MinScale) return;
  351. gameObject.transform.localScale = new Vector3(value, value, 1);
  352. Vector2 size = SceneController.GetGameObjectSize(gameObject);
  353. _ui.m_comSelectBox.target.size = size;
  354. }
  355. private void ControllerRotate(float value, GameObject gameObject)
  356. {
  357. gameObject.transform.Rotate(Vector3.forward, -value, Space.World);
  358. _ui.m_comSelectBox.target.rotation += value;
  359. }
  360. private void OnClickBtnBg()
  361. {
  362. _ui.m_ComSelectRes.target.visible = false;
  363. }
  364. private void OnClickLoaGuide()
  365. {
  366. _ui.m_loaGuide1.enabled = true;
  367. _ui.m_loaGuide.enabled = false;
  368. _ui.m_ComSelectRes.target.visible = false;
  369. }
  370. private void OnClickLoaGuide1()
  371. {
  372. _ui.m_loaGuide1.enabled = false;
  373. _ui.m_ComSelectRes.target.visible = false;
  374. }
  375. private void OnTouchBtnFlipBegin()//翻转
  376. {
  377. Transform transform = memoryHitGameObj.transform;
  378. if (memoryHitGameObj.name == RoleName)
  379. {
  380. transform.Rotate(Vector3.up, 180, Space.Self);
  381. return;
  382. }
  383. for (int i = 0; i < transform.childCount; i++)
  384. {
  385. transform.GetChild(i).Rotate(Vector3.up, 180, Space.Self);
  386. }
  387. }
  388. private void OnTouchBtnFlipEnd()
  389. {
  390. }
  391. private void OnTouchBtnDeleteBegin()//删除
  392. {
  393. if (memoryHitGameObj.transform.name == RolePath)
  394. {
  395. return;
  396. }
  397. else if (memoryHitGameObj.transform.name == NpcName)
  398. {
  399. SpriteRenderer spriteRenderer = memoryHitGameObj.transform.GetChild(0).GetComponent<SpriteRenderer>();
  400. if (spriteRenderer != null)
  401. {
  402. GameObject.Destroy(spriteRenderer);
  403. }
  404. }
  405. else
  406. {
  407. GameObject.DestroyImmediate(memoryHitGameObj);
  408. }
  409. _itemGameObjs.Remove(memoryHitGameObj);
  410. _ui.m_comSelectBox.target.visible = false;
  411. }
  412. private void SetUIView()
  413. {
  414. _ui.m_ComSelectRes.target.visible = true;
  415. _ui.m_comSelectBox.target.visible = false;
  416. hitGameObj = null;
  417. memoryHitGameObj = null;
  418. }
  419. private void OnClickBtnUp()
  420. {
  421. PhotographDataManager.Instance.SetLayer(memoryHitGameObj, "up");
  422. }
  423. private void OnClickBtnDown()
  424. {
  425. PhotographDataManager.Instance.SetLayer(memoryHitGameObj, "down");
  426. }
  427. private void OnClickBtnPhotograph()
  428. {
  429. _ui.target.visible = false;
  430. Timers.inst.StartCoroutine(ScreenShotTex());// ();
  431. }
  432. private IEnumerator ScreenShotTex()
  433. {
  434. _ui.target.visible = false;
  435. yield return new WaitForEndOfFrame();
  436. Rect rect = new Rect(0, 0, UnityEngine.Screen.width, UnityEngine.Screen.height);
  437. Texture2D tex = new Texture2D((int)rect.width, (int)rect.height, TextureFormat.ARGB32, false);//新建一个Texture2D对象
  438. tex.ReadPixels(rect, 0, 0);//读取像素,屏幕左下角为0点
  439. tex.Apply();//保存像素信息
  440. ViewManager.Show<PhotographSaveView>(tex);
  441. _ui.target.visible = true;
  442. }
  443. private void OnClickBtnBack()
  444. {
  445. this.Hide();
  446. // ViewManager.Show(ViewName.DRESS_UP_VIEW);
  447. EventAgent.DispatchEvent(ConstMessage.CLOSE_PHOTOGRAPHVIEW);
  448. }
  449. protected override void OnHide()
  450. {
  451. base.OnHide();
  452. if (_sceneObject != null)
  453. {
  454. GameObject.Destroy(_sceneObject);
  455. _sceneObject = null;
  456. }
  457. _equipSceneData.Clear();
  458. hitGameObj = null;
  459. memoryHitGameObj = null;
  460. pinchGesture.onAction.Remove(OnPinch);
  461. rotationGesture.onAction.Remove(OnRotate);
  462. pinchGesture = null;
  463. rotationGesture = null;
  464. }
  465. public override void Dispose()
  466. {
  467. if (_scenePrefab != null)
  468. {
  469. GameObject.Destroy(_scenePrefab);
  470. _scenePrefab = null;
  471. }
  472. base.Dispose();
  473. }
  474. protected override void UpdateToCheckGuide(object param)
  475. {
  476. if (!ViewManager.CheckIsTopView(this.viewCom)) return;
  477. GuideController.TryGuide(_ui.m_ComSelectRes.m_comBtnTab.m_btn2, ConstGuideId.PHOTOGRAPH, 4, "可以自由添加已有道具");
  478. GuideController.TryGuide(_ui.m_loaGuide, ConstGuideId.PHOTOGRAPH, 5, "点击空白处查看整体效果", -1, true, (int)(_ui.m_loaGuide.y + _ui.m_loaGuide.height - 250), 0, 0, false);
  479. GuideController.TryGuide(_ui.m_loaGuide1, ConstGuideId.PHOTOGRAPH, 6, "双指可控制放大缩小,或点击边框上的按键控制", -1, true, (int)(_ui.m_loaGuide1.y + _ui.m_loaGuide1.height - 250), 0, 0, false);
  480. GuideController.TryGuide(_ui.m_btnPhotograph, ConstGuideId.PHOTOGRAPH, 7, "点击拍照,可以记录和分享美照啦");
  481. GuideController.TryCompleteGuide(ConstGuideId.PHOTOGRAPH, 7);
  482. }
  483. }
  484. }