少年修仙传客户端代码仓库
client_linchunjie
2018-10-24 e89c81f45f344186069dc9cfa8b4e232f6f9822d
Merge branch 'master' of http://192.168.0.87:10010/r/snxxz_scripts
6个文件已修改
2个文件已添加
252 ■■■■■ 已修改文件
System/KnapSack/New/CommonItemBaisc.cs 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/MainInterfacePanel/MainInterfaceWin.cs 11 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/OpenServerActivity/WishItemCell.cs 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/OpenServerActivity/WishingGetItemWin.cs 87 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/OpenServerActivity/WishingGetItemWin.cs.meta 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/OpenServerActivity/WishingPoolModel.cs 45 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/OpenServerActivity/WishingPoolWin.cs 86 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
Utility/EnumHelper.cs 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
System/KnapSack/New/CommonItemBaisc.cs
@@ -218,7 +218,7 @@
        {
            ItemConfig config = Config.Instance.Get<ItemConfig>(itemId);
            int playerJob = PlayerDatas.Instance.baseData.Job;
            if (config == null || (!isCompare && compareSocre == score) || config.EquipPlace == 0
            if (config == null || (!isCompare && compareSocre == 0) || config.EquipPlace == 0
                || (score == compareSocre && compareSocre != 0) || (compareSocre <= 0 && (type == PackType.rptEquip || type == PackType.rptDogzEquip))) return 0;
            ItemModel model = playerPack.GetItemModelByGUID(guid);
System/MainInterfacePanel/MainInterfaceWin.cs
@@ -202,7 +202,7 @@
            m_TeamInvitationEntrance.Init();
            m_FairyCallBehaviour.Init();
            m_BossBriefInfos.gameObject.SetActive(false);
            ClickWishAward();
            UpdateWishAwardImag();
            ArticleExperience();//关于经验条
            FriendQuestBtn();
            UpdateFairyRequest();
@@ -228,7 +228,7 @@
            RedpointCenter.Instance.redpointValueChangeEvent += RedpointValueChangeEvent;
            NewBieCenter.Instance.guideBeginEvent += GuideBeginEvent;
            fairyGrabBossModel.bossGrabHintEvent += bossGrabHintEvent;
            wishModel.UpdateWishAwardEvent += ClickWishAward;
            wishModel.UpdateWishAwardEvent += UpdateWishAwardImag;
            fairyGrabBossModel.gotoBossStateUpdate += ShowFairyGrabBoss;
        }
@@ -400,7 +400,7 @@
            GA_NpcCollect.OnArrive -= OnArriveCollectNPC;
            GA_NpcCollect.OnLeave -= OnLeaveCollectNpc;
            fairyGrabBossModel.bossGrabHintEvent -= bossGrabHintEvent;
            wishModel.UpdateWishAwardEvent -= ClickWishAward;
            wishModel.UpdateWishAwardEvent -= UpdateWishAwardImag;
            m_CollectBtn.gameObject.SetActive(false);
        }
@@ -660,6 +660,11 @@
        private void ClickWishAward()
        {
            WindowCenter.Instance.Open<WishingGetItemWin>();
        }
        private void UpdateWishAwardImag()
        {
            WishingAwardImg.gameObject.SetActive(wishModel.wishingAwardDict.Count > 0 ? true : false);
        }
System/OpenServerActivity/WishItemCell.cs
@@ -17,6 +17,7 @@
        {
            WishingPoolModel.WishingWellItem wellItem = null;
            bool isWishData = wishingModel.TryGetWishDataByIndex(index, out wellItem);
            noneItemBtn.RemoveAllListeners();
            if (isWishData)
            {
                nameText.gameObject.SetActive(true);
@@ -41,6 +42,10 @@
                noneItemObj.gameObject.SetActive(true);
                nameText.gameObject.SetActive(false);
                bestIconObj.SetActive(false);
                noneItemBtn.AddListener(()=>
                {
                    wishingModel.SetHandMovePos(index);
                });
            }
        }
    }
