zhaoyang před 2 roky
rodič
revize
3f379b1c6b

+ 266 - 0
LuckyBox/LuckyBoxActivityView.cs

@@ -0,0 +1,266 @@
+using FairyGUI;
+using UI.LuckyBox;
+using UI.CommonGame;
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using UnityEngine;
+using ET;
+
+namespace GFGGame
+{
+    public class LuckyBoxActivityView : BaseWindow
+    {
+        private UI_LuckyBoxActivityUI _ui;
+        private ValueBarController _valueBarController;
+        private LuckyBoxController _luckyBoxCtrl;
+        private ActivityOpenCfg _activityCfg;
+        private LuckyBoxCfg _luckyBoxCfg;
+        private int _activityId;
+
+        public override void Dispose()
+        {
+            if (_valueBarController != null)
+            {
+                _valueBarController.Dispose();
+                _valueBarController = null;
+            }
+            if (_luckyBoxCtrl != null)
+            {
+                _luckyBoxCtrl.Dispose();
+                _luckyBoxCtrl = null;
+            }
+
+            if (_ui != null)
+            {
+                _ui.Dispose();
+                _ui = null;
+            }
+            base.Dispose();
+        }
+
+        protected override void OnInit()
+        {
+            base.OnInit();
+            packageName = UI_LuckyBoxActivityUI.PACKAGE_NAME;
+            _ui = UI_LuckyBoxActivityUI.Create();
+            this.viewCom = _ui.target;
+            isfullScreen = true;
+
+            _valueBarController = new ValueBarController(_ui.m_valueBar);
+            _luckyBoxCtrl = new LuckyBoxController(_ui.m_comBox.m_comModel.target);
+
+            _ui.m_btnBack.onClick.Add(OnClickBtnBack);
+            _ui.m_btnReward.onClick.Add(OnClikcBtnReward);
+            _ui.m_btnShop.onClick.Add(OnClikcBtnShop);
+            _ui.m_btnGiftBag.onClick.Add(OnClikcBtnGiftBag);
+
+        }
+        protected override void AddEventListener()
+        {
+            base.AddEventListener();
+            EventAgent.AddEventListener(ConstMessage.ACTIVITY_LUCKY_BOX, UpdateView);
+        }
+        protected override void OnShown()
+        {
+            base.OnShown();
+            _activityId = (int)this.viewData;
+            _activityCfg = ActivityOpenCfgArray.Instance.GetCfg(_activityId);
+            _luckyBoxCfg = LuckyBoxCfgArray.Instance.GetCfg(_activityCfg.paramsArr[0]);
+            _valueBarController.OnShown();
+            _valueBarController.UpdateList(new List<int>() { _luckyBoxCfg.costID });
+            _luckyBoxCtrl.OnShown(_luckyBoxCfg.id);
+            Timers.inst.Add(1, 0, UpdateTime);
+            UpdateView();
+        }
+        private void UpdateTime(object param = null)
+        {
+            long endTime = TimeUtil.DateTimeToTimestamp(_activityCfg.endTime);
+            long curTime = TimeHelper.ServerNow();
+            if (endTime < curTime)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("活动已结束");
+                Timers.inst.Remove(UpdateTime);
+                OnClickBtnBack();
+                return;
+            }
+            TimeUtil.FormattingTime(curTime, endTime, out int num, out string str);
+            _ui.m_txtTime.text = TimeUtil.FormattingTimeTo_DDHHmm(endTime - curTime);
+
+            //=====限时礼包倒计时
+            UpGiftBox();
+            if (ViewManager.isViewOpen(nameof(RushSaleGiftBoxView)))
+            {
+                var rushSaleGiftBoxView =
+                    ViewManager.GetUIView(nameof(RushSaleGiftBoxView)) as RushSaleGiftBoxView;
+                rushSaleGiftBoxView?.UpTime();
+            }
+            //=====限时礼包倒计时END
+        }
+
+        private void UpdateView()
+        {
+            _ui.m_txtCount.SetVar("value", ActivityDataManager.Instance.lastDrawCount.ToString()).FlushVars();
+            _ui.m_txtCount.SetVar("name", _activityCfg.themeName).FlushVars();
+            UI_ComBox comBox = UI_ComBox.Proxy(_ui.m_comBox.target);
+
+            LuckyBoxDataManager.Instance.InitData(_luckyBoxCfg.id);
+            comBox.m_comModel.m_loaBg.url = ResPathUtil.GetBgImgPath(_luckyBoxCfg.resArr[0]);
+            comBox.m_btnPreview.m_c1.selectedIndex = 1;
+            LuckyBoxDataManager.Instance.GetOwnedCount(_luckyBoxCfg.id, out int count, out int totalCount);
+            comBox.m_txtOwned.SetVar("v1", "" + count).FlushVars();
+            comBox.m_txtOwned.SetVar("v2", "" + totalCount).FlushVars();
+            int boughtCount = GameGlobal.myNumericComponent.GetAsInt(_luckyBoxCfg.numericType);
+            comBox.m_txtRemainTimes.text = string.Format("今日剩余次数:{0}", _luckyBoxCfg.maxCount - boughtCount);
+
+            comBox.m_comCostOne.m_txtCost.text = _luckyBoxCfg.costNum.ToString();
+            comBox.m_comCostOne.m_loaCost.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(_luckyBoxCfg.costID).res);
+            comBox.m_comCostTen.m_txtCost.text = _luckyBoxCfg.costNumTen.ToString();
+            comBox.m_comCostTen.m_loaCost.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(_luckyBoxCfg.costID).res);
+
+            if (comBox.m_btnBuyOne.target.data == null)
+            {
+                comBox.m_btnBuyOne.target.onClick.Add(OnClickBtnBuyOne);
+            }
+            comBox.m_btnBuyOne.target.data = _luckyBoxCfg.id;
+
+            if (comBox.m_btnBuyTen.target.data == null)
+            {
+                comBox.m_btnBuyTen.target.onClick.Add(OnClickBtnBuyTen);
+            }
+            comBox.m_btnBuyTen.target.data = _luckyBoxCfg.id;
+            comBox.m_imgActLuckyBox.visible = true;
+            comBox.m_grpLuckyBox.visible = false;
+            if (comBox.m_btnPreview.target.data == null)
+            {
+                comBox.m_btnPreview.target.onClick.Add(OnClickBtnPreview);
+            }
+            comBox.m_btnPreview.target.data = _luckyBoxCfg.id;
+
+            comBox.target.data = _luckyBoxCfg.id;
+
+            UI_ComBox.ProxyEnd();
+        }
+
+        private void UpGiftBox()
+        {
+            var activityInfoByTypeList =
+                ActivityGlobalDataManager.Instance.GetActivityInfoByType(ActivityType.XSLB3);
+
+            var list = activityInfoByTypeList
+                .Where(a => a.EndTime > TimeInfo.Instance.ServerNow()).ToList();
+            if (list.Count == 0)
+            {
+                _ui.m_comBagTime.target.visible = false;
+                _ui.m_btnGiftBag.visible = false;
+            }
+            else
+            {
+                _ui.m_comBagTime.m_txtGiftBagTime.text = TimeUtil.GetTimeLeft(TimeInfo.Instance.ServerNow(), list[0].EndTime);
+                _ui.m_comBagTime.target.visible = true;
+                _ui.m_btnGiftBag.visible = true;
+            }
+        }
+
+        private void OnClickBtnPreview(EventContext context)
+        {
+            GObject obj = context.sender as GObject;
+            int boxId = (int)obj.data;
+            ViewManager.Show(ViewName.LUCKY_BOX_PRE_SHOW_VIEW, boxId);
+        }
+
+        private void OnClickBtnBuyOne(EventContext context)
+        {
+            int boughtCount = GameGlobal.myNumericComponent.GetAsInt(_luckyBoxCfg.numericType);
+            if (boughtCount + LuckyBoxDataManager.ONCE_TIME > _luckyBoxCfg.maxCount)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("抽奖次数不足");
+                return;
+            }
+            LuckyBoxDataManager.Instance.CheckItemEnough(_luckyBoxCfg.id, LuckyBoxDataManager.ONCE_TIME, async () =>
+             {
+                 bool result = await LuckyBoxSProxy.ReqGetBonus(_luckyBoxCfg.id, LuckyBoxDataManager.ONCE_TIME);
+                 if (result)
+                 {
+                     ViewManager.Show<LuckyBoxStarView>(null, new object[] { typeof(LuckyBoxActivityView).FullName, _activityId }, true);
+                     //  LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.ZAI_XING, 2);
+                 }
+             });
+        }
+
+        private void OnClickBtnBuyTen(EventContext context)
+        {
+
+            GObject obj = context.sender as GObject;
+            int boughtCount = GameGlobal.myNumericComponent.GetAsInt(_luckyBoxCfg.numericType);
+            if (boughtCount + LuckyBoxDataManager.TEN_TIME > _luckyBoxCfg.maxCount)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("抽奖次数不足");
+                return;
+            }
+            LuckyBoxDataManager.Instance.CheckItemEnough(this._luckyBoxCfg.id, LuckyBoxDataManager.TEN_TIME, async () =>
+            {
+                bool result = await LuckyBoxSProxy.ReqGetBonus(this._luckyBoxCfg.id, LuckyBoxDataManager.TEN_TIME);
+                if (result)
+                {
+                    ViewManager.Show<LuckyBoxStarView>(null, new object[] { typeof(LuckyBoxActivityView).FullName, _activityId }, true);
+                    // LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.ZAI_XING, 2);
+                }
+            });
+        }
+
+        private void OnClikcBtnReward()
+        {
+            ViewManager.Show<ActivityThemeLuckyBoxBonusView>();
+        }
+        private void OnClikcBtnShop()
+        {
+            ViewManager.Show<StoreView>(new object[] { ConstStoreTabId.STORE_GIFT_BAG, ConstStoreSubId.STORE_GIFT_BAG_ACTIVITY });
+        }
+
+        //限时礼包按钮点击执行方法
+        private void OnClikcBtnGiftBag()
+        {
+            var activityInfoByTypeList =
+                ActivityGlobalDataManager.Instance.GetActivityInfoByType(ActivityType.XSLB3);
+
+            var list = activityInfoByTypeList
+                .Where(a => a.EndTime > TimeInfo.Instance.ServerNow()).ToList();
+            if (list.Count == 0)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("活动已结束");
+            }
+            else
+            {
+                ViewManager.Show<RushSaleGiftBoxView>(new object[] { ActivityType.XSLB3, this.viewData });
+            }
+        }
+
+        protected override void OnHide()
+        {
+            base.OnHide();
+            _valueBarController.OnHide();
+            _luckyBoxCtrl.OnHide();
+            Timers.inst.Remove(UpdateTime);
+        }
+
+        protected override void RemoveEventListener()
+        {
+            base.RemoveEventListener();
+        }
+
+        private void OnClickBtnBack()
+        {
+            ViewManager.GoBackFrom(typeof(LuckyBoxActivityView).FullName);
+        }
+
+        protected override void UpdateToCheckGuide(object param)
+        {
+            if (!ViewManager.CheckIsTopView(this.viewCom)) return;
+        }
+        protected override void TryCompleteGuide()
+        {
+            base.TryCompleteGuide();
+        }
+    }
+}

