| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176 | 
							- using UI.CommonGame;
 
- using FairyGUI;
 
- using UnityEngine;
 
- using static UnityEditor.Progress;
 
- namespace GFGGame
 
- {
 
-     public class GetSuitItemVIew : BaseWindow
 
-     {
 
-         private UI_GetSuitItemUI _ui;
 
-         private GameObject _scenePrefab;
 
-         private GameObject _sceneObject;
 
-         private GoWrapper _wrapper;
 
-         private int guideId = 0;//0:没有引导 1:首次获得套装2:首次获得套装部件
 
-         public override void Dispose()
 
-         {
 
-             if (_scenePrefab != null)
 
-             {
 
-                 GameObject.Destroy(_scenePrefab);
 
-                 _scenePrefab = null;
 
-             }
 
-             base.Dispose();
 
-         }
 
-         protected override void OnInit()
 
-         {
 
-             base.OnInit();
 
-             _ui = UI_GetSuitItemUI.Create();
 
-             this.viewCom = _ui.target;
 
-             isfullScreen = true;
 
-             _scenePrefab = GFGAsset.Load<GameObject>(ResPathUtil.GetPrefabPath("SceneDressUp"));
 
-             _ui.m_bg.onClick.Add(OnClickBg);
 
-         }
 
-         protected override void OnShown()
 
-         {
 
-             base.OnShown();
 
-             int itemId = (int)viewData;
 
-             guideId = 0;
 
-             UpdateView(itemId);
 
-             Timers.inst.AddUpdate(UpdateToCheckGuide);
 
-         }
 
-         protected override void OnHide()
 
-         {
 
-             base.OnHide();
 
-             if (_sceneObject != null)
 
-             {
 
-                 GameObject.Destroy(_sceneObject);
 
-                 _sceneObject = null;
 
-             }
 
-             if (_wrapper != null)
 
-             {
 
-                 _wrapper.wrapTarget = null;
 
-             }
 
-             if (this.viewCom == null || this.viewCom.root == null)
 
-             {
 
-                 Timers.inst.CallLater((object param) =>
 
-                 {
 
-                     GetSuitItemController.TryShow(0);
 
-                 });
 
-             }
 
-             GuideController.HideGuide();
 
-             GuideController.TryCompleteGuide(ConstGuideId.GET_SUIT_ITEM_VIEW_FIRST);
 
-             GuideController.TryCompleteGuide(ConstGuideId.GET_SUIT_ITEM_VIEW_FULL);
 
-             Timers.inst.Remove(UpdateToCheckGuide);
 
-             TryCompleteGuide();
 
-         }
 
-         private void OnClickBg()
 
-         {
 
-             int itemId = GetSuitItemController.TryShow(0);
 
-             if (itemId > 0)
 
-             {
 
-                 GuideController.HideGuide();
 
-                 GuideController.TryCompleteGuide(ConstGuideId.GET_SUIT_ITEM_VIEW_FIRST);
 
-                 GuideController.TryCompleteGuide(ConstGuideId.GET_SUIT_ITEM_VIEW_FULL);
 
-                 UpdateView(itemId);
 
-             }
 
-             else
 
-             {
 
-                 Hide();
 
-             }
 
-         }
 
-         private void UpdateItem(int itemdId)
 
-         {
 
-             UI_LuckyBoxBonusItem itemUI = _ui.m_item;
 
-             ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemdId);
 
-             itemUI.m_icon.url = ResPathUtil.GetIconPath(itemCfg);
 
-             string itemName = itemCfg.name;
 
-             itemUI.m_txtName.text = itemName;
 
-             RarityIconController.UpdateRarityIcon(itemUI.m_rarity, itemdId, false);
 
-             itemUI.target.data = itemdId;
 
-             itemUI.target.onClick.Clear();
 
-             itemUI.target.onClick.Add(OnClickItemUI);
 
-         }
 
-         private void OnClickItemUI(EventContext context)
 
-         {
 
-             GComponent item = context.sender as GComponent;
 
-             int itemID = (int)item.data;
 
-             GoodsItemTipsController.ShowItemTips(itemID);
 
-         }
 
-         private void UpdateView(int itemId)
 
-         {
 
-             int count = 0;
 
-             int totalCount = 1;
 
-             int suitId = 0;
 
-             int[] itemIds = null;
 
-             DressUpMenuSuitDataManager.GetSuitProgressByItemId(itemId, out suitId, out count);
 
-             totalCount = SuitCfgManager.Instance.GetTotalCountOfOneSuit(suitId);
 
-             itemIds = SuitCfgManager.Instance.GetSuitItems(suitId);
 
-             if (suitId > 0)
 
-             {
 
-                 SuitCfg suitCfg = SuitCfgArray.Instance.GetCfg(suitId);
 
-                 _ui.m_txtName.text = "套装·" + suitCfg.name;
 
-                 int targetY = (int)(_ui.m_item.target.y + _ui.m_item.target.height + 50);
 
-                 if (count == totalCount)
 
-                 {
 
-                     guideId = 1;
 
-                     GuideController.TryGuideByGuideId(null, ConstGuideId.GET_SUIT_ITEM_VIEW_FULL, 1, false, "恭喜你,集齐了第一套套装,快去换装界面穿上试试吧!点击空白区域继续", targetY);
 
-                 }
 
-                 else
 
-                 {
 
-                     guideId = 2;
 
-                     GuideController.TryGuideByGuideId(null, ConstGuideId.GET_SUIT_ITEM_VIEW_FIRST, 1, false, "恭喜你,获得了一件套装配件,集齐套装有惊喜哦!点击空白区域继续", targetY);
 
-                 }
 
-             }
 
-             _ui.m_probar.max = totalCount;
 
-             _ui.m_probar.value = count;
 
-             UpdateItem(itemId);
 
-             if (_sceneObject != null)
 
-             {
 
-                 GameObject.Destroy(_sceneObject);
 
-                 _sceneObject = null;
 
-             }
 
-             _sceneObject = GameObject.Instantiate(_scenePrefab);
 
-             int scale = 70;
 
-             _sceneObject.transform.localScale = new Vector3(scale, scale, scale);
 
-             SceneController.UpdateRole(itemIds, _sceneObject);
 
-             if (_wrapper == null)
 
-             {
 
-                 _wrapper = new GoWrapper(_sceneObject);
 
-                 _ui.m_holder.SetNativeObject(_wrapper);
 
-             }
 
-             else
 
-             {
 
-                 _wrapper.wrapTarget = _sceneObject;
 
-             }
 
-         }
 
-         private void UpdateToCheckGuide(object param)
 
-         {
 
-             if (!ViewManager.CheckIsTopView(this.viewCom)) return;
 
-             if (guideId == 1) GuideController.TryGuide(null, ConstGuideId.GET_SUIT_ITEM_FULL, 1, "恭喜你,集齐了第一套套装,快去换装界面穿上试试吧!点击空白区域继续", false, 0, true, false, (int)(this.viewCom.height - 150));
 
-             if (guideId == 2) GuideController.TryGuide(null, ConstGuideId.GET_SUIT_ITEM_FIRST, 1, "恭喜你,获得了一件套装配件,集齐套装有惊喜哦!点击空白区域继续", false, 0, true, false, (int)(this.viewCom.height - 150));
 
-         }
 
-         private void TryCompleteGuide()
 
-         {
 
-             GuideCfg cfg;
 
-             cfg = GuideCfgArray.Instance.GetCfg(ConstGuideId.GET_SUIT_ITEM_FULL);
 
-             GuideController.TryCompleteGuideIndex(cfg.id, 1);
 
-             GuideController.TryCompleteGuide(ConstGuideId.GET_SUIT_ITEM_FULL, 1);
 
-             cfg = GuideCfgArray.Instance.GetCfg(ConstGuideId.GET_SUIT_ITEM_FIRST);
 
-             GuideController.TryCompleteGuideIndex(cfg.id, 1);
 
-             GuideController.TryCompleteGuide(ConstGuideId.GET_SUIT_ITEM_FIRST, 1);
 
-         }
 
-     }
 
- }
 
 
  |