System/OpenServerActivity/WishingGetItemWin.cs
New file
@@ -0,0 +1,87 @@
using System.Collections.Generic;
using System.Linq;
using UnityEngine;
using UnityEngine.UI;
using System;
namespace Snxxz.UI
{
    public class WishingGetItemWin : Window
    {
        [SerializeField] Button sureBtn;
        [SerializeField] List<AwardItem> awardItems = new List<AwardItem>();
        WishingPoolModel wishModel { get { return ModelCenter.Instance.GetModel<WishingPoolModel>(); } }
        ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
        protected override void BindController()
        {
        }
        protected override void AddListeners()
        {
            sureBtn.AddListener(ClickRecevie);
        }
        protected override void OnPreOpen()
        {
            SetDisplayModel();
        }
        protected override void OnAfterOpen()
        {
            transform.SetAsLastSibling();
        }
        protected override void OnPreClose()
        {
        }
        protected override void OnAfterClose()
        {
        }
        private void SetDisplayModel()
        {
            List<WishingPoolModel.WishingWellItem> wellItems = wishModel.wishingAwardDict.Values.ToList();
            for (int i = 0; i < awardItems.Count; i++)
            {
                var awardItem = awardItems[i];
                if (i < wellItems.Count)
                {
                    awardItem.parentObj.SetActive(true);
                    var wellItem = wellItems[i];
                    ItemCellModel cellModel = new ItemCellModel((int)wellItem.itemId, true
                        , (ulong)wellItem.itemCount, wellItem.isBind);
                    awardItem.itemBaisc.Init(cellModel);
                    awardItem.bestIconObj.SetActive(wellItem.isBest == 0 ? false : true);
                    awardItem.itemBaisc.cellBtn.RemoveAllListeners();
                    awardItem.itemBaisc.cellBtn.AddListener(() =>
                    {
                        ItemAttrData attrData = new ItemAttrData((int)wellItem.itemId, true
                        , (ulong)wellItem.itemCount, -1,wellItem.isBind);
                        tipsModel.SetItemTipsModel(attrData);
                    });
                }
                else
                {
                    awardItem.parentObj.gameObject.SetActive(false);
                }
            }
        }
        private void ClickRecevie()
        {
            wishModel.SendGetAwardQuest();
            CloseClick();
        }
        [Serializable]
        public class AwardItem
        {
            public GameObject parentObj;
            public CommonItemBaisc itemBaisc;
            public GameObject bestIconObj;
        }
    }
}
System/OpenServerActivity/WishingGetItemWin.cs.meta
New file
@@ -0,0 +1,12 @@
fileFormatVersion: 2
guid: a946e5a3486ff5f4b88beb7fc4284d30
timeCreated: 1540352052
licenseType: Pro
MonoImporter:
  serializedVersion: 2
  defaultReferences: []
  executionOrder: 0
  icon: {instanceID: 0}
  userData:
  assetBundleName:
  assetBundleVariant:
System/OpenServerActivity/WishingPoolModel.cs
@@ -15,10 +15,12 @@
        public const int WishRedKey = 20915;
        public override void Init()
        {
            ParseConfig();
            OperationTimeHepler.Instance.operationStartEvent += OperationStartEvent;
            OperationTimeHepler.Instance.operationEndEvent += OperationEndEvent;
            OperationTimeHepler.Instance.operationAdvanceEvent += OperationAdvanceEvent;
            OpenServerActivityCenter.Instance.Register((int)OpenServerActivityCenter.OSActivityType.WishingPool, this);
            SetWishRedpoint();
        }
        public void OnBeforePlayerDataInitialize()