+ 11 - 0
LuckyBox/LuckyBoxActivityView.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: add37497970445245886e85b662f414a
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 357 - 0
LuckyBox/LuckyBoxBonusView.cs

@@ -0,0 +1,357 @@
+using UnityEngine;
+using FairyGUI;
+using UI.LuckyBox;
+using System.Collections.Generic;
+using System.Collections;
+
+namespace GFGGame
+{
+    public class LuckyBoxBonusView : BaseWindow
+    {
+        private UI_LuckBoxBonusUI _ui;
+        private List<ItemData> itemList;
+        private List<ItemData> itemListAni;
+        private GComponent _curComItem;
+        private int openCount = 0;
+        private List<ItemData> newItemList = new List<ItemData>();
+        private List<int> newCardList = new List<int>();
+        private List<bool> openState = new List<bool>();
+        // private int openIndex = 0;
+
+        private List<GameObject> _gameobjects = new List<GameObject>();
+        private List<GoWrapper> _wrappers = new List<GoWrapper>();
+        private GameObject _gameobject;
+        private GoWrapper _wrapper;
+
+        private string _goBackViewName;
+        private object _goBackParams;
+        public override void Dispose()
+        {
+            base.Dispose();
+            for (int i = 0; i < _gameobjects.Count; i++)
+            {
+                SceneController.DestroyObjectFromView(_gameobjects[i], _wrappers[i]);
+
+            }
+            SceneController.DestroyObjectFromView(_gameobject, _wrapper);
+
+            if (_ui != null)
+            {
+                _ui.Dispose();
+                _ui = null;
+            }
+        }
+
+        protected override void OnInit()
+        {
+            base.OnInit();
+            packageName = UI_LuckBoxBonusUI.PACKAGE_NAME;
+            _ui = UI_LuckBoxBonusUI.Create();
+            this.viewCom = _ui.target;
+            isfullScreen = true;
+
+            InitAllItem();
+            _ui.m_loaBg.onClick.Add(OnClickBg);
+            _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("bj_ckzxin");
+            _ui.m_btnPass.onClick.Add(OnBtnPassClick);
+
+        }
+
+        protected override void OnShown()
+        {
+            base.OnShown();
+            _goBackViewName = ViewManager.GetGoBackDatas(typeof(LuckyBoxStarView).FullName)[0].ToString();
+            _goBackParams = ViewManager.GetGoBackDatas(typeof(LuckyBoxStarView).FullName)[1];
+
+            itemList = (viewData as object[])[0] as List<ItemData>;
+            itemListAni = new List<ItemData>(itemList.ToArray());
+            _ui.m_loaMask.visible = true;
+
+            int count = itemList.Count;
+            if (count == 10)
+            {
+                _ui.m_c1.selectedIndex = 1;
+            }
+            else if (count > 0)
+            {
+                _ui.m_c1.selectedIndex = 0;
+            }
+            ShowBonusList();
+
+            _ui.m_t0.Play(UpdateView);
+            //
+        }
+
+        protected override void OnHide()
+        {
+            base.OnHide();
+            _ui.m_t1.Play();
+            openCount = 0;
+            newCardList.Clear();
+            newItemList.Clear();
+            itemList.Clear();
+            for (int i = 0; i < openState.Count; i++)
+            {
+                openState[i] = false;
+            }
+        }
+        private void InitAllItem()
+        {
+            string resPath = ResPathUtil.GetViewEffectPath("ui_ck", "ui_ck_fk");
+            UI_LuckyBoxBonusItem itemUI = UI_LuckyBoxBonusItem.Proxy(_ui.m_itemOne.target);
+            itemUI.target.onClick.Add(OnClickItem);
+            itemUI.m_comIcon.m_icon.onClick.Add(OnClickItemTips);
+            SceneController.AddObjectToView(null, null, itemUI.m_holder, resPath, out _gameobject, out _wrapper);
+            UI_LuckyBoxBonusItem.ProxyEnd();
+
+            for (int i = 0; i < 10; i++)
+            {
+                GObject itemObject = _ui.target.GetChild("item" + i);
+                if (itemObject != null)
+                {
+                    UI_LuckyBoxBonusItem itemUITen = UI_LuckyBoxBonusItem.Proxy(itemObject);
+                    itemUITen.target.onClick.Add(OnClickItem);
+                    itemUITen.m_comIcon.m_icon.onClick.Add(OnClickItemTips);
+                    SceneController.AddObjectToView(null, null, itemUITen.m_holder, resPath, out GameObject gameobject, out GoWrapper wrapper);
+                    _gameobjects.Add(gameobject);
+                    _wrappers.Add(wrapper);
+                    UI_LuckyBoxBonusItem.ProxyEnd();
+                    openState.Add(false);
+                }
+            }
+        }
+        private void OnClickBg()
+        {
+            if (openCount < itemList.Count)
+            {
+                OnClickOpen();
+            }
+            else
+            {
+                this.Hide();
+                ViewManager.Show(_goBackViewName, _goBackParams);
+                GetSuitItemController.TryShow(0);
+                _ui.m_t0.Stop(true, false);
+            }
+        }
+        private void UpdateView()
+        {
+
+            _ui.m_loaMask.visible = false;
+            // int[][] bonus = LuckyBoxCfgArray.Instance.GetCfg(LuckyBoxDataManager.Instance.luckyBoxId).bonusArr;
+            // List<ItemData> itemDatas = ItemUtil.CreateItemDataList(bonus, LuckyBoxDataManager.Instance.times);
+            // ViewManager.Show<LuckyBoxNewDressView>(itemDatas);
+        }
+        private void ShowBonusList()
+        {
+            if (itemList.Count > 1)
+            {
+                for (int i = 0; i < itemList.Count; i++)
+                {
+                    GObject itemObject = _ui.target.GetChild("item" + i);
+                    if (itemObject != null)
+                    {
+                        _gameobjects[i].SetActive(false);
+                        UpdateItem(i, itemObject);
+                    }
+                }
+            }
+            else
+            {
+                _gameobject.SetActive(false);
+                UpdateItem(0, _ui.m_itemOne.target);
+            }
+        }
+
+        private void UpdateItem(int index, GObject obj)
+        {
+            ItemData itemData = itemList[index];
+            UI_LuckyBoxBonusItem itemUI = UI_LuckyBoxBonusItem.Proxy(obj);
+            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemData.id);
+            bool isFirst = true;
+            int count = 0;
+            for (int i = 0; i < itemList.Count; i++)
+            {
+                if (i < index && itemList[i].id == itemData.id)
+                {
+                    isFirst = false;
+                }
+                if (itemList[i].id == itemData.id)
+                {
+                    count++;
+                }
+            }
+            itemUI.m_comIcon.m_icon.url = ResPathUtil.GetIconPath(itemCfg);
+            itemUI.m_comIcon.m_imgNew.visible = itemCfg.itemType != ConstItemType.ITEM && ItemDataManager.GetItemNum(itemData.id) == count && isFirst ? true : false;
+            string itemName = itemCfg.name;
+            itemUI.m_comIcon.m_txtName.text = itemName;
+            itemUI.m_c1.selectedIndex = itemCfg.rarity;
+            itemUI.m_comIcon.m_c1.selectedIndex = itemCfg.rarity;
+            RarityIconController.UpdateRarityIcon(itemUI.m_comIcon.m_rarity, itemData.id, false);
+            itemUI.m_comIcon.m_icon.data = itemData.id;
+            itemUI.target.data = index;
+            itemUI.m_t0.Play();
+            UI_LuckyBoxBonusItem.ProxyEnd();
+        }
+
+
+        private void OnClickItem(EventContext context)
+        {
+            GComponent item = context.sender as GComponent;
+
+            PlayOpenAni(item);
+        }
+        private void OnClickOpen()
+        {
+            if (itemList.Count == 1)
+            {
+                PlayOpenAni(_ui.m_itemOne.target);
+                return;
+            }
+            for (int i = 0; i < itemList.Count; i++)
+            {
+                GComponent component = _ui.target.GetChild("item" + i).asCom;
+                if (component != null)
+                {
+                    bool playing = PlayOpenAni(component);
+                    if (!playing) continue;
+                    if (playing) break;
+                }
+            }
+        }
+
+
+        private bool PlayOpenAni(GComponent component)
+        {
+            Transition transition = component.GetTransition("t1");
+            GComponent comIcon = component.GetChild("comIcon").asCom;
+            if (transition.playing || comIcon.alpha == 1) return false;
+            GImage imgNew = component.GetChild("comIcon").asCom.GetChild("imgNew").asImage;
+            if (imgNew.visible)
+            {
+                _ui.m_loaMask.visible = true;
+
+            }
+            _curComItem = component;
+            int index = (int)_curComItem.data;
+            if (itemList.Count == 1)
+            {
+                _gameobject.SetActive(true);
+            }
+            else
+            {
+                _gameobjects[index].SetActive(true);
+            }
+            transition.Play(UpdateOpenCount);
+            return true;
+        }
+        private void UpdateOpenCount()
+        {
+            GImage imgNew = _curComItem.GetChild("comIcon").asCom.GetChild("imgNew").asImage;
+            int index = (int)_curComItem.data;
+            if (imgNew.visible)
+            {
+                ItemData itemData = itemList[index];
+                ItemCfg cfg = ItemCfgArray.Instance.GetCfg(itemData.id);
+                if (cfg.itemType == ConstItemType.DRESS_UP)
+                {
+                    List<ItemData> itemDatas = ItemUtil.CreateItemDataList(itemData.id, itemData.num);
+                    ViewManager.Show<LuckyBoxNewDressView>(itemDatas);
+                }
+                else if (cfg.itemType == ConstItemType.CARD)
+                {
+                    List<int> list = new List<int>();
+                    list.Add(itemData.id);
+                    ViewManager.Show<LuckyBoxNewCardView>(new object[] { list, new List<ItemData>() });
+                }
+            }
+            openCount++;
+            openState[index] = true;
+            _ui.m_loaMask.visible = false;
+
+        }
+        private void OnClickItemTips(EventContext context)
+        {
+            GLoader item = context.sender as GLoader;
+            int itemID = (int)item.data;
+            GoodsItemTipsController.ShowItemTips(itemID);
+        }
+
+
+        private void OnBtnPassClick()
+        {
+            if (openCount == itemList.Count)
+            {
+                OnClickBg();
+                return;
+            }
+            _ui.m_loaMask.visible = true;
+            if (itemList.Count == 1)
+            {
+                PlayOpenAni(_ui.m_itemOne.target);
+            }
+            else
+            {
+                // Timers.inst.Add(0.3f, openState.Count - openCount, UpdateTime);
+                Timers.inst.StartCoroutine(UpdatePass());
+            }
+        }
+        public IEnumerator UpdatePass()
+        {
+            for (int i = 0; i < openState.Count; i++)
+            {
+                if (openState[i] == false)
+                {
+                    yield return new WaitForSeconds(0.3f);
+                    yield return UpdateTime(i);
+                }
+            }
+            _ui.m_loaMask.visible = false;
+        }
+        private IEnumerator UpdateTime(int index)
+        {
+            GComponent component = _ui.target.GetChild("item" + index).asCom;
+            Transition transition = component.GetTransition("t1");
+            GComponent comIcon = component.GetChild("comIcon").asCom;
+            GImage imgNew = comIcon.GetChild("imgNew").asImage;
+
+            openCount++;
+            openState[index] = true;
+            if (imgNew.visible)
+            {
+                ItemData itemData = itemList[index];
+                ET.Log.Debug("zoya:  itemData:" + itemData);
+                ItemCfg cfg = ItemCfgArray.Instance.GetCfg(itemData.id);
+                if (cfg.itemType == ConstItemType.DRESS_UP)
+                {
+                    newItemList.Insert(0, itemData);
+                }
+                else if (cfg.itemType == ConstItemType.CARD)
+                {
+                    newCardList.Insert(0, itemData.id);
+                }
+            }
+            _gameobjects[index].SetActive(true);
+            if (openCount == itemList.Count)
+            {
+                transition.Play(PlayComplete);
+            }
+            else
+            {
+                transition.Play();
+            }
+            yield return null;
+        }
+        private void PlayComplete()
+        {
+            if (newCardList.Count > 0)
+            {
+                ViewManager.Show<LuckyBoxNewCardView>(new object[] { newCardList, newItemList });
+            }
+            else if (newItemList.Count > 0)
+            {
+                ViewManager.Show<LuckyBoxNewDressView>(newItemList);
+            }
+        }
+    }
+}

