UICustom.cs 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.UI;
  5. using UnityGameFramework.Runtime;
  6. using GameFramework;
  7. using GameFramework.DataTable;
  8. using GameFramework.Sound;
  9. using GameFramework.Download;
  10. using GameFramework.FileSystem;
  11. using GameFramework.ObjectPool;
  12. using GameFramework.Resource;
  13. using System;
  14. using DG.Tweening;
  15. namespace MetaClient
  16. {
  17. public class UICustom : UGuiForm
  18. {
  19. // Start is called before the first frame update
  20. [Header("初始界面")]
  21. public GameObject toolView;
  22. [Header("基础按钮界面")]
  23. public GameObject baseView;
  24. [Header("保存按钮")]
  25. public GameObject saveBtn;
  26. [Header("捏脸界面")]
  27. public GameObject nieLianView;
  28. [Header("身体界面")]
  29. public GameObject bodyView;
  30. [Header("自定义")]
  31. public GameObject ziDingYiBtn;
  32. [Header("衣服界面")]
  33. public GameObject clothView;
  34. [Header("左边界面")]
  35. public GameObject leftView;
  36. [Header("右边界面")]
  37. public GameObject rightView;
  38. //[Header("点击后生成的按钮列表")]
  39. //public GameObject buttonList;
  40. [Header("白底背景")]
  41. public GameObject whitebg;
  42. [Header("按钮预制体")]
  43. public GameObject buttonItem;
  44. [Header("滑块")]
  45. public Scrollbar scrollbar;
  46. [Header("颜色选择界面")]
  47. public GameObject colorView;
  48. // [Header("顺序")]
  49. private EButtonShunXu eButtonShunXu = EButtonShunXu.None;
  50. [Header("颜色演示预制体")]
  51. public GameObject colItem;
  52. public float tween_leftMax = 0;
  53. public float tween_leftMin = -250;
  54. public float tween_rightMin = 0;
  55. public float tween_rightMax = 223;
  56. private float tween_saveBtnMax = 119;
  57. private float tween_saveBtnMin = -108;
  58. private float tweenTime = 0.5f;
  59. //private float tweenTime = 10;
  60. //private float tweenLeastTime = 0;
  61. public bool isTween = false;
  62. [Header("选择界面分支")]
  63. [SerializeField]
  64. private ECustomStyple eCustomStyple = ECustomStyple.None;
  65. [Header("历史记录用于回退")]
  66. [SerializeField]
  67. private List<string> histroy;
  68. //用来判断是否是例如颜色框 调色板等额外的弹窗;
  69. private bool histroyextra;
  70. private int part = 0;
  71. //[Header("接受到的数据")]
  72. //[SerializeField]
  73. private IDataTable<DRCustomBody> _bodydata;
  74. protected override void OnOpen(object userData)
  75. {
  76. base.OnOpen(userData);
  77. IDataTable<DRCustomBody> _data = GameEntry.DataTable.GetDataTable<DRCustomBody>();
  78. _bodydata = GameEntry.DataTable.GetDataTable<DRCustomBody>();
  79. }
  80. protected override void OnClose(bool isShutdown, object userData)
  81. {
  82. base.OnClose(isShutdown, userData);
  83. }
  84. public void ClickBotton(ECustomStyple eCustomStyple,int id,bool ziDingYi)
  85. {
  86. if (isTween)
  87. {
  88. return;
  89. }
  90. isTween = true;
  91. leftView.transform.DOLocalMoveX(tween_leftMin, tweenTime).SetEase(Ease.InOutBack).OnComplete(()=> {
  92. //whitebg.SetActive(bg);
  93. ClickBtnFun(eCustomStyple,id,ziDingYi);
  94. leftView.transform.DOLocalMoveX(0, tweenTime).SetEase(Ease.InOutBack).OnComplete(() => {
  95. isTween = false;
  96. Debug.Log("222");
  97. });
  98. });
  99. Debug.Log("333");
  100. rightView.transform.DOLocalMoveX(tween_rightMax, tweenTime).SetEase(Ease.InOutBack).OnComplete(() => {
  101. rightView.transform.DOLocalMoveX(0, tweenTime).SetEase(Ease.InOutBack).OnComplete(() => {
  102. });
  103. });
  104. }
  105. /// <summary>
  106. /// 设置是否已在缓动
  107. /// </summary>
  108. public void SetTween(bool _bo) {
  109. isTween = _bo;
  110. }
  111. /// <summary>
  112. /// 获取是否缓动
  113. /// </summary>
  114. public bool GetTween()
  115. {
  116. return isTween;
  117. }
  118. public void HistoryAdd(string _str) {
  119. histroy.Add(_str);
  120. }
  121. /// <summary>
  122. /// 滑块改变
  123. /// </summary>
  124. public void ScrollValueChange()
  125. {
  126. //Debug.Log(scrollbar.value);
  127. GameEntry.Event.Fire(this, CustomRoleBodyEventArgs.Create(part, new Vector3(scrollbar.value, 0, 0)));
  128. }
  129. public void BackBtnFun()
  130. {
  131. if (histroyextra)
  132. {
  133. BackExtraFun();
  134. histroyextra = false;
  135. return;
  136. }
  137. switch (this.histroy.Count)
  138. {
  139. case 0:
  140. Debug.Log("返回上一层");
  141. break;
  142. case 1:
  143. Debug.Log("返回选择捏脸/身体/服装");
  144. histroy.RemoveAt(histroy.Count - 1);
  145. Back_OneFun();
  146. break;
  147. case 2:
  148. Debug.Log("进入选择界面");
  149. histroy.RemoveAt(histroy.Count - 1);
  150. Back_TwoFun(true);
  151. break;
  152. default:
  153. Debug.Log("进入自定义或颜色");
  154. // histroy.RemoveAt(histroy.Count - 1);
  155. Back_ThreeFun();
  156. histroy.RemoveAt(histroy.Count - 1);
  157. break;
  158. }
  159. }
  160. void Back_OneFun() {
  161. ViewSetFalse();
  162. toolView.SetActive(true);
  163. //toolView.SetActive(true);
  164. //bodyView.SetActive(false);
  165. //nieLianView.SetActive(false);
  166. //clothView.SetActive(false);
  167. }
  168. void BackExtraFun()
  169. {
  170. rightView.SetActive(true);
  171. scrollbar.gameObject.SetActive(false);
  172. }
  173. void ViewSetFalse()
  174. {
  175. toolView.SetActive(false);
  176. bodyView.SetActive(false);
  177. nieLianView.SetActive(false);
  178. clothView.SetActive(false);
  179. }
  180. void BackView_Extra(GameObject _obj,bool _bo) {
  181. ViewSetFalse();
  182. _obj.SetActive(_bo);
  183. ViewSetChildTrue(_obj,_bo);
  184. }
  185. void ViewSetChildTrue(GameObject _obj,bool _bo)
  186. {
  187. _obj.transform.GetChild(0).gameObject.SetActive(_bo);
  188. _obj.transform.GetChild(0).gameObject.SetActive(_bo);
  189. _obj.transform.GetChild(2).gameObject.SetActive(!_bo);
  190. }
  191. void Back_TwoFun(bool _bo)
  192. {
  193. // int _choose = int.Parse(histroy[1]);
  194. // switch ((ECustomStyple)_choose)
  195. switch(eCustomStyple)
  196. {
  197. case ECustomStyple.Body:
  198. BackView_Extra(bodyView,_bo);
  199. break;
  200. case ECustomStyple.Cloth:
  201. BackView_Extra(clothView, _bo);
  202. break;
  203. case ECustomStyple.None:
  204. break;
  205. case ECustomStyple.NieLian:
  206. BackView_Extra(nieLianView, _bo);
  207. break;
  208. }
  209. //toolView.SetActive(true);
  210. //bodyView.SetActive(false);
  211. //nieLianView.SetActive(false);
  212. //clothView.SetActive(false);
  213. }
  214. void Back_ThreeFun()
  215. {
  216. string[] _strArrary = histroy[histroy.Count - 1].Split(',');
  217. if (_strArrary[0] == "Color")
  218. {
  219. colorView.SetActive(false);
  220. rightView.SetActive(true);
  221. }
  222. else if (_strArrary[0] == "ziDingyi")
  223. {
  224. int _chooseId = int.Parse(_strArrary[1]);
  225. ClickBtnFun(eCustomStyple, _chooseId, false);
  226. }
  227. else
  228. {
  229. Debug.Log("缺少当前情况需要添加>>>>");
  230. }
  231. //toolView.SetActive(true);
  232. //bodyView.SetActive(false);
  233. //nieLianView.SetActive(false);
  234. //clothView.SetActive(false);
  235. }
  236. /// <summary>
  237. /// 修改滑块
  238. /// </summary>
  239. public void SetValue(int _part,ECustomStyple eCustomStyple)
  240. {
  241. //scrollbar.value = _value;
  242. part = _part;
  243. scrollbar.value = CustomManager.Instance.GetBodyBoneValue(part);
  244. }
  245. /// <summary>
  246. /// 获得滑块值
  247. /// </summary>
  248. public float GetValue()
  249. {
  250. return scrollbar.value;
  251. }
  252. /// <summary>
  253. /// 按钮点击事件
  254. /// </summary>
  255. public void ClickBtnFun(ECustomStyple eCustomStyple,int id,bool zidingyi) {
  256. //if (isTween)
  257. //{
  258. // return;
  259. //}
  260. whitebg.SetActive(true);
  261. scrollbar.gameObject.SetActive(false);
  262. this.eCustomStyple = eCustomStyple;
  263. //ECustomStyple _eCustomStyple = (ECustomStyple)int.Parse(_objects[0].ToString());
  264. switch (eCustomStyple)
  265. {
  266. case ECustomStyple.None:
  267. break;
  268. case ECustomStyple.NieLian:
  269. GameObject _nieLianList = nieLianView.transform.GetChild(0).gameObject;
  270. _nieLianList.SetActive(false);
  271. GameObject _nieLianXX = nieLianView.transform.GetChild(2).gameObject;
  272. _nieLianXX.SetActive(true);
  273. //if (!zidingyi)
  274. //{
  275. // ZiDingYiNeiLian(eCustomStyple, id, _nieLianXX.transform.GetChild(0).gameObject);
  276. // return;
  277. //}
  278. CreateNieLianImg(id, zidingyi);
  279. break;
  280. case ECustomStyple.Body:
  281. GameObject _bodyList = bodyView.transform.GetChild(0).gameObject;
  282. _bodyList.SetActive(false);
  283. GameObject _bodyListXX =bodyView.transform.GetChild(2).gameObject;
  284. _bodyListXX.SetActive(true);
  285. //if (!zidingyi)
  286. //{
  287. // ZiDingYiBody(eCustomStyple, id, _bodyListXX.transform.GetChild(0).gameObject);
  288. // return;
  289. //}
  290. CreateBodyImg(id, zidingyi);
  291. break;
  292. case ECustomStyple.Cloth:
  293. GameObject _clothList = clothView.transform.GetChild(0).gameObject;
  294. _clothList.SetActive(false);
  295. GameObject _clothListXX = clothView.transform.GetChild(2).gameObject;
  296. _clothListXX.SetActive(true);
  297. //if (!zidingyi)
  298. //{
  299. // ZiDingYiCloth(eCustomStyple, id, _clothListXX.transform.GetChild(0).gameObject);
  300. // return;
  301. //}
  302. CreateClothImg(id, zidingyi);
  303. break;
  304. }
  305. }
  306. //public Action ActionFun() {
  307. // return null;
  308. //}
  309. private void RemoveAllChildren(GameObject parent)
  310. {
  311. Transform transform;
  312. for (int i = 0; i < parent.transform.childCount; i++)
  313. {
  314. transform = parent.transform.GetChild(i);
  315. GameObject.Destroy(transform.gameObject);
  316. }
  317. }
  318. //public void ZiDingYiNeiLian(ECustomStyple eCustomStyple, int id,GameObject _objPar) {
  319. // RemoveAllChildren(bodyView.transform.GetChild(2).GetChild(0).gameObject);
  320. // GameObject _obj = GameObject.Instantiate(ziDingYiBtn);
  321. // _obj.transform.SetParent(_objPar.transform);
  322. // UICustomBtn _uICustomBtn = _obj.GetComponent<UICustomBtn>();
  323. // _uICustomBtn.id = id;
  324. // _uICustomBtn.eCustomStyple = eCustomStyple;
  325. // _obj.SetActive(true);
  326. //}
  327. //public void ZiDingYiBody(ECustomStyple eCustomStyple, int id, GameObject _objPar)
  328. //{
  329. // RemoveAllChildren(bodyView.transform.GetChild(2).GetChild(0).gameObject);
  330. // GameObject _obj = GameObject.Instantiate(ziDingYiBtn);
  331. // _obj.transform.SetParent(_objPar.transform);
  332. // UICustomBtn _uICustomBtn = _obj.GetComponent<UICustomBtn>();
  333. // _uICustomBtn.id = id;
  334. // _uICustomBtn.eCustomStyple = eCustomStyple;
  335. // _obj.SetActive(true);
  336. //}
  337. //public void ZiDingYiCloth(ECustomStyple eCustomStyple, int id, GameObject _objPar)
  338. //{
  339. // RemoveAllChildren(bodyView.transform.GetChild(2).GetChild(0).gameObject);
  340. // GameObject _obj = GameObject.Instantiate(ziDingYiBtn);
  341. // _obj.transform.SetParent(_objPar.transform);
  342. // UICustomBtn _uICustomBtn = _obj.GetComponent<UICustomBtn>();
  343. // _uICustomBtn.id = id;
  344. // _uICustomBtn.eCustomStyple = eCustomStyple;
  345. // _obj.SetActive(true);
  346. //}
  347. public void CreateNieLianImg(int parentid, bool ziDingYi)
  348. {
  349. GameObject _objPar = bodyView.transform.GetChild(2).GetChild(0).gameObject;
  350. RemoveAllChildren(_objPar);
  351. //等有捏脸表时改为捏脸
  352. IDataTable<DRCustomBody> _data = GameEntry.DataTable.GetDataTable<DRCustomBody>();
  353. _bodydata = GameEntry.DataTable.GetDataTable<DRCustomBody>();
  354. int cengji = ziDingYi ?1:0;
  355. if (!ziDingYi)
  356. {
  357. CreateZDYFun(parentid, _objPar);
  358. //GameObject _obj = GameObject.Instantiate(ziDingYiBtn);
  359. //_obj.transform.SetParent(_objPar.transform);
  360. //UICustomBtn _uICustomBtn = _obj.GetComponent<UICustomBtn>();
  361. //ChangeUICustom(_uICustomBtn, parentid, eCustomStyple);
  362. //_uICustomBtn.id =parentid;
  363. //_uICustomBtn.eCustomStyple = eCustomStyple;
  364. //_obj.SetActive(true);
  365. }
  366. DRCustomBody[] dRCustomBodies = _bodydata.GetAllDataRows();
  367. for (int i = 0; i < dRCustomBodies.Length; i++)
  368. {
  369. Debug.Log(dRCustomBodies[i].Id);
  370. if (dRCustomBodies[i].ParentStyple == parentid&&dRCustomBodies[i].Cengji==cengji)
  371. {
  372. CreateButtonFun(dRCustomBodies[i].Icon, dRCustomBodies[i].Part, dRCustomBodies[i].Name, _objPar, dRCustomBodies[i].Id, dRCustomBodies[i].ButtonStyple, ECustomStyple.Body);
  373. }
  374. }
  375. // ChangeListBotton(_objPar);
  376. }
  377. public void CreateClothImg(int parentid,bool ziDingYi)
  378. {
  379. GameObject _objPar = bodyView.transform.GetChild(2).GetChild(0).gameObject;
  380. RemoveAllChildren(_objPar);
  381. //等有服装时改为服装
  382. IDataTable<DRCustomBody> _data = GameEntry.DataTable.GetDataTable<DRCustomBody>();
  383. _bodydata = GameEntry.DataTable.GetDataTable<DRCustomBody>();
  384. int cengji = ziDingYi ?1:0;
  385. if (!ziDingYi)
  386. {
  387. CreateZDYFun(parentid, _objPar);
  388. //GameObject _obj = GameObject.Instantiate(ziDingYiBtn);
  389. //_obj.transform.SetParent(_objPar.transform);
  390. //UICustomBtn _uICustomBtn = _obj.GetComponent<UICustomBtn>();
  391. //ChangeUICustom(_uICustomBtn, parentid, eCustomStyple);
  392. //_uICustomBtn.id = parentid;
  393. //_uICustomBtn.eCustomStyple = eCustomStyple;
  394. //_obj.SetActive(true);
  395. }
  396. DRCustomBody[] dRCustomBodies = _bodydata.GetAllDataRows();
  397. for (int i = 0; i < dRCustomBodies.Length; i++)
  398. {
  399. Debug.Log(dRCustomBodies[i].Id);
  400. if (dRCustomBodies[i].ParentStyple == parentid && dRCustomBodies[i].Cengji == cengji)
  401. {
  402. CreateButtonFun(dRCustomBodies[i].Icon, dRCustomBodies[i].Part, dRCustomBodies[i].Name, _objPar, dRCustomBodies[i].Id, dRCustomBodies[i].ButtonStyple, ECustomStyple.Body);
  403. }
  404. }
  405. // ChangeListBotton(_objPar);
  406. }
  407. private void CreateZDYFun(int parentid,GameObject _objPar)
  408. {
  409. GameObject _obj = GameObject.Instantiate(ziDingYiBtn);
  410. _obj.transform.SetParent(_objPar.transform);
  411. UICustomBtn _uICustomBtn = _obj.GetComponent<UICustomBtn>();
  412. ChangeUICustom(_uICustomBtn, parentid, eCustomStyple);
  413. }
  414. public void ChangeUICustom(UICustomBtn uICustomBtn,int id, ECustomStyple eCustomStyple)
  415. {
  416. uICustomBtn.id = id;
  417. uICustomBtn.eCustomStyple = eCustomStyple;
  418. uICustomBtn.gameObject.SetActive(true);
  419. }
  420. public void CreateBodyImg(int parentid,bool ziDingYi) {
  421. GameObject _objPar = bodyView.transform.GetChild(2).GetChild(0).gameObject;
  422. RemoveAllChildren(_objPar);
  423. IDataTable<DRCustomBody> _data = GameEntry.DataTable.GetDataTable<DRCustomBody>();
  424. _bodydata = GameEntry.DataTable.GetDataTable<DRCustomBody>();
  425. int cengji = ziDingYi ?1:0;
  426. if (!ziDingYi)
  427. {
  428. CreateZDYFun(parentid, _objPar);
  429. //GameObject _obj = GameObject.Instantiate(ziDingYiBtn);
  430. //_obj.transform.SetParent(_objPar.transform);
  431. //UICustomBtn _uICustomBtn = _obj.GetComponent<UICustomBtn>();
  432. //ChangeUICustom(_uICustomBtn, parentid, eCustomStyple);
  433. //_uICustomBtn.id = parentid;
  434. //_uICustomBtn.eCustomStyple = eCustomStyple;
  435. //_obj.SetActive(true);
  436. }
  437. DRCustomBody[] dRCustomBodies = _bodydata.GetAllDataRows();
  438. for (int i = 0; i < dRCustomBodies.Length; i++)
  439. {
  440. Debug.Log(dRCustomBodies[i].Id);
  441. if (dRCustomBodies[i].ParentStyple == parentid && dRCustomBodies[i].Cengji == cengji)
  442. {
  443. CreateButtonFun(dRCustomBodies[i].Icon, dRCustomBodies[i].Part, dRCustomBodies[i].Name, _objPar, dRCustomBodies[i].Id, dRCustomBodies[i].ButtonStyple, ECustomStyple.Body);
  444. }
  445. }
  446. // ChangeListBotton(_objPar);
  447. }
  448. /// <summary>
  449. /// 改变列表长短
  450. /// </summary>
  451. public void ChangeListBotton(GameObject _obj) {
  452. //Debug.Log("改变列表"+ _obj.transform.childCount+"");
  453. float _x = _obj.GetComponent<RectTransform>().offsetMin.x;
  454. int _childNum = _obj.transform.childCount;
  455. float _y = _childNum > 8 ? -240 * (_childNum - 8) : 0;
  456. _obj.GetComponent<RectTransform>().offsetMax = new Vector2(_x, 0);
  457. _obj.GetComponent<RectTransform>().offsetMin = new Vector2(_x, _y);
  458. }
  459. //private IEnumerator Tween(Action _action) {
  460. // for (int i = 0; i < 100; i++)
  461. // {
  462. // float _value = i / 100;
  463. // float _right=Mathf.Lerp(tween_rightMax, tween_rightMin, _value);
  464. // float _left= Mathf.Lerp(tween_leftMix, tween_rightMax, _value);
  465. // clothView.GetComponent<RectTransform>().SetPositionX(_right);
  466. // toolView.GetComponent<RectTransform>().SetPositionX(_right);
  467. // bodyView.GetComponent<RectTransform>().SetPositionX(_right);
  468. // nieLianView.GetComponent<RectTransform>().SetPositionX(_right);
  469. // baseView.GetComponent<RectTransform>().SetPositionX(_left);
  470. // }
  471. // yield return null;
  472. //}
  473. protected override void OnUpdate(float elapseSeconds, float realElapseSeconds)
  474. {
  475. base.OnUpdate(elapseSeconds, realElapseSeconds);
  476. }
  477. //private void CreateNieLianFun(object[] _objects) {
  478. // ENieLianStyple _eNieLianStyple = (ENieLianStyple)int.Parse(_objects[1].ToString());
  479. // switch (_eNieLianStyple)
  480. // {
  481. // case ENieLianStyple.faxing:
  482. // break;
  483. // case ENieLianStyple.lianxing:
  484. // break;
  485. // case ENieLianStyple.yankuang:
  486. // break;
  487. // case ENieLianStyple.tongkong:
  488. // break;
  489. // case ENieLianStyple.meimao:
  490. // break;
  491. // case ENieLianStyple.bizi:
  492. // break;
  493. // case ENieLianStyple.erduo:
  494. // break;
  495. // case ENieLianStyple.zuiba:
  496. // break;
  497. // case ENieLianStyple.fuse:
  498. // break;
  499. // }
  500. // //switch()
  501. //}
  502. private void CreateButtonFun(string path,int _part,string _name, GameObject _parent,int _id,int buttonstyple,ECustomStyple eCustomStyple) {
  503. //Debug.Log(path);
  504. // Debug.Log(_parent);
  505. path = "CustomRole/" + path;
  506. GameEntry.Resource.LoadAsset(AssetUtility.GetUISpriteAsset(path), new LoadAssetCallbacks(
  507. (assetName, asset, duration, userData) =>
  508. {
  509. // Debug.Log(path);
  510. // Debug.Log(_parent);
  511. Texture2D tex = (Texture2D)asset;
  512. var sprite = Sprite.Create(tex, new Rect(0, 0, tex.width, tex.height), Vector2.zero);
  513. GameObject _obj = GameObject.Instantiate(buttonItem);
  514. Image _objImg = _obj.transform.GetComponent<Image>();
  515. _obj.SetActive(true);
  516. _objImg.sprite = sprite;
  517. _obj.name = part+"";
  518. _obj.transform.SetParent(_parent.transform);
  519. UICustomBtn uICustomBtn = _obj.GetComponent<UICustomBtn>();
  520. uICustomBtn.id = _id;
  521. uICustomBtn.eButtonStyple = (EButtonStyple)buttonstyple;
  522. uICustomBtn.eCustomStyple = eCustomStyple;
  523. uICustomBtn.isCreate = false;
  524. uICustomBtn.part = _part;
  525. //GameObject
  526. //img.sprite = sprite;
  527. //if (nativeSize)
  528. //{
  529. // img.SetNativeSize();
  530. //}
  531. ChangeListBotton(_parent);
  532. }));
  533. }
  534. //public void NieLian() {
  535. //}
  536. public void ClickFaceChangeBtn()
  537. {
  538. GameEntry.Event.Fire(this, CustomRoleFaceEventArgs.Create(EditableFacePart.eye, new Vector3(1, 0, 0)));
  539. }
  540. }
  541. public enum ECustomStyple
  542. {
  543. None,
  544. NieLian,
  545. Body,
  546. Cloth
  547. }
  548. public enum EButtonStyple
  549. {
  550. Button,
  551. Scroll,
  552. TiaoSe,
  553. NorButton,
  554. Back
  555. }
  556. public enum ENieLianStyple {
  557. None,
  558. faxing,
  559. lianxing,
  560. yankuang,
  561. tongkong,
  562. meimao,
  563. bizi,
  564. erduo,
  565. zuiba,
  566. fuse
  567. }
  568. public enum EButtonShunXu {
  569. None,
  570. First,
  571. Second,
  572. Third
  573. }
  574. public enum ETSStyple {
  575. None,
  576. ViewOpen,
  577. Close,
  578. Sure,
  579. Open
  580. }
  581. }