@@ -120,7 +122,37 @@
            return false;
        }
        public bool IsBestItem()
        {
            foreach(var key in poolDataDict.Keys)
            {
                if(poolDataDict[key].isBest == 1)
                {
                    return true;
                }
            }
            return false;
        }
        public int handStartIndex { get; private set; }
        public int handEndIndex { get; private set;}
        public event Action UpdateHandMoveEvent;
        public void SetHandMovePos(int wishIndex)
        {
            foreach(var key in poolDataDict.Keys)
            {
                if(poolDataDict[key].itemId != 0)
                {
                    handStartIndex = key;
                    break;
                }
            }
            handEndIndex = wishIndex;
            if(UpdateHandMoveEvent != null)
            {
                UpdateHandMoveEvent();
            }
        }
        #region 本地数据
        public bool isDraging { get; set; }
@@ -168,8 +200,11 @@
            for (int i = 0; i < wishInfo.LastAwardCnt; i++)
            {
                var itemInfo = wishInfo.LastAwardItemInfo[i];
                if(itemInfo.ItemID != 0)
                {
                WishingWellItem wellItem = new WishingWellItem((int)itemInfo.ItemID, itemInfo.ItemCnt, itemInfo.IsBind, itemInfo.IsSpecial);
                SetWishingAwardData(i, wellItem);
                }
            }
            UpdateRedpoint();
            if(UpdateWishAwardEvent != null)
@@ -299,6 +334,16 @@
            GameNetSystem.Instance.SendInfo(wishingRefresh);
        }
        public void SendGetAwardQuest()
        {
            CA504_tagCMPlayerGetReward getReward = new CA504_tagCMPlayerGetReward();
            getReward.RewardType = (byte)GotServerRewardType.Def_RewardType_WishingWell;
            getReward.DataEx = 0;
            getReward.DataExStrLen = 0;
            getReward.DataExStr = string.Empty;
            GameNetSystem.Instance.SendInfo(getReward);
        }
        public void SendRefreshWishInfo(int poolIndex,int wishIndex)
        {
            CAA06_tagCMActWishing actWishing = new CAA06_tagCMActWishing();
System/OpenServerActivity/WishingPoolWin.cs
@@ -2,6 +2,7 @@
using UnityEngine.UI;
using System.Collections.Generic;
using System;
using DG.Tweening;
namespace Snxxz.UI
{
@@ -20,6 +21,12 @@
        [SerializeField] List<WishItemCell> wishingCells = new List<WishItemCell>();
        [SerializeField] GameObject activityOpenObj;
        [SerializeField] GameObject activityCloseObj;
        [Header("动画控制")]
        [SerializeField] RectTransform handImg;
        [SerializeField] PositionTween positionTween;
        [SerializeField] UIAlphaTween alphaTween;
        [SerializeField] List<Vector2> startPos = new List<Vector2>();
        [SerializeField] List<Vector2> endPos = new List<Vector2>();
        ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
        WishingPoolModel wishingModel { get { return ModelCenter.Instance.GetModel<WishingPoolModel>(); } }
@@ -44,6 +51,7 @@
            wishingModel.UpdatePoolDataEvent += UpdatePoolItemByIndex;
            wishingModel.UpdateWishingDataEvent += UpdateWishItemByIndex;
            GlobalTimeEvent.Instance.secondEvent += UpdateSecond;
            wishingModel.UpdateHandMoveEvent += UpdateHandMove;
        }
        protected override void OnAfterOpen()
@@ -56,6 +64,7 @@
            wishingModel.UpdateWishingDataEvent -= UpdateWishItemByIndex;
            GlobalTimeEvent.Instance.secondEvent -= UpdateSecond;
            OperationTimeHepler.Instance.operationEndEvent -= OperationEndEvent;
            wishingModel.UpdateHandMoveEvent -= UpdateHandMove;
        }
        protected override void OnAfterClose()
        {
@@ -79,6 +88,31 @@
            UpdateDayRemainTime();
            activityDayText.text = Language.Get("WishingPool103", operation.GetActivityDay());
            totalDayText.text = Language.Get("WishingPool101", Language.Get(StringUtility.Contact("Num_CHS_", operation.totalDays + 1)));
            handImg.gameObject.SetActive(false);
        }
        private void UpdateHandMove()
        {
            PlayHandMovePos();
        }
        private void PlayHandMovePos()
        {
            positionTween.from = startPos[wishingModel.handStartIndex];
            positionTween.to = endPos[wishingModel.handEndIndex];
            positionTween.SetStartState();
            alphaTween.from = 0;
            alphaTween.to = 1;
            alphaTween.SetStartState();
            handImg.gameObject.SetActive(true);
            int offset = wishingModel.handStartIndex % 4 - wishingModel.handEndIndex;
            positionTween.duration = Mathf.Max(2, Mathf.Abs(offset));
            alphaTween.Play();
            positionTween.Play(() =>
            {
                handImg.gameObject.SetActive(false);
            });
        }
        #region 许愿逻辑
