DressUpObj.cs 24 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707
  1. using System.Collections.Generic;
  2. using UnityEngine;
  3. using System;
  4. using System.Linq;
  5. using ET;
  6. using FairyGUI;
  7. namespace GFGGame
  8. {
  9. public enum DressUpOption
  10. {
  11. Auto,
  12. Add,
  13. Remove
  14. }
  15. public class DressUpObj
  16. {
  17. public int bgId
  18. {
  19. get
  20. {
  21. return _dressUpData.bgId;
  22. }
  23. }
  24. public int suitId
  25. {
  26. get
  27. {
  28. return _dressUpData.suitId;
  29. }
  30. }
  31. public int actionId
  32. {
  33. get
  34. {
  35. return _dressUpData.actionId;
  36. }
  37. }
  38. public bool IsAction
  39. {
  40. get
  41. {
  42. return _dressUpData.actionId > 0;
  43. }
  44. }
  45. public List<int> itemList
  46. {
  47. get
  48. {
  49. return _dressUpData.itemList.ToList();
  50. }
  51. }
  52. /// <summary>
  53. ///
  54. /// </summary>
  55. /// <param name="sceneObj"></param>
  56. /// <param name="needSetMask"></param>
  57. /// <param name="showSceneType"></param>
  58. /// <param name="roleObj"></param>
  59. /// <param name="showBg"></param>
  60. /// <param name="resetData">是否重置装备数据</param>
  61. public void setSceneObj(GameObject sceneObj, bool needSetMask = false, bool showSceneType = true, GameObject roleObj = null, bool showBg = true)
  62. {
  63. if (_sceneObj != null && _sceneObj != sceneObj)
  64. {
  65. GameObject.Destroy(_sceneObj);
  66. }
  67. _sceneObj = sceneObj;
  68. _needSetMask = needSetMask;
  69. _showSceneType = showSceneType;
  70. _showBg = showBg;
  71. _roleObj = roleObj;
  72. if (_dressUpData.IsNew)
  73. {
  74. PutOnDefaultDressUpData();
  75. }
  76. else
  77. {
  78. var tempData = DressUpDataClone();
  79. TakeOffAll();
  80. PutOnDressUpData(tempData);
  81. }
  82. Timers.inst.AddUpdate(OnUpdate);
  83. }
  84. public DressUpData DressUpDataClone()
  85. {
  86. return _dressUpData.Clone();
  87. }
  88. public void Dispose()
  89. {
  90. _sceneObj = null;
  91. _dressUpData = null;
  92. }
  93. //传入一个服装部件Id,判断是否有与此部件同类型服装已穿着
  94. public bool CheckSameTypeIsOn(int itemId)
  95. {
  96. int subType = ItemUtilCS.GetItemSubType(itemId);
  97. for (int i = 0; i < _dressUpData.itemList.Count; i++)
  98. {
  99. int _subType = ItemUtilCS.GetItemSubType(_dressUpData.itemList[i]);
  100. if (subType == _subType) return true;
  101. }
  102. return false;
  103. }
  104. /// <summary>
  105. /// 仅判断换装部件是否已穿着
  106. /// </summary>
  107. /// <param name="itemId"></param>
  108. /// <returns></returns>
  109. public bool CheckDressUpItemIsOn(int itemId)
  110. {
  111. if (itemId == _dressUpData.bgId)
  112. {
  113. return true;
  114. }
  115. return _dressUpData.itemList.Contains(itemId);
  116. }
  117. /// <summary>
  118. /// 仅判断套装是否穿上
  119. /// </summary>
  120. /// <param name="id"></param>
  121. /// <returns></returns>
  122. public bool CheckSuitIsOn(int id)
  123. {
  124. SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(id);
  125. if (suitCfg == null)
  126. {
  127. return false;
  128. }
  129. int[] items = suitCfg.partsArr;
  130. foreach (int itemId in items)
  131. {
  132. if (_dressUpData.actionId == id)
  133. {
  134. if (SuitCfgArray.Instance.CheckActionContainsItem(itemId, id))
  135. {
  136. continue;
  137. }
  138. }
  139. bool isOn = CheckDressUpItemIsOn(itemId);
  140. if (!isOn)
  141. {
  142. return false;
  143. }
  144. }
  145. return true;
  146. }
  147. public void AddOrRemove(int itemId, bool checkDefault, DressUpOption dressUpOption = DressUpOption.Auto)
  148. {
  149. int subType = ItemUtilCS.GetItemSubType(itemId);
  150. if (subType == ConstDressUpItemType.BEI_JING)
  151. {
  152. if (!_showBg)
  153. {
  154. return;
  155. }
  156. _dressUpData.bgId = itemId;
  157. List<DressUpLayerOperation> handlers = DressUpUtil.AddItemAsync(_dressUpData.bgId, _sceneObj, _needSetMask, true, _roleObj);
  158. TryAddHandlers(handlers);
  159. }
  160. else
  161. {
  162. if (!CheckDressUpItemIsOn(itemId))
  163. {
  164. if (dressUpOption != DressUpOption.Remove)
  165. {
  166. if (checkDefault)
  167. {
  168. TryCancelActionWhenPutOn(itemId);
  169. }
  170. CheckRemoveSameType(subType);
  171. Add(itemId);
  172. }
  173. }
  174. else
  175. {
  176. if (dressUpOption != DressUpOption.Add)
  177. {
  178. Remove(itemId);
  179. }
  180. }
  181. if (checkDefault)
  182. {
  183. checkDefaultItem();
  184. }
  185. }
  186. }
  187. //脱掉所有换装,换成默认装(不处理背景)
  188. public void TakeOffAll(bool checkDefault = true)
  189. {
  190. _dressUpData.suitId = 0;
  191. _dressUpData.actionId = 0;
  192. foreach (int itemID in itemList)
  193. {
  194. AddOrRemove(itemID, false, DressUpOption.Remove);
  195. }
  196. if (checkDefault)
  197. {
  198. checkDefaultItem();
  199. }
  200. RoleLevelCfg roleLevelCfg = RoleLevelCfgArray.Instance.GetCfg(GameGlobal.myNumericComponent.GetAsInt(NumericType.Lvl));
  201. // FightDataManager.Instance.score = roleLevelCfg.baseScore;
  202. // foreach (int itemId in _dressUpData.itemList)
  203. // {
  204. // FightDataManager.Instance.score += ItemDataManager.GetItemAdditionScore(itemId, InstanceZonesDataManager.currentScoreType, InstanceZonesDataManager.currentFightTags);
  205. // }
  206. }
  207. //穿上或脱掉一个动作
  208. public void PutOnOrTakeOffAction(int actionId)
  209. {
  210. if (_dressUpData.actionId == actionId)
  211. {
  212. CancelAction();
  213. }
  214. else
  215. {
  216. PutOnAction(actionId);
  217. }
  218. }
  219. /// <summary>
  220. /// 尝试穿戴配置套装
  221. /// </summary>
  222. /// <param name="suitId">套装id</param>
  223. /// <param name="tryShowAction">尝试穿上动作</param>
  224. /// <param name="excludeType">排除类型列表</param>
  225. /// <param name="showOptional">是否显示可选部件</param>
  226. /// <param name="CheckOwn">是否只显示主角拥有的部件</param>
  227. public void PutOnSuitCfg(int suitId, bool tryShowAction, int[] excludeType = null, bool showOptional = true, bool CheckOwn = true)
  228. {
  229. SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(suitId);
  230. if(suitCfg == null)
  231. {
  232. return;
  233. }
  234. bool oldIsAction = IsAction;
  235. _dressUpData.suitId = suitId;
  236. bool hasSuitActionRes = DressUpMenuSuitDataManager.CheckSuitHasActionRes(_dressUpData.suitId);
  237. _dressUpData.actionId = (hasSuitActionRes && tryShowAction) ? suitId : 0;
  238. List<int> items = new List<int>(suitCfg.partsArr);
  239. if (showOptional)
  240. {
  241. if (suitCfg.partsOptionalArr != null && suitCfg.partsOptionalArr.Length > 0)
  242. {
  243. items.AddRange(suitCfg.partsOptionalArr);
  244. }
  245. }
  246. int subType = 0;
  247. //找到要穿的散件
  248. List<int> targetItemList = new List<int>();
  249. foreach (int itemId in items)
  250. {
  251. if (!CheckOwn || DressUpMenuItemDataManager.CheckHasItem(itemId))
  252. {
  253. subType = ItemUtilCS.GetItemSubType(itemId);
  254. bool notInAction = SuitCfgArray.Instance.CheckItemNotInAction(itemId);
  255. if (!IsAction || notInAction)
  256. {
  257. if (excludeType == null || Array.IndexOf(excludeType, subType) < 0)
  258. {
  259. targetItemList.Add(itemId);
  260. }
  261. }
  262. }
  263. }
  264. CompareAndAddItemList(oldIsAction, IsAction, targetItemList);
  265. checkDefaultItem();
  266. }
  267. //取消动作
  268. public void CancelAction(bool changeToStand = false)
  269. {
  270. if (_dressUpData.actionId <= 0)
  271. {
  272. return;
  273. }
  274. var tempActionId = _dressUpData.actionId;
  275. _dressUpData.actionId = 0;
  276. //更新非场景类型部件形态
  277. foreach (int itemId in itemList)
  278. {
  279. if (!DressUpMenuItemCfg1Array.Instance.CheckIsSceneType(itemId))
  280. {
  281. //场景类型不受动作影响并且本来就有动画,对非场景类型处理
  282. bool notInAction = SuitCfgArray.Instance.CheckItemNotInAction(itemId);
  283. if (notInAction)
  284. {
  285. //更新成图片模式
  286. Update(itemId);
  287. }
  288. }
  289. }
  290. if (changeToStand)
  291. {
  292. SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(tempActionId);
  293. List<int> items = new List<int>(suitCfg.partsArr);
  294. if (suitCfg.partsOptionalArr != null && suitCfg.partsOptionalArr.Length > 0)
  295. {
  296. items.AddRange(suitCfg.partsOptionalArr);
  297. }
  298. foreach (int itemId in items)
  299. {
  300. if (DressUpMenuItemDataManager.CheckHasItem(itemId))
  301. {
  302. bool notInAction = SuitCfgArray.Instance.CheckItemNotInAction(itemId);
  303. if (!notInAction)
  304. {
  305. AddOrRemove(itemId, false, DressUpOption.Add);
  306. }
  307. }
  308. }
  309. }
  310. checkDefaultItem();
  311. }
  312. //穿戴一组换装数据
  313. public void PutOnDressUpData(DressUpData targetDressUpData, int[] excludeType = null)
  314. {
  315. bool oldIsAction = IsAction;
  316. _dressUpData.suitId = targetDressUpData.suitId;
  317. _dressUpData.actionId = targetDressUpData.actionId;
  318. var targetItemList = new List<int>();
  319. foreach(var itemId in targetDressUpData.itemList)
  320. {
  321. int subType = ItemUtilCS.GetItemSubType(itemId);
  322. if (excludeType == null || Array.IndexOf(excludeType, subType) < 0)
  323. {
  324. targetItemList.Add(itemId);
  325. }
  326. }
  327. if (targetDressUpData.bgId > 0 && (excludeType == null || Array.IndexOf(excludeType, ConstDressUpItemType.BEI_JING) < 0))
  328. {
  329. targetItemList.Add(targetDressUpData.bgId);
  330. }
  331. CompareAndAddItemList(oldIsAction, IsAction, targetItemList);
  332. checkDefaultItem();
  333. }
  334. //穿戴默认换装数据
  335. public void PutOnDefaultDressUpData(bool bgType = false)
  336. {
  337. var dressUpData = DressUpData.CreateDefault();
  338. if (bgType) {
  339. dressUpData.bgId = 180002;
  340. }
  341. PutOnDressUpData(dressUpData);
  342. }
  343. //穿戴一组散件数据(会脱掉不包含的部分)
  344. public void PutOnItemList(List<int> targetItemList)
  345. {
  346. bool oldIsAction = IsAction;
  347. _dressUpData.suitId = 0;
  348. _dressUpData.actionId = 0;
  349. CompareAndAddItemList(oldIsAction, IsAction, targetItemList);
  350. checkDefaultItem();
  351. }
  352. #region private
  353. private GameObject _sceneObj;
  354. private GameObject _roleObj;
  355. private bool _needSetMask;
  356. private bool _showSceneType = true;
  357. private bool _showBg = true;
  358. private DressUpData _dressUpData = new DressUpData();
  359. private List<DressUpOperationBase> handlers = new List<DressUpOperationBase>();
  360. //穿上一个动作
  361. private void PutOnAction(int actionId)
  362. {
  363. bool hasSuitActionRes = DressUpMenuSuitDataManager.CheckSuitHasActionRes(actionId);
  364. _dressUpData.actionId = actionId;
  365. if (hasSuitActionRes)
  366. {
  367. foreach (int itemId in itemList)
  368. {
  369. if (!DressUpMenuItemCfg1Array.Instance.CheckIsSceneType(itemId))
  370. {
  371. //场景类型不受动作影响并且本来就有动画,对非场景类型处理
  372. bool notInAction = SuitCfgArray.Instance.CheckItemNotInAction(itemId);
  373. if (notInAction)
  374. {
  375. //更新成动画模式
  376. Update(itemId);
  377. }
  378. else
  379. {
  380. AddOrRemove(itemId, false, DressUpOption.Remove);
  381. }
  382. }
  383. }
  384. }
  385. else
  386. {
  387. CancelAction(true);
  388. }
  389. checkDefaultItem();
  390. }
  391. //当穿一件部件时检查是否需要取消动作,如果需要则取消该动作
  392. private void TryCancelActionWhenPutOn(int itemId)
  393. {
  394. if (_dressUpData.actionId > 0)
  395. {
  396. bool replaceableByAction = SuitCfgArray.Instance.CheckItemReaplaceableOnAction(itemId, _dressUpData.actionId);
  397. if (!replaceableByAction)
  398. {
  399. CancelAction();
  400. _dressUpData.actionId = 0;
  401. }
  402. }
  403. }
  404. private void Add(int itemId)
  405. {
  406. if (!_showSceneType)
  407. {
  408. if (DressUpMenuItemCfg1Array.Instance.CheckIsSceneType(itemId))
  409. {
  410. return;
  411. }
  412. }
  413. if (!_dressUpData.itemList.Contains(itemId))
  414. {
  415. _dressUpData.itemList.Add(itemId);
  416. Update(itemId);
  417. }
  418. }
  419. private void Update(int itemId)
  420. {
  421. bool showAni = IsAction || DressUpMenuItemCfg1Array.Instance.CheckIsSceneType(itemId);
  422. var handlers = DressUpUtil.AddItemAsync(itemId, _sceneObj, _needSetMask, showAni, _roleObj);
  423. TryAddHandlers(handlers);
  424. }
  425. private void Remove(int itemId)
  426. {
  427. if (_dressUpData.itemList == null)
  428. {
  429. return;
  430. }
  431. if (_dressUpData.itemList.Contains(itemId))
  432. {
  433. _dressUpData.itemList.Remove(itemId);
  434. var handler = DressUpUtil.RemoveItemAsync(itemId, _sceneObj, _roleObj);
  435. TryAddHandler(handler);
  436. }
  437. }
  438. private void CheckRemoveSameType(int type)
  439. {
  440. int count = 0;
  441. int firstTeshuId = 0;
  442. for (int i = 0; i < _dressUpData.itemList.Count; i++)
  443. {
  444. int itemID = (int)_dressUpData.itemList[i];
  445. int subType = ItemUtilCS.GetItemSubType(itemID);
  446. if (subType == type
  447. || (type == ConstDressUpItemType.LIAN_YI_QUN && (subType == ConstDressUpItemType.SHANG_YI || subType == ConstDressUpItemType.XIA_ZHUANG || subType == ConstDressUpItemType.NEI_DA))
  448. || (type == ConstDressUpItemType.SHANG_YI && subType == ConstDressUpItemType.LIAN_YI_QUN)
  449. || (type == ConstDressUpItemType.XIA_ZHUANG && subType == ConstDressUpItemType.LIAN_YI_QUN)
  450. || (type == ConstDressUpItemType.NEI_DA && subType == ConstDressUpItemType.LIAN_YI_QUN))
  451. {
  452. Remove(itemID);
  453. i--;
  454. }
  455. if (subType > ConstDressUpItemType.TE_SHU)
  456. {
  457. if (count == 0)
  458. {
  459. firstTeshuId = itemID;
  460. }
  461. count++;
  462. }
  463. }
  464. if (type > ConstDressUpItemType.TE_SHU && count >= 3)
  465. {
  466. //特殊饰品最多穿三件,第四件会自动顶掉第一件
  467. Remove(firstTeshuId);
  468. }
  469. }
  470. //与身上的散件对比差异然后添加
  471. private void CompareAndAddItemList(bool oldIsAction, bool newIsAction, List<int> targetItemList)
  472. {
  473. bool actionStatusChanged = (oldIsAction && !newIsAction) || (!oldIsAction && newIsAction);
  474. foreach (int itemID in itemList)
  475. {
  476. if (!targetItemList.Contains(itemID))
  477. {
  478. //移除不穿的部件
  479. AddOrRemove(itemID, false, DressUpOption.Remove);
  480. }
  481. else if (actionStatusChanged)
  482. {
  483. //当动画形态切换时
  484. if (!DressUpMenuItemCfg1Array.Instance.CheckIsSceneType(itemID))
  485. {
  486. //非场景类型重穿
  487. Update(itemID);
  488. targetItemList.Remove(itemID);
  489. }
  490. }
  491. }
  492. foreach (int itemID in targetItemList)
  493. {
  494. AddOrRemove(itemID, false, DressUpOption.Add);
  495. }
  496. }
  497. //检测当前穿戴是否是一件完整套装,且只穿了一件套装,返回套装id
  498. private int CheckCurDressIsSuit()
  499. {
  500. var suitId = 0;
  501. var suitIdList = new List<int>();
  502. for (int i = 0; i < _dressUpData.itemList.Count; i++)
  503. {
  504. int itemSuitId = SuitCfgArray.Instance.GetSuitIdOfItem(_dressUpData.itemList[i]);
  505. if (!suitIdList.Contains(itemSuitId))
  506. {
  507. suitIdList.Add(itemSuitId);
  508. }
  509. }
  510. foreach (var itemSuitId in suitIdList)
  511. {
  512. if (CheckSuitIsOn(itemSuitId))
  513. {
  514. suitId = itemSuitId;
  515. break;
  516. }
  517. }
  518. _dressUpData.suitId = suitId;
  519. return _dressUpData.suitId;
  520. }
  521. private void checkDefaultItem()
  522. {
  523. //是否有头发
  524. bool hasFaXing = false;
  525. //检查默认资源
  526. //是否有连衣裙
  527. bool hasLianYiQun = false;
  528. //是否有内搭
  529. bool hasNeiDa = false;
  530. //是否有上衣
  531. bool hasShangYi = false;
  532. //是否有下装
  533. bool hasXiaZhuang = false;
  534. //是否有默认内搭
  535. bool hasNeiDaDefault = false;
  536. //是否有默认下装
  537. bool hasXiaZhuangDefault = false;
  538. //是否有妆容
  539. bool hasZhuangRong = false;
  540. for (int i = 0; i < _dressUpData.itemList.Count; i++)
  541. {
  542. int itemID = (int)_dressUpData.itemList[i];
  543. int subType = ItemUtilCS.GetItemSubType(itemID);
  544. if (subType == (int)ConstDressUpItemType.FA_XING)
  545. {
  546. hasFaXing = true;
  547. }
  548. else if (subType == ConstDressUpItemType.LIAN_YI_QUN)
  549. {
  550. hasLianYiQun = true;
  551. }
  552. else if (subType == ConstDressUpItemType.NEI_DA)
  553. {
  554. hasNeiDa = true;
  555. }
  556. else if (subType == ConstDressUpItemType.XIA_ZHUANG)
  557. {
  558. hasXiaZhuang = true;
  559. }
  560. else if (subType == ConstDressUpItemType.SHANG_YI)
  561. {
  562. hasShangYi = true;
  563. }
  564. else if (subType == ConstDressUpItemType.ZHUANG_RONG)
  565. {
  566. hasZhuangRong = true;
  567. }
  568. if (itemID == ConstItemID.DEFULT_NEI_DA)
  569. {
  570. hasNeiDaDefault = true;
  571. }
  572. else if (itemID == ConstItemID.DEFULT_XIA_ZHUANG)
  573. {
  574. hasXiaZhuangDefault = true;
  575. }
  576. }
  577. if (!hasFaXing)
  578. {
  579. Add(ConstItemID.DEFULT_FA_XING);
  580. }
  581. if (!IsAction)
  582. {
  583. if (!hasLianYiQun)
  584. {
  585. if (!hasShangYi && (!hasNeiDa || hasNeiDaDefault) && (!hasXiaZhuang || hasXiaZhuangDefault))
  586. {
  587. Remove(ConstItemID.DEFULT_XIA_ZHUANG);
  588. Remove(ConstItemID.DEFULT_NEI_DA);
  589. Add(ConstItemID.DEFULT_LIAN_YI_QUN);
  590. }
  591. else
  592. {
  593. if (!hasXiaZhuang)
  594. {
  595. Add(ConstItemID.DEFULT_XIA_ZHUANG);
  596. }
  597. if (!hasNeiDa)
  598. {
  599. Add(ConstItemID.DEFULT_NEI_DA);
  600. }
  601. }
  602. }
  603. }
  604. CheckCurDressIsSuit();
  605. var handler = DressUpUtil.UpdateHeadAsync(!hasZhuangRong, _sceneObj, _needSetMask, _roleObj);
  606. TryAddHandler(handler);
  607. UpdateBodyView();
  608. }
  609. //更新整个身体
  610. private void UpdateBodyView()
  611. {
  612. string actionRes = null;
  613. if (IsAction)
  614. {
  615. SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(_dressUpData.actionId);
  616. var hasAniRes = ResPathUtil.CheckDressUpAnimationResExist(suitCfg.aniRes);
  617. actionRes = hasAniRes ? suitCfg.aniRes : null;
  618. }
  619. var handler = DressUpUtil.UpdateBodyAsync(actionRes, _sceneObj, _needSetMask, _roleObj);
  620. TryAddHandler(handler);
  621. }
  622. private void OnUpdate(object param = null)
  623. {
  624. if(handlers != null && handlers.Count > 0)
  625. {
  626. bool draw = true;
  627. foreach(var handler in handlers)
  628. {
  629. if(!handler.IsDone)
  630. {
  631. draw = false;
  632. }
  633. }
  634. if(draw)
  635. {
  636. var t = handlers.ToArray();
  637. handlers.Clear();
  638. foreach (var handler in t)
  639. {
  640. handler.UpdateView();
  641. handler.Release();
  642. }
  643. //Debug.Log($"draw {TimeHelper.ClientNow()}");
  644. }
  645. }
  646. }
  647. private void TryAddHandlers(List<DressUpLayerOperation> handlers)
  648. {
  649. if (handlers != null)
  650. {
  651. this.handlers.AddRange(handlers);
  652. //OnUpdate();
  653. }
  654. }
  655. private void TryAddHandler(DressUpOperationBase handler)
  656. {
  657. if (handler != null)
  658. {
  659. this.handlers.Add(handler);
  660. //OnUpdate();
  661. }
  662. }
  663. #endregion
  664. }
  665. }