+ 11 - 0
LuckyBox/LuckyBoxBonusView.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 73af8e74b08d7954ab3b1b372524f7f6
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 81 - 0
LuckyBox/LuckyBoxNewCardView.cs

@@ -0,0 +1,81 @@
+using System.Collections.Generic;
+using ET;
+using FairyGUI;
+using UI.LuckyBox;
+using UnityEngine;
+
+namespace GFGGame
+{
+    public class LuckyBoxNewCardView : BaseWindow
+    {
+        private UI_LuckyBoxNewCardUI _ui;
+        private List<int> _newCardList = new List<int>();
+        private List<ItemData> _newDressList = new List<ItemData>();
+        public override void Dispose()
+        {
+            if (_ui != null)
+            {
+                _ui.Dispose();
+                _ui = null;
+            }
+            base.Dispose();
+        }
+
+        protected override void OnInit()
+        {
+            base.OnInit();
+            packageName = UI_LuckyBoxNewCardUI.PACKAGE_NAME;
+            _ui = UI_LuckyBoxNewCardUI.Create();
+            this.viewCom = _ui.target;
+            isfullScreen = true;
+
+            _ui.m_loaBg.onClick.Add(OnClickBtnBg);
+        }
+        protected override void AddEventListener()
+        {
+            base.AddEventListener();
+
+        }
+        protected override void OnShown()
+        {
+            base.OnShown();
+
+            _newCardList = new List<int>((this.viewData as object[])[0] as List<int>);
+            _newDressList = new List<ItemData>((this.viewData as object[])[1] as List<ItemData>);
+            updateView();
+
+        }
+        private void updateView()
+        {
+            ItemCfg cfg = ItemCfgArray.Instance.GetCfg(_newCardList[0]);
+            _ui.m_loaBg.url = ResPathUtil.GetCardPath(cfg.res);
+            _newCardList.RemoveAt(0);
+        }
+        protected override void OnHide()
+        {
+            base.OnHide();
+
+        }
+
+        protected override void RemoveEventListener()
+        {
+            base.RemoveEventListener();
+
+        }
+
+        private void OnClickBtnBg()
+        {
+            if (_newCardList.Count == 0)
+            {
+                this.Hide();
+                if (_newDressList.Count > 0)
+                {
+                    ViewManager.Show<LuckyBoxNewDressView>(_newDressList);
+                }
+                return;
+            }
+            updateView();
+
+        }
+    }
+}

+ 11 - 0
LuckyBox/LuckyBoxNewCardView.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 180e77ed5042c9e4ca338758a35f3e93
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 178 - 0
LuckyBox/LuckyBoxNewDressView.cs

