| | |
| | | public static event Action beforePlayerDataInitializeEvent;
|
| | | public static event Action afterPlayerDataInitializeEvent;
|
| | | public static event Action switchAccountEvent;
|
| | | public static bool isAfterPlayerDataInitialize = false; //可以用来判断是否切号,如短暂的断线重连
|
| | | public static bool isAfterPlayerDataInitialize = false; //可区分断线重连还是完全重登; 切到登录场景会重置为false,故可判断断线重连
|
| | | public static uint playerIdBuf = 0;
|
| | |
|
| | | public override void Done(GameNetPackBasic vNetPack)
|
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //B4 05 获得经验 #tagMCAddExp |
| | | |
| | | public class DTCB405_tagMCAddExp : DtcBasic { |
| | | public override void Done(GameNetPackBasic vNetPack) { |
| | | base.Done(vNetPack); |
| | | HB405_tagMCAddExp vNetData = vNetPack as HB405_tagMCAddExp; |
| | | } |
| | | } |
| | | //B4 05 获得经验 #tagMCAddExp
|
| | |
|
| | | public class DTCB405_tagMCAddExp : DtcBasic {
|
| | | public override void Done(GameNetPackBasic vNetPack) {
|
| | | base.Done(vNetPack);
|
| | | HB405_tagMCAddExp vNetData = vNetPack as HB405_tagMCAddExp;
|
| | | }
|
| | | }
|
| | |
| | | using UnityEngine; |
| | | using System.Collections; |
| | | |
| | | //B4 05 获得经验 #tagMCAddExp |
| | | |
| | | public class HB405_tagMCAddExp : GameNetPackBasic { |
| | | public uint ExpPoint; // 单位亿点 |
| | | public uint Exp; // 单位点 |
| | | public byte Source; //经验获取来源 |
| | | |
| | | public HB405_tagMCAddExp () { |
| | | _cmd = (ushort)0xB405; |
| | | } |
| | | |
| | | public override void ReadFromBytes (byte[] vBytes) { |
| | | TransBytes (out ExpPoint, vBytes, NetDataType.DWORD); |
| | | TransBytes (out Exp, vBytes, NetDataType.DWORD); |
| | | TransBytes (out Source, vBytes, NetDataType.BYTE); |
| | | } |
| | | |
| | | } |
| | | //B4 05 获得经验 #tagMCAddExp
|
| | |
|
| | | public class HB405_tagMCAddExp : GameNetPackBasic {
|
| | | public uint ExpPoint; // 单位亿点
|
| | | public uint Exp; // 单位点
|
| | | public byte Source; //经验获取来源
|
| | |
|
| | | public HB405_tagMCAddExp () {
|
| | | _cmd = (ushort)0xB405;
|
| | | }
|
| | |
|
| | | public override void ReadFromBytes (byte[] vBytes) {
|
| | | TransBytes (out ExpPoint, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out Exp, vBytes, NetDataType.DWORD);
|
| | | TransBytes (out Source, vBytes, NetDataType.BYTE);
|
| | | }
|
| | |
|
| | | }
|
| | |
| | | |
| | | BattleDebug.LogError("HandModeOperationAgent DoNext 2"); |
| | | |
| | | //再检查一次有没装备未处理 |
| | | if (PackManager.Instance.GetSinglePack(PackType.DropItem).GetItems().Count > 0) |
| | | { |
| | | //构建所有物品 |
| | | List<int> dropList = new List<int>(); |
| | | foreach (var item in PackManager.Instance.GetSinglePack(PackType.DropItem).GetItems()) |
| | | { |
| | | dropList.Add(item.gridIndex); |
| | | } |
| | | EquipModel.Instance.NotifyItemDrop(dropList, null); |
| | | return; |
| | | } |
| | | |
| | | // 检查一下锤子的消耗 |
| | | if (!ItemLogicUtility.CheckCurrencyCount(41, PlayerDatas.Instance.baseData.UseHarmerCount, 2)) |
| | | { |
| | |
| | | public int lastShowEquipIndex = -1; //上一次界面显示装备的索引,拾取后物品消失需记录下做表现 |
| | | public Queue<int> waitEquipOP = new Queue<int>(); //等待操作的装备,需要和UI交互确认 不含分解 |
| | | |
| | | public List<int> lastDropIndexs = new List<int>(); //上一次掉落物品索引 |
| | | |
| | | public override void Init() |
| | | { |
| | | DTCA814_tagMCMakeItemAnswer.MakeItemAnswerEvent += OnEquipResult; |
| | |
| | | selectFloorEquip = null; |
| | | waitEquipOP.Clear(); |
| | | lastShowEquipIndex = -1; |
| | | lastDropIndexs.Clear(); |
| | | } |
| | | |
| | | |
| | | public static int GetItemServerEquipPlace(int itemId) |
| | | { |
| | |
| | | |
| | | void OnDropEvent(string guid, BattleDrops drops, Action action) |
| | | { |
| | | if (!string.IsNullOrEmpty(guid)) |
| | | return; |
| | | lastDropIndexs = drops.dropItemPackIndex; |
| | | NotifyItemDrop(drops.dropItemPackIndex, drops.rectTransform); |
| | | action?.Invoke(); |
| | | } |
| | |
| | | uieff.Play();
|
| | | }
|
| | |
|
| | | if (rect == null)
|
| | | {
|
| | | if (startPos == new Vector2(10000, 10000))
|
| | | {
|
| | | //避免多次随机
|
| | | startPos = new Vector2(UnityEngine.Random.Range(-150, 150), UnityEngine.Random.Range(-150, 150));
|
| | | }
|
| | | }
|
| | | else
|
| | | {
|
| | | //startPos的位置进行范围随机
|
| | | startPos = new Vector2(rect.localPosition.x + UnityEngine.Random.Range(-60, 60), rect.localPosition.y + UnityEngine.Random.Range(-60, 60));
|
| | | }
|
| | | |
| | | this.transform.position = rect.position;
|
| | | startPos = new Vector2(transform.localPosition.x + UnityEngine.Random.Range(-30, 30), transform.localPosition.y + UnityEngine.Random.Range(50, 100));
|
| | | if (isAnimate)
|
| | | {
|
| | | isPlaying = true;
|
| | |
| | | [SerializeField] RectTransform floorUI; //掉落道具显示的父类
|
| | | [SerializeField] FloorItemCell floorItemCell; //非装备显示组件
|
| | | [SerializeField] MoneyMoveByPath moneyMoveByPathCell; //掉落物金钱
|
| | | [SerializeField] RectTransform defaultDropRect; //默认掉落位置
|
| | |
|
| | | FloorItemCell[] floorItemCells = new FloorItemCell[20]; //包含非装备的战利品掉落
|
| | | MoneyMoveByPath[] moneyMoveByPathArr = new MoneyMoveByPath[20]; //掉落货币,金钱,经验等
|
| | |
| | | private void OnEnable()
|
| | | {
|
| | | //主界面打开和显隐都要刷新
|
| | | Display();
|
| | | Display(true, EquipModel.Instance.lastDropIndexs);
|
| | | EquipModel.Instance.OnItemDropEvent += NotifyPlayItemDrop;
|
| | | PackManager.Instance.DeleteItemEvent += DeleteDropItem;
|
| | | }
|
| | |
| | | item.SetActive(false);
|
| | | continue;
|
| | | }
|
| | | if (indexList != null && !indexList.Contains(i))
|
| | | if (!indexList.IsNullOrEmpty() && !indexList.Contains(i))
|
| | | {
|
| | | //不干涉其他掉落物品
|
| | | continue;
|
| | | }
|
| | |
|
| | | item.SetActive(true);
|
| | | item.Display(i, isAnimate, rect);
|
| | | item.Display(i, isAnimate, rect == null ? defaultDropRect : rect);
|
| | | }
|
| | | }
|
| | |
|
| | |
| | | public override void Init() |
| | | { |
| | | ParseConfig(); |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent += OnPlayerLoginOk; |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent += BeforePlayerInit; |
| | | BattleManager.Instance.onBattleFieldCreate += OnCreateBattleField; |
| | | EventBroadcast.Instance.AddListener<string, SkillConfig, TeamHero>(EventName.BATTLE_CAST_SKILL, OnSkillCast); |
| | |
| | | |
| | | public override void Release() |
| | | { |
| | | DTC0403_tagPlayerLoginLoadOK.playerLoginOkEvent -= OnPlayerLoginOk; |
| | | BattleManager.Instance.onBattleFieldCreate -= OnCreateBattleField; |
| | | DTC0102_tagCDBPlayer.beforePlayerDataInitializeEvent -= BeforePlayerInit; |
| | | |
| | |
| | | maxCost = autoCostWithBlessLV.Length; |
| | | } |
| | | |
| | | void OnPlayerLoginOk() |
| | | { |
| | | //登录时有装备的处理 |
| | | } |
| | | |
| | | void BeforePlayerInit() |
| | | { |
| | |
| | | |
| | | autoBtn.AddListener(() => |
| | | { |
| | | // //测试拾取所有物品 |
| | | // var items = PackManager.Instance.GetItems(PackType.DropItem); |
| | | // List<int> dropindexs = new List<int>(); |
| | | // for (int i = 0; i < items.Count; i++) |
| | | // { |
| | | // var item = items[i]; |
| | | // if (dropindexs.Count > 5) |
| | | // { |
| | | // EquipModel.Instance.NotifyItemDrop(dropindexs, BattleManager.Instance.storyBattleField.battleRootNode.blueTeamNodeList[Random.Range(0, 5)].GetComponent<RectTransform>()); |
| | | // dropindexs.Clear(); |
| | | // } |
| | | |
| | | // dropindexs.Add(item.gridIndex); |
| | | // } |
| | | // if (dropindexs.Count > 0) |
| | | // { |
| | | // EquipModel.Instance.NotifyItemDrop(dropindexs, BattleManager.Instance.storyBattleField.battleRootNode.blueTeamNodeList[Random.Range(0, 5)].GetComponent<RectTransform>()); |
| | | // dropindexs.Clear(); |
| | | // } |
| | | if (!FuncOpen.Instance.IsFuncOpen(108, true)) |
| | | { |
| | | return; |