@@ -107,6 +141,7 @@
       
        private void CheckWishingCell()
        {
            bool isAddWish = false;
            for(int i = 0; i < wishingCells.Count; i++)
            {
                var rect = wishingCells[i].transform as RectTransform;
@@ -128,9 +163,14 @@
                    //    wishingModel.SetWishingPoolData(wishingModel.dragIndex,wellWishItem);
                    //}
                    //wishingModel.SetWishingData(i,wellPoolItem);
                    isAddWish = true;
                    wishingModel.SendRefreshWishInfo(wishingModel.dragIndex,i);
                    break;
                }
            }
            if(!isAddWish)
            {
                UpdatePoolItem();
            }
        }
@@ -144,6 +184,7 @@
                dragItem.dragBestIcon.SetActive(false);
                ItemCellModel cellModel = new ItemCellModel(wellItem.itemId,false,(ulong)wellItem.itemCount,wellItem.isBind);
                dragItem.dragItemBasic.Init(cellModel);
                poolItemCells[wishingModel.dragIndex].gameObject.SetActive(false);
            }
            else
            {
@@ -256,13 +297,58 @@
        private void ClickMoneyRefreshWish()
        {
            if(!wishingModel.IsBestItem())
            {
                CheckMoney();
            }
            else
            {
                ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("WishingPool106", wishingModel.wishingPrice), (bool isOk) =>
                {
                    if (isOk)
                    {
                        CheckMoney();
                    }
                });
            }
        }
        private void CheckMoney()
        {
            if ((int)UIHelper.GetMoneyCnt(1) < wishingModel.wishingPrice)
            {
                WindowCenter.Instance.Open<RechargeTipWin>();
            }
            else
            {
                ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("WishingPool105", wishingModel.wishingPrice), (bool isOk) =>
                {
                    if (isOk)
                    {
            wishingModel.SendRefreshPoolInfo(0);
                    }
                });
            }
        }
        private void ClickFreeRefreshWish()
        {
            if (!wishingModel.IsBestItem())
            {
            wishingModel.SendRefreshPoolInfo(1);
        }
            else
            {
                ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("WishingPool106", wishingModel.wishingPrice), (bool isOk) =>
                {
                    if (isOk)
                    {
                        wishingModel.SendRefreshPoolInfo(1);
                    }
                });
            }
        }
        #endregion
    }
Utility/EnumHelper.cs
@@ -1163,9 +1163,9 @@
    Def_RewardType_TreasureSoul = 9,//法宝魂奖励
    Def_RewardType_ConsumeRebate = 11,//消费返利奖励
    Def_RewardType_BossReborn = 12,//boss复活奖励
    Def_RewardType_FCRecharge = 13,// 仙界盛典充值大礼13
    Def_RewardType_FCRecharge = 13,// 仙界盛典充值大礼13W
    Def_RewardType_FCParty = 14,// 仙界盛典全民来嗨14
    Def_RewardType_WishingWell = 16,//  许愿池奖励16
}
public enum MapType