@@ -0,0 +1,178 @@
+using System.Collections;
+using UnityEngine;
+using UI.LuckyBox;
+using System.Collections.Generic;
+using FairyGUI;
+using System.Linq;
+
+namespace GFGGame
+{
+
+    public class LuckyBoxNewDressView : BaseWindow
+    {
+        private UI_LuckyBoxNewDressUI _ui;
+        private List<ItemData> _rewardList = new List<ItemData>();
+        // private List<ItemData> _newRewardList = new List<ItemData>();
+        // private List<ItemData> _oldRewardList = new List<ItemData>();
+        // private List<ItemData> _showRewardList = new List<ItemData>();
+
+        // private int _type = 0;//弹窗类型:0可跳过,1:首次获得物品不可跳过,2首次获得物品不可跳过,不弹获得套装界面
+
+        private GameObject gameObject;
+        private GoWrapper wrapper;
+        public override void Dispose()
+        {
+            base.Dispose();
+            SceneController.DestroyObjectFromView(gameObject, wrapper);
+            if (_ui != null)
+            {
+                _ui.Dispose();
+                _ui = null;
+            }
+        }
+
+        protected override void OnInit()
+        {
+            base.OnInit();
+            packageName = UI_LuckyBoxNewDressUI.PACKAGE_NAME;
+            _ui = UI_LuckyBoxNewDressUI.Create();
+            this.viewCom = _ui.target;
+            isfullScreen = true;
+
+            this.modal = true;
+
+
+            _ui.m_bg.onTouchBegin.Add(OnClickBg);
+            _ui.m_btnPass.onClick.Add(OnClickBtnPass);
+
+
+            string resPath = ResPathUtil.GetViewEffectPath("ui_ck", "ui_ck_zs");
+            SceneController.AddObjectToView(gameObject, null, _ui.m_comCard.m_holder, resPath, out gameObject, out wrapper);
+        }
+        protected override void OnShown()
+        {
+            base.OnShown();
+            List<ItemData> rewardList = this.viewData as List<ItemData>;
+            if (_rewardList.Count > 0)
+            {
+                _rewardList.AddRange(rewardList);
+                return;
+            }
+            else
+            {
+                _rewardList = rewardList;
+            }
+            _ui.m_btnPass.visible = false;
+            // _newRewardList.Clear();
+            // _oldRewardList.Clear();
+            // for (int i = 0; i < _rewardList.Count; i++)
+            // {
+            //     if (GetThisCount(_rewardList[i].id, _rewardList) == ItemDataManager.GetItemNum(_rewardList[i].id) && !IsAddToNewRewardList(_rewardList[i].id))
+            //     {
+            //         _newRewardList.Add(_rewardList[i]);
+            //     }
+            //     else
+            //     {
+            //         _oldRewardList.Add(_rewardList[i]);
+            //     }
+            // }
+            // if (LuckyBoxDataManager.Instance.luckyBoxId > 0)//必展示必掉奖励
+            // {
+            //     int[][] bonus = LuckyBoxCfgArray.Instance.GetCfg(LuckyBoxDataManager.Instance.luckyBoxId).bonusArr;
+            //     List<ItemData> itemDatas = ItemUtil.CreateItemDataList(bonus, LuckyBoxDataManager.Instance.times);
+            //     _newRewardList.AddRange(itemDatas);
+            //     LuckyBoxDataManager.Instance.luckyBoxId = 0;
+            // }
+            LuckyBoxDataManager.Instance.luckyBoxId = 0;
+
+            UpdateView();
+        }
+        private void UpdateView()
+        {
+            // _ui.m_btnPass.visible = _newRewardList.Count <= 1;
+            // _newRewardList.Count > 0 ? _newRewardList : _oldRewardList;
+
+            if (_rewardList.Count - 1 < 0) return;
+            ItemData itemdata = _rewardList[_rewardList.Count - 1];
+            ItemCfg itemCfg = ItemCfgArray.Instance.GetCfg(itemdata.id);
+            _ui.m_comCard.m_loaType.url = ResPathUtil.GetCommonGameResPath("hd_sxicon_" + itemCfg.rarity);
+            _ui.m_comCard.m_loaIcon.url = ResPathUtil.GetIconPath(itemCfg);
+            // int mainScore = 0;
+            // int mainScoreValue = 0;
+            // ItemDataManager.GetMainScore(itemdata.id, out mainScore, out mainScoreValue);
+            _ui.m_comCard.m_loaProperty.url = ResPathUtil.GetCommonGameResPath("kp_sx_" + itemCfg.mainScore);
+
+            _ui.m_comCard.m_txtName.text = itemCfg.name;
+            _ui.m_comCard.m_txtDiscribe.text = itemCfg.desc;
+            _ui.m_comCard.m_holder.visible = true;
+
+            if (LuckyBoxDataManager.Instance.FirstRewardList.ContainsKey(_rewardList.Count - 1) == true)
+            {
+                LuckyBoxDataManager.Instance.FirstRewardList.Remove(_rewardList.Count - 1);
+            }
+            _rewardList.RemoveAt(_rewardList.Count - 1);
+
+        }
+
+        private void OnClickBg()
+        {
+            if (_rewardList.Count == 0)
+            {
+                //     // if (_type == (int)FirstGetCardViewType.JUMP)
+                //     // {
+                //     ViewManager.Show(ViewName.LUCKY_BOX_BONUS_VIEW, new object[] { (this.viewData as object[])[0] as List<ItemData>, _rewardList });
+                //     // }
+                //     // else if (_type == (int)FirstGetCardViewType.CANNOT_JUMP)
+                //     // {
+                //     //     GetSuitItemController.TryShow(0);
+
+                //     // }
+                this.Hide();
+                return;
+            }
+
+
+            _ui.m_t_close.Play(() =>
+            {
+                _ui.m_comCard.m_holder.visible = false;
+                _ui.m_t_open.Play();
+                UpdateView();
+            });
+        }
+        private int GetThisCount(int itemId, List<ItemData> rewards)
+        {
+            int count = 0;
+            for (int i = 0; i < rewards.Count; i++)
+            {
+                if (rewards[i].id == itemId)
+                {
+                    count++;
+                }
+            }
+            return count;
+        }
+        private bool IsAddToNewRewardList(int itemId)
+        {
+            for (int i = 0; i < _rewardList.Count; i++)
+            {
+                if (itemId == _rewardList[i].id)
+                {
+                    return true;
+                }
+            }
+            return false;
+        }
+        private void OnClickBtnPass()
+        {
+
+            ViewManager.Show(ViewName.LUCKY_BOX_BONUS_VIEW, new object[] { (this.viewData as object[])[0], _rewardList });
+            this.Hide();
+        }
+        protected override void OnHide()
+        {
+            _ui.m_t_close.Stop(true, false);
+            _ui.m_t_open.Stop(true, false);
+            base.OnHide();
+        }
+    }
+}

+ 11 - 0
LuckyBox/LuckyBoxNewDressView.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: af5d144dfd5a4b745a528cb1e1b173fa
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 81 - 0
LuckyBox/LuckyBoxPreShowView.cs

@@ -0,0 +1,81 @@
+using UI.LuckyBox;
+using UI.CommonGame;
+using System.Collections.Generic;
+using FairyGUI;
+
+namespace GFGGame
+{
+    public class LuckyBoxPreShowView : BaseWindow
+    {
+        private UI_LuckyBoxPreShowUI _ui;
+        private List<LuckyBoxBonusData> _bonusList;
+
+        public override void Dispose()
+        {
+            if (_ui != null)
+            {
+                _ui.Dispose();
+                _ui = null;
+            }
+            base.Dispose();
+        }
+
+        protected override void OnInit()
+        {
+            base.OnInit();
+            _ui = UI_LuckyBoxPreShowUI.Create();
+            this.viewCom = _ui.target;
+            this.viewCom.Center();
+            this.modal = true;
+        }
+
+        protected override void OnShown()
+        {
+            base.OnShown();
+            int boxId = (int)this.viewData;
+            LuckyBoxCfg cfg = LuckyBoxCfgArray.Instance.GetCfg(boxId);
+            string probShow = cfg.probShow.Replace("\\n", "\n");
+            _ui.m_compText.m_txtShow.text = probShow;
+
+            _bonusList = LuckyBoxDataManager.Instance.GetCurrentShowList(boxId);
+            _ui.m_list.RemoveChildrenToPool();
+            _ui.m_list.itemRenderer = ListItemRenderer;
+            _ui.m_list.numItems = _bonusList.Count;
+        }
+
+        protected override void OnHide()
+        {
+            base.OnHide();
+            if (_ui.m_list.numItems > 0) _ui.m_list.ScrollToView(0);
+            _ui.m_list.RemoveChildrenToPool();
+        }
+
+        private void ListItemRenderer(int index, GObject item)
+        {
+            UI_CompLuckyBoxBonusListItem listItem = UI_CompLuckyBoxBonusListItem.Proxy(item);
+            LuckyBoxBonusData luckyBoxBonusData = _bonusList[index];
+            listItem.m_txtName.text = luckyBoxBonusData.name;
+            if (listItem.m_list.data == null)
+            {
+                listItem.m_list.itemRenderer = ListItemRewardRender;
+            }
+            listItem.m_list.data = luckyBoxBonusData.itemList;
+            listItem.m_list.numItems = luckyBoxBonusData.itemList.Count;
+            listItem.m_list.ResizeToFit();
+            listItem.target.height = listItem.m_list.y + listItem.m_list.height;
+            UI_CompLuckyBoxBonusListItem.ProxyEnd();
+        }
+        private void ListItemRewardRender(int index, GObject obj)
+        {
+            ItemData itemData = (obj.parent.data as List<ItemData>)[index];
+            if (obj.data == null)
+            {
+                obj.data = new ItemView(obj as GComponent);
+            }
+                (obj.data as ItemView).SetData(itemData);
+            (obj.data as ItemView).ShowHasCount = false;
+            (obj.data as ItemView).ImgHasVisible = ItemDataManager.GetItemNum(itemData.id) > 0;
+
+        }
+    }
+}

+ 11 - 0
LuckyBox/LuckyBoxPreShowView.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1d4d2ee15f610904fb75977c3c3beb6a
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 391 - 0
LuckyBox/LuckyBoxStarView.cs

