5930 子 【开发】【1.5.100】诛仙装备开发 / 【前端】【1.5.100】诛仙装备开发
| | |
| | | Register(typeof(HC102_tagMCCrossRealmPKAwardState), typeof(DTCC102_tagMCCrossRealmPKAwardState));
|
| | | Register(typeof(HC005_tagGCCrossRealmPKBillboardInfo), typeof(DTCC005_tagGCCrossRealmPKBillboardInfo));
|
| | | Register(typeof(HC006_tagGCCrossRealmPKSeasonState), typeof(DTCC006_tagGCCrossRealmPKSeasonState));
|
| | | Register(typeof(HA815_tagMCZhuXianDecomposeResult), typeof(DTCA815_tagMCZhuXianDecomposeResult));
|
| | |
|
| | | #region 背包
|
| | | Register(typeof(H0724_tagRolePackCanUseCount), typeof(DTC0724_tagRolePackCanUseCount));
|
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // A3 32 诛仙装备分解 #tagCMZhuXianEquipDecompose
|
| | |
|
| | | public class CA332_tagCMZhuXianEquipDecompose : GameNetPackBasic {
|
| | | public byte Count; //材料所在背包索引的数量
|
| | | public ushort[] IndexList; //材料所在背包索引列表
|
| | | public uint[] ItemIDList; //材料所在背包物品ID列表
|
| | | public byte IsAuto; //是否自动分解
|
| | |
|
| | | public CA332_tagCMZhuXianEquipDecompose () {
|
| | | combineCmd = (ushort)0x03FE;
|
| | | _cmd = (ushort)0xA332;
|
| | | }
|
| | |
|
| | | public override void WriteToBytes () {
|
| | | WriteBytes (Count, NetDataType.BYTE);
|
| | | WriteBytes (IndexList, NetDataType.WORD, Count);
|
| | | WriteBytes (ItemIDList, NetDataType.DWORD, Count);
|
| | | WriteBytes (IsAuto, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 59fd31bf691c8de45befe15b1f45fd79 |
| | | timeCreated: 1548228630 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | | using Snxxz.UI;
|
| | |
|
| | | // A8 15 诛仙装备分解结果通知 #tagMCZhuXianDecomposeResult
|
| | |
|
| | |
|
| | |
|
| | | public class DTCA815_tagMCZhuXianDecomposeResult : DtcBasic {
|
| | |
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | |
|
| | | base.Done(vNetPack);
|
| | |
|
| | | HA815_tagMCZhuXianDecomposeResult vNetData = vNetPack as HA815_tagMCZhuXianDecomposeResult;
|
| | | var model = ModelCenter.Instance.GetModel<JadeDynastyDecomposeModel>();
|
| | | model.UpdateJadeDynastyDecomposeResult(vNetData);
|
| | | }
|
| | |
|
| | | }
|
| | |
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 89773dd503eda2b46ada6ec382c07cb6 |
| | | timeCreated: 1548228630 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using UnityEngine;
|
| | | using System.Collections;
|
| | |
|
| | | // A8 15 诛仙装备分解结果通知 #tagMCZhuXianDecomposeResult
|
| | |
|
| | | public class HA815_tagMCZhuXianDecomposeResult : GameNetPackBasic {
|
| | | public byte Cnt; //数量
|
| | | public tagMCZhuXianDecomposeItem[] ItemList;
|
| | |
|
| | | public HA815_tagMCZhuXianDecomposeResult () {
|
| | | _cmd = (ushort)0xA815;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out Cnt, vBytes, NetDataType.BYTE);
|
| | | ItemList = new tagMCZhuXianDecomposeItem[Cnt];
|
| | | for (int i = 0; i < Cnt; i ++) {
|
| | | ItemList[i] = new tagMCZhuXianDecomposeItem();
|
| | | TransBytes (out ItemList[i].ItemID, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out ItemList[i].ItemCnt, vBytes, NetDataType.BYTE);
|
| | | TransBytes (out ItemList[i].IsBind, vBytes, NetDataType.BYTE);
|
| | | }
|
| | | }
|
| | |
|
| | | public struct tagMCZhuXianDecomposeItem {
|
| | | public uint ItemID; //物品ID
|
| | | public byte ItemCnt; //物品数量
|
| | | public byte IsBind; //是否绑定
|
| | | }
|
| | |
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 52dfc4652741b4d45a851499d0df08b0 |
| | | timeCreated: 1548228630 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| New file |
| | |
| | | using System.Collections.Generic;
|
| | | using UnityEngine;
|
| | | using UnityEngine.UI;
|
| | |
|
| | | namespace Snxxz.UI
|
| | | {
|
| | | public class JadeDynastyDecomposeGetItemWin : Window
|
| | | {
|
| | | [SerializeField] GameObject getItemObj;
|
| | | [SerializeField] RectTransform getItemParent;
|
| | | [SerializeField] Button sureBtn;
|
| | |
|
| | | List<GameObject> GetItemlist = new List<GameObject>();
|
| | | JadeDynastyDecomposeModel decomposeModel { get { return ModelCenter.Instance.GetModel<JadeDynastyDecomposeModel>(); } }
|
| | | ItemTipsModel tipsModel { get { return ModelCenter.Instance.GetModel<ItemTipsModel>(); } }
|
| | |
|
| | | protected override void BindController()
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | protected override void AddListeners()
|
| | | {
|
| | | sureBtn.AddListener(CloseClick);
|
| | | }
|
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | getItemObj.SetActive(false);
|
| | | CreateGetItem();
|
| | | }
|
| | | protected override void OnAfterOpen()
|
| | | {
|
| | | |
| | | }
|
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | DestroyGetItemlist();
|
| | | }
|
| | |
|
| | | protected override void OnAfterClose()
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | private void CreateGetItem()
|
| | | {
|
| | | GetItemlist.Clear();
|
| | | List<JadeDynastyDecomposeModel.DecomposeGetItem> matInfolist = decomposeModel.getDecomposeItems;
|
| | | for (int i = 0; i < matInfolist.Count; i++)
|
| | | {
|
| | | GameObject item = Instantiate(getItemObj);
|
| | | var matInfo= matInfolist[i];
|
| | | item.transform.SetParent(getItemParent);
|
| | | item.transform.localPosition = Vector3.zero;
|
| | | item.transform.localScale = Vector3.one;
|
| | | item.name = StringUtility.Contact("getItem",i);
|
| | | item.gameObject.SetActive(true);
|
| | | CommonItemBaisc itemBasic = item.transform.Find("CommonItemCell").GetComponent<CommonItemBaisc>();
|
| | | ItemCellModel cellModel = new ItemCellModel(matInfo.itemId, false, (ulong)matInfo.itemCount, matInfo.isBind);
|
| | | itemBasic.Init(cellModel);
|
| | | itemBasic.cellBtn.RemoveAllListeners();
|
| | | itemBasic.cellBtn.AddListener(() =>
|
| | | {
|
| | | ItemAttrData attrData = new ItemAttrData(matInfo.itemId, false, (ulong)matInfo.itemCount, -1, matInfo.isBind);
|
| | | tipsModel.SetItemTipsModel(attrData);
|
| | |
|
| | | });
|
| | | itemBasic.gameObject.SetActive(true);
|
| | | GetItemlist.Add(item);
|
| | | }
|
| | | }
|
| | |
|
| | | private void DestroyGetItemlist()
|
| | | {
|
| | | for (int i = 0; i < GetItemlist.Count; i++)
|
| | | {
|
| | | Destroy(GetItemlist[i]);
|
| | | }
|
| | | }
|
| | |
|
| | | }
|
| | | }
|
| New file |
| | |
| | | fileFormatVersion: 2 |
| | | guid: 1f316cc8750556c46ab5cf0d725d0ec3 |
| | | timeCreated: 1548230749 |
| | | licenseType: Pro |
| | | MonoImporter: |
| | | serializedVersion: 2 |
| | | defaultReferences: [] |
| | | executionOrder: 0 |
| | | icon: {instanceID: 0} |
| | | userData: |
| | | assetBundleName: |
| | | assetBundleVariant: |
| | |
| | |
|
| | | public void OnBeforePlayerDataInitialize()
|
| | | {
|
| | | |
| | | playerPack.RefreshItemCountAct -= UpdateItem;
|
| | | }
|
| | |
|
| | | public void OnAfterPlayerDataInitialize()
|
| | |
| | |
|
| | | public void OnPlayerLoginOk()
|
| | | {
|
| | | playerPack.RefreshItemCountAct += UpdateItem;
|
| | | UpdateDecomposeModels();
|
| | | UpdateSelectModels();
|
| | | }
|
| | |
| | | public override void UnInit()
|
| | | {
|
| | |
|
| | | }
|
| | |
|
| | | public List<DecomposeGetItem> getDecomposeItems = new List<DecomposeGetItem>();
|
| | | public void UpdateJadeDynastyDecomposeResult(HA815_tagMCZhuXianDecomposeResult result)
|
| | | {
|
| | | getDecomposeItems.Clear();
|
| | | for (int i = 0; i < result.Cnt; i++)
|
| | | {
|
| | | var itemData = result.ItemList[i];
|
| | | var getItemData = new DecomposeGetItem((int)itemData.ItemID,itemData.ItemCnt,itemData.IsBind);
|
| | | getDecomposeItems.Add(getItemData);
|
| | | }
|
| | |
|
| | | if(getDecomposeItems.Count > 0)
|
| | | {
|
| | | WindowCenter.Instance.Open<JadeDynastyDecomposeGetItemWin>();
|
| | | }
|
| | | }
|
| | |
|
| | | private void UpdateItem(PackType type, int index, int id)
|
| | | {
|
| | | if (type != PackType.rptJadeDynastyItem || !isAutoDecompose) return;
|
| | |
|
| | | UpdateDecomposeModels();
|
| | | UpdateSelectModels();
|
| | | int remainGrid = playerPack.GetReaminGridCount(PackType.rptJadeDynastyItem);
|
| | | if(remainGrid < 1)
|
| | | {
|
| | | SendJadeDynastyDecompose(1);
|
| | | }
|
| | | }
|
| | |
|
| | | private int GetSelectEquipLvByLocalSave()
|
| | |
| | | }
|
| | | }
|
| | |
|
| | | public void SendJadeDynastyDecompose(int isAuto)
|
| | | {
|
| | | List<ushort> indexs = null;
|
| | | List<uint> ids = null;
|
| | | GetSelectItemIndexs(out indexs, out ids);
|
| | | CA332_tagCMZhuXianEquipDecompose zhuXianEquipDecompose = new CA332_tagCMZhuXianEquipDecompose();
|
| | | zhuXianEquipDecompose.Count = (byte)indexs.Count;
|
| | | zhuXianEquipDecompose.IndexList = indexs.ToArray();
|
| | | zhuXianEquipDecompose.ItemIDList = ids.ToArray();
|
| | | zhuXianEquipDecompose.IsAuto = (byte)isAuto;
|
| | | GameNetSystem.Instance.SendInfo(zhuXianEquipDecompose);
|
| | | }
|
| | |
|
| | | private void GetSelectItemIndexs(out List<ushort> indexs, out List<uint> ids)
|
| | | {
|
| | | indexs = new List<ushort>();
|
| | | ids = new List<uint>();
|
| | | foreach(var guid in selectGuids)
|
| | | {
|
| | | var model = playerPack.GetItemModelByGUID(guid);
|
| | | if(model != null)
|
| | | {
|
| | | indexs.Add((ushort)model.itemInfo.ItemPlace);
|
| | | ids.Add((uint)model.itemId);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | public class DecomposeGetItem
|
| | | {
|
| | | public int itemId { get; private set; }
|
| | | public int itemCount { get; private set;}
|
| | | public int isBind { get; private set; }
|
| | | public DecomposeGetItem(int id,int count,int isBind)
|
| | | {
|
| | | this.itemId = id;
|
| | | this.itemCount = count;
|
| | | this.isBind = isBind;
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|
| | |
| | | [SerializeField] Transform sortArrow;
|
| | | [SerializeField] int initCount = 100;
|
| | |
|
| | | PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
|
| | | JadeDynastyDecomposeModel decomposeModel { get { return ModelCenter.Instance.GetModel<JadeDynastyDecomposeModel>(); } }
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | |
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | playerPack.RefreshItemCountAct += UpdateItem;
|
| | | decomposeModel.UpdateSelectItemEvent += UpdateSelectItem;
|
| | | sortTable.onSortCloseEvent += CloseSortTable;
|
| | | sortTable.onSelectSortEvent += UpdateSelectEquipLv;
|
| | |
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | playerPack.RefreshItemCountAct -= UpdateItem;
|
| | | decomposeModel.UpdateSelectItemEvent -= UpdateSelectItem;
|
| | | sortTable.onSortCloseEvent -= CloseSortTable;
|
| | | sortTable.onSelectSortEvent -= UpdateSelectEquipLv;
|
| | |
| | | decomposeCtrl.Restart();
|
| | | }
|
| | |
|
| | | private void UpdateItem(PackType type, int index, int id)
|
| | | {
|
| | | if (type != PackType.rptJadeDynastyItem) return;
|
| | |
|
| | | decomposeModel.UpdateDecomposeModels();
|
| | | decomposeModel.UpdateSelectModels();
|
| | | UpdateSelectItem();
|
| | | }
|
| | |
|
| | | private void UpdateSelectEquipLv(SortType type, int lv)
|
| | | {
|
| | | if (type != SortType.EquipLv) return;
|
| | |
| | |
|
| | | private void ClickDecompose()
|
| | | {
|
| | | |
| | | decomposeModel.SendJadeDynastyDecompose(0);
|
| | | }
|
| | |
|
| | | private void ClickAutoDecompose()
|
| | |
| | | public void SetDisplay()
|
| | | {
|
| | | bool islock = equipModel.IsLockEquipPlace((int)equipType);
|
| | | nameText.text = string.Empty;
|
| | | nameText.text = Language.Get(equipType.ToString());
|
| | | lockText.gameObject.SetActive(false);
|
| | | nameText.gameObject.SetActive(false);
|
| | | lockObj.SetActive(islock);
|
| | |
| | | {
|
| | | public class JadeDynastyEquipWin : Window
|
| | | {
|
| | | [SerializeField] Text fightPowerText;
|
| | | [SerializeField] Button decomposeBtn;
|
| | | [Header("诛仙装备位")]
|
| | | [SerializeField] Button stoneAttrBtn;
|
| | |
| | | [SerializeField] int initCount = 100;
|
| | |
|
| | | PlayerPackModel playerPack { get { return ModelCenter.Instance.GetModel<PlayerPackModel>(); } }
|
| | | RoleParticularModel particularModel { get { return ModelCenter.Instance.GetModel<RoleParticularModel>(); } }
|
| | | #region Built-in
|
| | | protected override void BindController()
|
| | | {
|
| | |
| | |
|
| | | protected override void OnPreOpen()
|
| | | {
|
| | | particularModel.PowerUpdate += UpdateFightPower;
|
| | | playerPack.RefreshItemCountAct += UpdateJadeDynastyItem;
|
| | | SetDisplay();
|
| | | }
|
| | |
| | |
|
| | | protected override void OnPreClose()
|
| | | {
|
| | | particularModel.PowerUpdate -= UpdateFightPower;
|
| | | playerPack.RefreshItemCountAct -= UpdateJadeDynastyItem;
|
| | | UI3DModelExhibition.Instance.StopShow();
|
| | | }
|
| | |
| | | {
|
| | | CreateItemLine();
|
| | | UpdatePlayerUI3DModel();
|
| | | UpdateFightPower();
|
| | | }
|
| | |
|
| | | private void CreateItemLine()
|
| | |
| | | itemCtrl.Restart();
|
| | | }
|
| | |
|
| | | private void UpdateFightPower()
|
| | | {
|
| | | fightPowerText.text = particularModel.GetFuncFightPower((int)FuncPowerType.JadeDynastyEquip).ToString();
|
| | | }
|
| | |
|
| | | private void UpdateJadeDynastyItem(PackType type, int index, int id)
|
| | | {
|
| | | if (type != PackType.rptJadeDynastyItem) return;
|
| | |
| | | {
|
| | | if (!isNext)
|
| | | {
|
| | | titleText.text = StringUtility.Contact("套装总属性");
|
| | | titleText.text = Language.Get("JadeDynastyEquip3");
|
| | | }
|
| | | else
|
| | | {
|
| | | titleText.text = StringUtility.Contact("进阶属性");
|
| | | titleText.text = Language.Get("进阶属性");
|
| | | }
|
| | |
|
| | | List<int> suitTypes = equipModel.suitTypeDict.Keys.ToList();
|
| | |
| | | else
|
| | | {
|
| | | attrTypeObj.SetActive(true);
|
| | | switch (suitType)
|
| | | {
|
| | | case 1:
|
| | | suitTypeText.text = StringUtility.Contact("诛仙守护LV." + suitAttrData.suitLv);
|
| | | break;
|
| | | case 2:
|
| | | suitTypeText.text = StringUtility.Contact("诛仙之力LV." + suitAttrData.suitLv);
|
| | | break;
|
| | | case 3:
|
| | | suitTypeText.text = StringUtility.Contact("诛仙剑阵LV." + suitAttrData.suitLv);
|
| | | break;
|
| | | }
|
| | |
|
| | | string suitName = Language.Get(StringUtility.Contact("JadeDynastyEquipSuit_", suitType));
|
| | | suitTypeText.text = StringUtility.Contact(suitName,"Lv." + suitAttrData.suitLv);
|
| | | }
|
| | | int[] ids = suitAttrData.suitAttrConfig.attrIDList;
|
| | | int[] values = suitAttrData.suitAttrConfig.attrValueList;
|
| | | int equipPlace = equipModel.suitTypeDict[suitType][0];
|
| | | var equipPlaces = equipModel.suitTypeDict[suitType];
|
| | | int equipPlace = equipPlaces[0];
|
| | | List<int> activeEquips = null;
|
| | | bool isActive = equipModel.TryGetIsActiveSuit(equipPlace,suitAttrData.suitLv,out activeEquips);
|
| | | activeObj.SetActive(!isActive);
|
| | | if(!isActive)
|
| | | {
|
| | | string conditionSB = StringUtility.Contact("达到",suitAttrData.suitLv,"阶激活");
|
| | | string equipsName = string.Empty;
|
| | | for(int i = 0; i < equipPlaces.Count; i++)
|
| | | {
|
| | | var place = equipPlaces[i];
|
| | | string equipName = Language.Get(((RoleEquipType)place).ToString());
|
| | | if (activeEquips.Contains(place))
|
| | | {
|
| | | equipName = UIHelper.AppendStringColor(TextColType.Green,equipName);
|
| | | }
|
| | | if (i == 0)
|
| | | {
|
| | | equipsName = equipName;
|
| | | }
|
| | | else
|
| | | {
|
| | | equipsName = StringUtility.Contact(" ", equipName);
|
| | | }
|
| | | }
|
| | | string conditionSB = Language.Get("JadeDynastyEquip1",equipsName,suitAttrData.suitLv);
|
| | | activeText.text = conditionSB;
|
| | | }
|
| | | for (int i = 0; i < attrObjlist.Count; i++)
|
| | |
| | | isCanPut = !islock;
|
| | | if(islock)
|
| | | {
|
| | | MessageWin.Inst.ShowFixedTip("请解锁诛仙塔");
|
| | | int towerlayer = 0;
|
| | | jadeDynastyModel.TryGetLockTowerLayer(config.EquipPlace,out towerlayer);
|
| | | SysNotifyMgr.Instance.ShowTip("JadeDynastyEquip",towerlayer);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | return;
|
| | | }
|
| | |
|
| | | if (sendItemModel != null && sendItemModel.itemInfo.IsBind == 0)
|
| | | {
|
| | | ConfirmCancel.ShowPopConfirm(Language.Get("Mail101"), Language.Get("JadeDynastyEquip5"),(bool isOk)=>
|
| | | {
|
| | | if(isOk)
|
| | | {
|
| | | SendPutOnQuest(equipPlace, itemIndex);
|
| | | }
|
| | | });
|
| | | return;
|
| | | }
|
| | |
|
| | | SendPutOnQuest(equipPlace, itemIndex);
|
| | | }
|
| | |
|
| | |
| | | Fairy = 17,//仙族法宝
|
| | | PetSoul = 18,//灵宠魂石
|
| | | HorseSoul = 19,//坐骑魂石
|
| | | JadeDynastyEquip = 25, //诛仙装备
|
| | | }
|
| | |
|
| | | public enum E_AtkType
|