@@ -0,0 +1,391 @@
+using System.Collections;
+using UnityEngine;
+using UI.LuckyBox;
+using System.Collections.Generic;
+using FairyGUI;
+using System.Threading;
+using System.Threading.Tasks;
+using System;
+
+namespace GFGGame
+{
+    public class LuckyBoxStarView : BaseWindow
+    {
+        private UI_LuckyBoxStarUI _ui;
+        private List<GObject> comStars = new List<GObject>();
+        private List<GObject> clickComStars = new List<GObject>();
+        private List<GObject> notClickComStars = new List<GObject>();
+
+        // private List<GameObject> _gameObjects = new List<GameObject>();
+        // private List<GoWrapper> _wrappers = new List<GoWrapper>();
+        // private List<GameObject> _gameObjects1 = new List<GameObject>();
+        // private List<GoWrapper> _wrappers1 = new List<GoWrapper>();
+        private Dictionary<int, List<GameObject>> dicGameobj = new Dictionary<int, List<GameObject>>();
+        private Dictionary<int, List<GoWrapper>> dicWraper = new Dictionary<int, List<GoWrapper>>();
+
+        private GObject curComStar;//当前选中的星星
+        private Vector2 lastPos;//鼠标的上一个位置,每颗星星初始时默认为Vector2.right;
+
+        private List<ItemData> _rewardList;
+
+        private const int checkDistance = 40;//鼠标靠近星星周围加减40都算选中星星
+        private const int imgLineWidth = 10;//线的原始长度
+
+        private bool showGuide = false;
+        public override void Dispose()
+        {
+            if (_ui != null)
+            {
+                _ui.Dispose();
+                _ui = null;
+            }
+            base.Dispose();
+        }
+        protected override void OnHide()
+        {
+            int index = 0;
+            GObject star = _ui.target.GetChild(string.Format("comStar{0}_{1}_{2}", _ui.m_ctrlBuyType.selectedIndex, _ui.m_ctrlRewardsType.selectedIndex, index));
+            while (star != null && star.visible == true)
+            {
+                UI_ComStar comStar = UI_ComStar.Proxy(star);
+                for (int i = comStar.target.numChildren - 1; i >= 0; i--)
+                {
+                    if (comStar.target.GetChildAt(i).name == "imgLine") continue;
+                    comStar.target.RemoveChildAt(i);
+                }
+                index++;
+                star = _ui.target.GetChild(string.Format("comStar{0}_{1}_{2}", _ui.m_ctrlBuyType.selectedIndex, _ui.m_ctrlRewardsType.selectedIndex, index));
+                UI_ComStar.ProxyEnd();
+            }
+            foreach (int key in dicGameobj.Keys)
+            {
+                List<GameObject> value = dicGameobj[key];
+                List<GoWrapper> wrappersValue = dicWraper[key];
+                for (int i = 0; i < value.Count; i++)
+                {
+                    SceneController.DestroyObjectFromView(value[i], wrappersValue[i]);
+                }
+            }
+            notClickComStars.Clear();
+            clickComStars.Clear();
+            dicGameobj.Clear();
+            dicWraper.Clear();
+
+            Timers.inst.Remove(CheckGuide);
+        }
+        protected override void OnInit()
+        {
+            base.OnInit();
+            _ui = UI_LuckyBoxStarUI.Create();
+            this.viewCom = _ui.target;
+            isfullScreen = true;
+
+            _ui.m_btnBack.visible = false;
+            _ui.m_btnBack.onClick.Add(OnClickBtnBack);
+
+
+        }
+        protected override void OnShown()
+        {
+            base.OnShown();
+            _ui.target.onTouchBegin.Add(OnClickUIBegin);
+            _ui.target.onTouchMove.Add(OnClickUIMove);
+            _ui.target.onTouchEnd.Add(OnClickUIEnd);
+            _ui.m_effEnd.visible = false;
+            _rewardList = LuckyBoxDataManager.Instance.RewardList;
+            _ui.m_ctrlBuyType.selectedIndex = _rewardList != null && _rewardList.Count > 1 ? 1 : 0;
+
+            bool isLuckyBox = LuckyBoxDataManager.Instance.luckyBoxIds.IndexOf(LuckyBoxDataManager.Instance.currentBoxId) >= 0;
+            _ui.m_ctrlRewardsType.selectedIndex = isLuckyBox ? (LuckyBoxDataManager.Instance.currentBoxId - 1) : 0;
+            string resPath = string.Format("cj_tp_{0}", isLuckyBox ? LuckyBoxDataManager.Instance.currentBoxId : 1);
+            _ui.m_bg.url = ResPathUtil.GetBgImgPath(resPath);
+
+            ResetStartView();
+            Timers.inst.AddUpdate(CheckGuide);
+        }
+
+        private void ResetStartView()
+        {
+            showGuide = GuideDataManager.IsGuideFinish(ConstGuideId.LUCKY_BOX_LINE) <= 0;
+
+            curComStar = null;
+            comStars.Clear();
+            int index = 0;
+            GObject star = _ui.target.GetChild(string.Format("comStar{0}_{1}_{2}", _ui.m_ctrlBuyType.selectedIndex, _ui.m_ctrlRewardsType.selectedIndex, index));
+
+
+            while (star != null && star.visible == true)
+            {
+                UI_ComStar comStar = UI_ComStar.Proxy(star);
+                comStar.m_imgLine.visible = true;
+
+                comStar.m_c1.selectedIndex = 0;
+                comStar.m_imgLine.width = imgLineWidth;
+                comStar.m_imgLine.rotation = 0;
+
+                GComponent gcom = CreateEffect(comStar, 1, "ui_ck"); ;
+                gcom.visible = true;
+                comStar.target.AddChildAt(gcom, 1);
+
+                GComponent gcom1 = CreateEffect(comStar, 2, "ui_ck_dj");
+                gcom1.visible = false;
+                comStar.target.AddChildAt(gcom1, 2);
+
+                GComponent gcom2 = CreateEffect(comStar, 3, "ui_ck_xs");
+                gcom2.visible = false;
+                comStar.target.AddChildAt(gcom2, 3);
+
+                GComponent gcom3 = CreateEffect(comStar, 4, "ui_ck_dj_2");
+                gcom3.visible = false;
+                comStar.target.AddChildAt(gcom3, 4);
+
+
+
+                star.data = new Vector2(comStar.target.x, comStar.target.y);
+                comStars.Add(star);
+
+                index++;
+                star = _ui.target.GetChild(string.Format("comStar{0}_{1}_{2}", _ui.m_ctrlBuyType.selectedIndex, _ui.m_ctrlRewardsType.selectedIndex, index));
+                UI_ComStar.ProxyEnd();
+            }
+
+        }
+        private GComponent CreateEffect(UI_ComStar comStar, int index, string name)
+        {
+            GComponent gcom;
+            if (comStar.target.numChildren > index)
+            {
+                gcom = comStar.target.GetChildAt(index).asCom;
+            }
+            else
+            {
+                gcom = UIPackage.CreateObject("LuckyBox", "ComHolder").asCom;
+                string resPath = ResPathUtil.GetViewEffectPath("ui_ck", name);
+                SceneController.AddObjectToView(null, null, gcom.GetChild("holder").asGraph, resPath, out GameObject gameObject, out GoWrapper wrapper);
+                if (!dicGameobj.ContainsKey(index))
+                {
+                    dicGameobj.Add(index, new List<GameObject>());
+                    dicWraper.Add(index, new List<GoWrapper>());
+                }
+                dicGameobj[index].Add(gameObject);
+                dicWraper[index].Add(wrapper);
+            }
+            return gcom;
+        }
+        private void OnClickUIBegin(EventContext context)
+        {
+            context.CaptureTouch();
+            InputEvent inputEvent = (InputEvent)context.data;
+            Vector2 mousePos = this.viewCom.GlobalToLocal(new Vector2(inputEvent.x, inputEvent.y));
+            CheckNearbyPos(mousePos);
+        }
+        private void OnClickUIMove(EventContext context)
+        {
+            InputEvent inputEvent = (InputEvent)context.data;
+            Vector2 mousePos = this.viewCom.GlobalToLocal(new Vector2(inputEvent.x, inputEvent.y));
+
+            CheckNearbyPos(mousePos);
+
+            if (comStars.Count == 0)//所有星星都点亮了主动结束
+            {
+                this.OnClickUIEnd();
+            }
+        }
+
+        //检测鼠标附近的星星
+        private void CheckNearbyPos(Vector2 mousePos)
+        {
+            for (int i = comStars.Count - 1; i >= 0; i--)
+            {
+                Vector2 comStarPos = (Vector2)comStars[i].data;
+                if (IsSamePos(mousePos, comStarPos))
+                {
+                    if (curComStar != null)
+                    {
+                        SetCurComStarTransfrom(comStarPos);
+                    }
+                    UI_ComStar comStar = UI_ComStar.Proxy(comStars[i]);
+                    comStar.target.GetChildAt(2).asCom.visible = true;
+                    comStar.target.GetChildAt(1).asCom.visible = false;
+                    UI_ComStar.ProxyEnd();
+                    // comStar.m_c1.selectedIndex = 1;
+                    curComStar = comStars[i];
+                    lastPos = Vector2.right;
+
+                    clickComStars.Add(comStars[i]);
+                    comStars.RemoveAt(i);
+
+                }
+                else
+                {
+                    if (curComStar != null)
+                    {
+                        Vector2 curPos = mousePos - (Vector2)curComStar.data;
+                        SetCurComStarTransfrom(mousePos);
+                        lastPos = curPos;
+                    }
+                }
+            }
+
+
+        }
+        private void SetCurComStarTransfrom(Vector2 targetPos)
+        {
+
+            Vector2 curPos = targetPos - (Vector2)curComStar.data;
+            float angle = Vector3.Angle(lastPos, curPos); //求出两向量之间的夹角 
+            Vector3 normal = Vector3.Cross(lastPos, curPos);//叉乘求出法线向量 
+            angle *= Mathf.Sign(Vector3.Dot(normal, Vector3.forward));  //Mathf.Sign()求符号,Vector3.Dot()求方向,求法线向量与物体上方向向量点乘,结果为1或-1,修正旋转方向 
+
+            UI_ComStar comStar = UI_ComStar.Proxy(curComStar);
+            comStar.m_imgLine.rotation += angle;
+            comStar.m_imgLine.width = Vector2.Distance(targetPos, (Vector2)curComStar.data);
+            UI_ComStar.ProxyEnd();
+
+        }
+
+        private void OnClickUIEnd()
+        {
+            if (clickComStars.Count <= 0) return;
+
+            UI_ComStar comStar = UI_ComStar.Proxy(clickComStars[clickComStars.Count - 1]);
+            comStar.m_imgLine.visible = false;
+            UI_ComStar.ProxyEnd();
+
+
+            if (showGuide && clickComStars.Count < 2)
+            {
+                ResetStartView();
+            }
+            else
+            {
+                CheckNotClickComStar();
+                SetComStarDarken();
+                RemoveListener();
+                Timers.inst.Add(1f, 1, SetClickComStarAni);
+
+            }
+        }
+        private void CheckNotClickComStar()
+        {
+            int index = 0;
+            GObject star = _ui.target.GetChild(string.Format("comStar{0}_{1}_{2}", _ui.m_ctrlBuyType.selectedIndex, _ui.m_ctrlRewardsType.selectedIndex, index));
+
+            while (star != null && star.visible == true)
+            {
+                if (clickComStars.IndexOf(star) < 0)
+                {
+                    notClickComStars.Add(star);
+                }
+                index++;
+                star = _ui.target.GetChild(string.Format("comStar{0}_{1}_{2}", _ui.m_ctrlBuyType.selectedIndex, _ui.m_ctrlRewardsType.selectedIndex, index));
+            }
+        }
+
+        private void SetComStarDarken()
+        {
+
+            for (int i = 0; i < notClickComStars.Count; i++)
+            {
+                UI_ComStar notClickComStar = UI_ComStar.Proxy(notClickComStars[i]);
+                notClickComStar.m_imgLine.visible = false;
+                notClickComStar.target.GetChildAt(3).asCom.visible = true;
+                notClickComStar.target.GetChildAt(1).asCom.visible = false;
+                UI_ComStar.ProxyEnd();
+
+            }
+
+        }
+
+        private void SetClickComStarAni(object param)
+        {
+            for (int i = 0; i < clickComStars.Count; i++)
+            {
+                UI_ComStar comStar = UI_ComStar.Proxy(clickComStars[i]);
+                comStar.target.GetChildAt(4).asCom.visible = true;
+                UI_ComStar.ProxyEnd();
+
+            }
+            Timers.inst.Add(0.5f, 1, SetEndEffect);
+        }
+        private void SetEndEffect(object param)
+        {
+            _ui.m_effEnd.visible = true;
+            _ui.m_effEnd.SetPlaySettings(0, -1, 1, -1);
+
+            Timers.inst.Add(0.6f, 1, ClickUIEnd);
+            // ClickUIEnd(null);
+            TryCompleteGuide();
+        }
+        private void ClickUIEnd(object param)
+        {
+            if (curComStar != null)
+            {
+
+                RemoveListener();
+                ViewManager.Show<LuckyBoxBonusView>(new object[] { _rewardList });
+                this.Hide();
+            }
+        }
+
+        private bool IsSamePos(Vector2 mousePos, Vector2 comStarPos)
+        {
+            return (mousePos.x < comStarPos.x + checkDistance) && (mousePos.x > comStarPos.x - checkDistance) && (mousePos.y < comStarPos.y + checkDistance) && (mousePos.y > comStarPos.y - checkDistance);
+        }
+
+        private void RemoveListener()
+        {
+            _ui.target.onTouchBegin.Remove(OnClickUIBegin);
+            _ui.target.onTouchMove.Remove(OnClickUIMove);
+            _ui.target.onTouchEnd.Remove(OnClickUIEnd);
+
+        }
+
+        private void OnClickBtnBack()
+        {
+            this.Hide();
+            RemoveListener();
+
+            ViewManager.Show(ViewName.LUCKY_BOX_VIEW);
+        }
+        private void CheckGuide(object param)
+        {
+            if (GuideDataManager.IsGuideFinish(ConstGuideId.LUCKY_BOX_LINE) <= 0)
+            {
+                UpdateToCheckGuide(null);
+            }
+            else
+            {
+                Timers.inst.Remove(CheckGuide);
+            }
+        }
+
+        protected override void UpdateToCheckGuide(object param)
+        {
+
+            if (!ViewManager.CheckIsTopView(this.viewCom)) return;
+            GuideCfg cfg = GuideCfgArray.Instance.GetCfg(ConstGuideId.LUCKY_BOX_LINE);
+            // GuideController.TryCompleteGuide(ConstGuideId.LUCKY_BOX, 4);
+            GuideController.TryGuide(null, ConstGuideId.LUCKY_BOX_LINE, 1, "点击将星连接在一起。", -1, true, (int)(this.viewCom.height - 200), true);
+            TryCompleteGuide();
+        }
+        protected override void TryCompleteGuide()
+        {
+            if (clickComStars.Count >= 2)
+            {
+                GuideCfg cfg = GuideCfgArray.Instance.GetCfg(ConstGuideId.LUCKY_BOX_LINE);
+
+                GuideController.TryCompleteGuideIndex(cfg.id, 1);
+                GuideController.TryCompleteGuide(ConstGuideId.LUCKY_BOX_LINE, 1);
+            }
+            else
+            {
+                GuideDataManager.SetGuideIndexState(GuideDataManager.currentGuideId, GuideDataManager.currentGuideIdIndex, 0);
+                GuideDataManager.currentGuideIdIndex = 3;
+            }
+
+
+        }
+
+    }
+}

+ 11 - 0
LuckyBox/LuckyBoxStarView.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 1931ef621bc58904b8d55034804cd2b4
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 

+ 434 - 0
LuckyBox/LuckyBoxView.cs

@@ -0,0 +1,434 @@
+using FairyGUI;
+using UI.LuckyBox;
+using UI.CommonGame;
+using System;
+using System.Collections.Generic;
+using UnityEngine;
+using ET;
+
+namespace GFGGame
+{
+    public class LuckyBoxView : BaseView
+    {
+        private UI_LuckyBoxUI _ui;
+        private ValueBarController _valueBarController;
+        private Dictionary<int, LuckyBoxController> _lcukyBoxCtrl = new Dictionary<int, LuckyBoxController>();
+
+        //private GameObject _gameObject;
+        //private GoWrapper _wrapper;
+        //private GameObject _gameObject1;
+        //private GoWrapper _wrapper1;
+        //private GameObject _gameObject2;
+        //private GoWrapper _wrapper2;
+        //private GameObject _gameObject3;
+        //private GoWrapper _wrapper3;
+
+        private DressUpObjUI _dressUpObjUIXiHe;
+
+        //private GameObject _scenePrefab;
+        //private GameObject _sceneObject;
+        //private GoWrapper _wrapper4;
+        //private DressUpObj _dressUpObj;
+        private DressUpObjUI _dressUpObjUIChangXi;
+
+        private bool isActiveBoxOpen = false;
+        private int _activeBoxId = 0;
+        private int _bgIndex = 0;
+        private int _curIndex = 0;
+
+        public override void Dispose()
+        {
+            if (_valueBarController != null)
+            {
+                _valueBarController.Dispose();
+                _valueBarController = null;
+            }
+            foreach (int key in _lcukyBoxCtrl.Keys)
+            {
+                _lcukyBoxCtrl[key].Dispose();
+            }
+            _lcukyBoxCtrl.Clear();
+            if (_dressUpObjUIXiHe != null)
+            {
+                _dressUpObjUIXiHe.Dispose();
+                _dressUpObjUIXiHe = null;
+            }
+            if (_dressUpObjUIChangXi != null)
+            {
+                _dressUpObjUIChangXi.Dispose();
+                _dressUpObjUIChangXi = null;
+            }
+
+            //SceneController.DestroyObjectFromView(_gameObject, _wrapper);
+            //SceneController.DestroyObjectFromView(_gameObject1, _wrapper1);
+            //SceneController.DestroyObjectFromView(_gameObject2, _wrapper2);
+            //SceneController.DestroyObjectFromView(_gameObject3, _wrapper3);
+
+            if (_ui != null)
+            {
+                _ui.Dispose();
+                _ui = null;
+            }
+            base.Dispose();
+        }
+
+        protected override void OnInit()
+        {
+            base.OnInit();
+            packageName = UI_LuckyBoxUI.PACKAGE_NAME;
+            _ui = UI_LuckyBoxUI.Create();
+            this.viewCom = _ui.target;
+            isfullScreen = true;
+
+            _dressUpObjUIXiHe = new DressUpObjUI("SceneDressUp");
+            _dressUpObjUIChangXi = new DressUpObjUI("SceneDressUp");
+            // _ui.m_txtRemainTimes.visible = false;
+            _valueBarController = new ValueBarController(_ui.m_valueBar);
+            _ui.m_btnBack.onClick.Add(OnClickBtnBack);
+            _ui.m_btnHome.onClick.Add(OnClickBtnHome);
+
+            _ui.m_btnLeft.onClick.Add(OnBtnLeftClick);
+            _ui.m_btnRight.onClick.Add(OnBtnRightClick);
+
+            _ui.m_listBg.SetVirtual();
+            _ui.m_listBg.itemRenderer = RenderListBgItem;
+            _ui.m_listBg.itemProvider = GetListItemResource;
+            _ui.m_listBg.scrollPane.onScrollEnd.Add(OnListBgScroll);
+
+            _ui.m_loaBg.url = ResPathUtil.GetBgImgPath("jingzhongh_bg");
+        }
+        protected override void AddEventListener()
+        {
+            base.AddEventListener();
+
+            EventAgent.AddEventListener(ConstMessage.ITEM_CHANGED, OnListBgScroll);
+            EventAgent.AddEventListener(ConstMessage.NUMERIC_CHANGE, OnListBgScroll);
+        }
+        protected override void OnShown()
+        {
+            base.OnShown();
+
+            LuckyBoxDataManager.Instance.luckyBoxIds.Clear();
+            LuckyBoxDataManager.Instance.luckyBoxIds.Add(LuckyBoxDataManager.BOX_ID_2);
+            LuckyBoxDataManager.Instance.luckyBoxIds.Add(LuckyBoxDataManager.BOX_ID_3);
+            _activeBoxId = 0;
+            if (LuckyBoxDataManager.Instance.RotatingId > 0)
+            {
+                RotatingLuckyBoxCfg rotatingLuckyBox = RotatingLuckyBoxCfgArray.Instance.GetCfg(LuckyBoxDataManager.Instance.RotatingId);
+                _activeBoxId = rotatingLuckyBox.luckyBoxId;
+                LuckyBoxDataManager.Instance.endTime = TimeUtil.GetTimestamp(rotatingLuckyBox.endTime);
+                LuckyBoxDataManager.Instance.luckyBoxIds.Insert(0, _activeBoxId);
+            }
+
+            int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[0];
+            if (this.viewData != null)
+            {
+                boxId = (int)this.viewData;
+            }
+
+            if (GuideDataManager.IsGuideFinish(ConstGuideId.LUCKY_BOX) <= 0) boxId = LuckyBoxDataManager.BOX_ID_2;
+            LuckyBoxDataManager.Instance.currentBoxId = boxId;
+
+            if (_activeBoxId > 0) Timers.inst.Add(1, 0, CheckTime);
+
+            _valueBarController.OnShown();
+            _valueBarController.Controller(4);
+
+            _curIndex = LuckyBoxDataManager.Instance.luckyBoxIds.IndexOf(boxId);
+            _ui.m_listBg.numItems = LuckyBoxDataManager.Instance.luckyBoxIds.Count;
+            _ui.m_listBg.ScrollToView(_curIndex);
+            _ui.m_listBg.scrollPane.decelerationRate = 0.8f;
+
+            OnListBgScroll();
+            updateBoxEffect();
+
+            Timers.inst.AddUpdate(CheckGuide);
+        }
+        private string GetListItemResource(int index)
+        {
+            if (index == 0 && _activeBoxId > 0)
+            {
+                return "UI://LuckyBox/ComBox";
+            }
+            else
+            {
+                int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[index];
+                return string.Format("UI://LuckyBox/ComBox_{0}", boxId);
+            }
+        }
+        private void RenderListBgItem(int index, GObject obj)
+        {
+            int boxId = LuckyBoxDataManager.Instance.luckyBoxIds[index];
+            LuckyBoxCfg cfg = LuckyBoxCfgArray.Instance.GetCfg(boxId);
+            LuckyBoxDataManager.Instance.InitData(boxId);
+
+            UI_ComBox comBox = UI_ComBox.Proxy(obj);
+            comBox.m_comModel.m_loaBg.url = ResPathUtil.GetBgImgPath(cfg.resArr[_bgIndex]);
+            if (!_lcukyBoxCtrl.ContainsKey(boxId))
+            {
+                _lcukyBoxCtrl.Add(boxId, new LuckyBoxController(comBox.m_comModel.target));
+                if (_ui.m_listBg.ChildIndexToItemIndex(0) == index)
+                {
+                    _lcukyBoxCtrl[boxId].OnShown(boxId);
+                }
+            }
+            comBox.m_btnPreview.m_c1.selectedIndex = boxId;
+            LuckyBoxDataManager.Instance.GetOwnedCount(boxId, out int count, out int totalCount);
+            comBox.m_txtOwned.SetVar("v1", "" + count).FlushVars();
+            comBox.m_txtOwned.SetVar("v2", "" + totalCount).FlushVars();
+            int boughtCount = GameGlobal.myNumericComponent.GetAsInt(cfg.numericType);
+            comBox.m_txtRemainTimes.text = string.Format("今日剩余次数:{0}", cfg.maxCount - boughtCount);
+            comBox.m_comCostOne.m_txtCost.text = cfg.costNum.ToString();
+            comBox.m_comCostOne.m_loaCost.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(cfg.costID).res);
+            comBox.m_comCostTen.m_txtCost.text = cfg.costNumTen.ToString();
+            comBox.m_comCostTen.m_loaCost.url = ResPathUtil.GetCommonGameResPath(ItemCfgArray.Instance.GetCfg(cfg.costID).res);
+            if (comBox.m_btnBuyOne.target.data == null)
+            {
+                comBox.m_btnBuyOne.target.onClick.Add(OnClickBtnBuyOne);
+            }
+            comBox.m_btnBuyOne.target.data = boxId;
+
+            if (comBox.m_btnBuyTen.target.data == null)
+            {
+                comBox.m_btnBuyTen.target.onClick.Add(OnClickBtnBuyTen);
+            }
+            comBox.m_btnBuyTen.target.data = boxId;
+
+            if (comBox.m_btnPreview.target.data == null)
+            {
+                comBox.m_btnPreview.target.onClick.Add(OnClickBtnPreview);
+            }
+            comBox.m_btnPreview.target.data = boxId;
+
+            obj.data = boxId;
+            // if (comBox.m_grpLuckyBox != null)
+            // {
+            //     comBox.m_grpLuckyBox.visible = boxId == _activeBoxId;
+            // }
+            if (boxId == _activeBoxId)
+            {
+                long endTime = LuckyBoxDataManager.Instance.endTime;
+                long curTime = TimeHelper.ServerNow();
+                TimeUtil.FormattingTime(curTime, endTime, out int num, out string str);
+                comBox.m_txtTime.text = string.Format("剩余{0}{1}", num, str);
+                comBox.m_grpLuckyBox.visible = boxId == _activeBoxId;
+            }
+
+            UI_ComBox.ProxyEnd();
+
+        }
+
+        // private void UpdateBg(object param)
+        // {
+        //     string[] resArr = LuckyBoxCfgArray.Instance.GetCfg(LuckyBoxDataManager.Instance.currentBoxId).resArr;
+        //     _bgIndex++;
+        //     if (_bgIndex >= resArr.Length) _bgIndex = 0;
+        //     GObject gObject = _ui.m_listBg.GetChildAt(0);
+        //     if (gObject == null) return;
+        //     GComponent item = gObject.asCom;
+        //     if (item.gameObjectName != "ComBox_2") return;
+        //     GLoader loaBg = item.GetChild("loaBg").asLoader;
+        //     loaBg.url = ResPathUtil.GetBgImgPath(resArr[_bgIndex]);
+        // }
+
+
+        private void OnBtnLeftClick()
+        {
+            int index = _curIndex - 1;
+            // _curIndex--;
+            index = Mathf.Max(0, index);
+            _ui.m_listBg.ScrollToView(index, true);
+            // OnListBgScroll();
+        }
+
+        private void OnBtnRightClick()
+        {
+            int index = _curIndex + 1;
+            // _curIndex++;
+            index = Mathf.Min(_ui.m_listBg.numItems - 1, index);
+            _ui.m_listBg.ScrollToView(index, true);
+            // OnListBgScroll();
+        }
+
+        private void OnListBgScroll()
+        {
+            _lcukyBoxCtrl[LuckyBoxDataManager.Instance.currentBoxId].OnHide();
+            _curIndex = _ui.m_listBg.ChildIndexToItemIndex(0);
+            LuckyBoxDataManager.Instance.currentBoxId = LuckyBoxDataManager.Instance.luckyBoxIds[_curIndex];
+
+            _bgIndex = 0;
+            _valueBarController.UpdateCJ();
+            _lcukyBoxCtrl[LuckyBoxDataManager.Instance.currentBoxId].OnShown(LuckyBoxDataManager.Instance.currentBoxId);
+            _ui.m_btnLeft.grayed = _curIndex <= 0;
+            _ui.m_btnRight.grayed = _curIndex >= _ui.m_listBg.numItems - 1;
+
+        }
+
+        private void CheckTime(object param = null)
+        {
+            if (LuckyBoxDataManager.Instance.currentBoxId != _activeBoxId) return;
+            long endTime = LuckyBoxDataManager.Instance.endTime;
+            long curTime = TimeHelper.ServerNow();
+            TimeUtil.FormattingTime(curTime, endTime, out int num, out string str);
+
+            GObject item = _ui.m_listBg.GetChildAt(0);
+            if (item == null) return;
+            GObject textField = item.asCom.GetChild("txtTime");
+            if (textField == null) return;
+            textField.asTextField.text = string.Format("剩余{0}{1}", num, str);
+        }
+        private void updateBoxEffect()
+        {
+            if (isActiveBoxOpen)
+            {
+                // int index = Array.IndexOf(LuckyBoxDataManager.Instance.luckyBoxIds, LuckyBoxDataManager.BOX_ID_1);
+                // UI_ComListBgItem item = UI_ComListBgItem.Proxy(_ui.m_listBg.GetChildAt(index));
+                // string resPath = ResPathUtil.GetViewEffectPath("ui_cj", "ui_cj_bt");
+                // SceneController.AddObjectToView(_gameObject, _wrapper, item.m_holder, resPath, out _gameObject, out _wrapper);
+                // string resPath3 = ResPathUtil.GetDressUpAnimationPath("dz_jiyuet");
+                // SceneController.AddObjectToView(_gameObject3, _wrapper3, item.m_holder1, resPath3, out _gameObject3, out _wrapper3, 120);
+
+                // string resPath1 = ResPathUtil.GetViewEffectPath("ui_cj", "ui_cj_sl");
+                // SceneController.AddObjectToView(_gameObject1, _wrapper1, _ui.m_btnBuyOne.m_holder, resPath1, out _gameObject1, out _wrapper1);
+                // SceneController.AddObjectToView(_gameObject2, _wrapper2, _ui.m_btnBuyTen.m_holder, resPath1, out _gameObject2, out _wrapper2);
+                // UI_ComListBgItem.ProxyEnd();
+
+            }
+        }
+        // private void OnClickBtnExChange(EventContext context)
+        // {
+        //     GObject obj = context.sender as GObject;
+        //     int boxId = (int)obj.data;
+        //     int storeId = boxId == LuckyBoxDataManager.BOX_ID_1 ? ConstStoreId.LUCKY_BOX_ACTIVITY_STORE_ID : ConstStoreId.LUCKY_BOX_STORE_ID;
+        //     ViewManager.Show(ViewName.CLOTHING_SHOP_VIEW, new object[] { storeId }, new object[] { ViewName.LUCKY_BOX_VIEW, boxId });
+        //     this.Hide();
+        // }
+        private void OnClickBtnPreview(EventContext context)
+        {
+            GObject obj = context.sender as GObject;
+            int boxId = (int)obj.data;
+            ViewManager.Show(ViewName.LUCKY_BOX_PRE_SHOW_VIEW, boxId);
+        }
+        private void OnClickBtnBuyOne(EventContext context)
+        {
+            GObject obj = context.sender as GObject;
+            int boxId = (int)obj.data;
+            LuckyBoxCfg luckyBoxCfg = LuckyBoxCfgArray.Instance.GetCfg(boxId);
+            int boughtCount = GameGlobal.myNumericComponent.GetAsInt(luckyBoxCfg.numericType);
+            if (boughtCount + LuckyBoxDataManager.ONCE_TIME > luckyBoxCfg.maxCount)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("抽奖次数不足");
+                return;
+            }
+            LuckyBoxDataManager.Instance.CheckItemEnough(boxId, LuckyBoxDataManager.ONCE_TIME, async () =>
+             {
+                 bool result = await LuckyBoxSProxy.ReqGetBonus(boxId, LuckyBoxDataManager.ONCE_TIME);
+                 if (result)
+                 {
+                     ViewManager.Show(ViewName.LUCKY_BOX_STAR_VIEW, null, new object[] { ViewName.LUCKY_BOX_VIEW, boxId });
+                     LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.ZAI_XING, 2);
+                 }
+             });
+        }
+
+        private void OnClickBtnBuyTen(EventContext context)
+        {
+
+            GuideCfg cfg = GuideCfgArray.Instance.GetCfg(ConstGuideId.LUCKY_BOX);
+            if (GuideDataManager.IsGuideFinish(ConstGuideId.LUCKY_BOX) <= 0 && (GuideDataManager.currentGuideId == 0 || GuideDataManager.currentGuideIdIndex != 2))
+            {
+                //防止点击太快,在引导开启前就被点击到,导致引导卡死
+                return;
+            }
+            GObject obj = context.sender as GObject;
+            int boxId = (int)obj.data;
+            LuckyBoxCfg luckyBoxCfg = LuckyBoxCfgArray.Instance.GetCfg(boxId);
+            int boughtCount = GameGlobal.myNumericComponent.GetAsInt(luckyBoxCfg.numericType);
+            if (boughtCount + LuckyBoxDataManager.TEN_TIME > luckyBoxCfg.maxCount)
+            {
+                PromptController.Instance.ShowFloatTextPrompt("抽奖次数不足");
+                return;
+            }
+            LuckyBoxDataManager.Instance.CheckItemEnough(boxId, LuckyBoxDataManager.TEN_TIME, async () =>
+            {
+
+                bool result = await LuckyBoxSProxy.ReqGetBonus(boxId, LuckyBoxDataManager.TEN_TIME);
+                if (result)
+                {
+
+                    ViewManager.Show(ViewName.LUCKY_BOX_STAR_VIEW, null, new object[] { ViewName.LUCKY_BOX_VIEW, boxId });
+                    LogServerHelper.SendPlayParticipationLog((int)PlayParticipationEnum.ZAI_XING, 2);
+
+                }
+            });
+        }
+
+        protected override void OnHide()
+        {
+            base.OnHide();
+            _valueBarController.OnHide();
+            foreach (int key in _lcukyBoxCtrl.Keys)
+            {
+                _lcukyBoxCtrl[key].OnHide();
+            }
+
+            Timers.inst.Remove(CheckTime);
+            // Timers.inst.Remove(UpdateBg);
+            Timers.inst.Remove(CheckGuide);
+            // Timers.inst.Remove(UpdateTime);
+        }
+
+        protected override void RemoveEventListener()
+        {
+            base.RemoveEventListener();
+            EventAgent.RemoveEventListener(ConstMessage.ITEM_CHANGED, OnListBgScroll);
+            EventAgent.RemoveEventListener(ConstMessage.NUMERIC_CHANGE, OnListBgScroll);
+        }
+
+        private void OnClickBtnBack()
+        {
+            Reset();
+            ViewManager.GoBackFrom(ViewName.LUCKY_BOX_VIEW);
+
+        }
+
+        private void OnClickBtnHome()
+        {
+            GameController.GoBackToMainView();
+        }
+
+        private void Reset()
+        {
+            LuckyBoxDataManager.Instance.currentBoxId = LuckyBoxDataManager.Instance.luckyBoxIds[0];
+
+        }
+        private void CheckGuide(object param)
+        {
+            if (GuideDataManager.IsGuideFinish(ConstGuideId.LUCKY_BOX) <= 0)
+            {
+                UpdateToCheckGuide(null);
+            }
+            else
+            {
+                Timers.inst.Remove(CheckGuide);
+            }
+        }
+
+        protected override void UpdateToCheckGuide(object param)
+        {
+            if (!ViewManager.CheckIsTopView(this.viewCom)) return;
+            GObject gObject = _ui.m_listBg.GetChildAt(0);
+            if (gObject == null) return;
+            GButton btnBuyTen = gObject.asCom.GetChild("btnBuyTen").asButton;
+
+            GuideController.TryGuide(null, ConstGuideId.LUCKY_BOX, 1, "“摘星”里可以通过星辰的力量获得服饰。", -1, true, _ui.target.height - 600);
+            GuideController.TryGuide(btnBuyTen, ConstGuideId.LUCKY_BOX, 2, "点击摘取十次。");
+        }
+        protected override void TryCompleteGuide()
+        {
+            base.TryCompleteGuide();
+            GuideCfg cfg = GuideCfgArray.Instance.GetCfg(ConstGuideId.LUCKY_BOX);
+            GuideController.TryCompleteGuideIndex(cfg.id, 2);
+        }
+    }
+}

+ 11 - 0
LuckyBox/LuckyBoxView.cs.meta

@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: 9592db7063c1f7b4192fdb7d5f73cf82
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: