lcy
12 小时以前 81a6da4df745f8ed5e4fb45fe54421eda792bf35
Main/System/Equip/EquipModel.cs
@@ -10,6 +10,7 @@
{
    public const int TotleEquip = 12;  //装备栏大小
    public bool waitEquipOPPack = false;    // 穿戴装备的操作 不含分解
    public float waitEquipOPTime = 0;
    public event Action<bool, int> OnEquipOPResultAction;    //是否换上了新装备且分解了 装备索引
    public event Action<BattleDrops> OnItemDropEvent;
@@ -36,6 +37,7 @@
        EventBroadcast.Instance.AddListener<string, BattleDrops, Action>(EventName.BATTLE_DROP_ITEMS, OnDropEvent);
        EventBroadcast.Instance.AddListener<string, SkillConfig, TeamHero>(EventName.BATTLE_CAST_SKILL, OnSkillCast);
        EventBroadcast.Instance.AddListener<string>(EventName.RECORDPLAYER_END, RecordPlayerEnd);
        GlobalTimeEvent.Instance.secondEvent += OnSecondEvent;
        ParseConfig();
    }
@@ -46,6 +48,7 @@
        EventBroadcast.Instance.RemoveListener<string, BattleDrops, Action>(EventName.BATTLE_DROP_ITEMS, OnDropEvent);
        EventBroadcast.Instance.RemoveListener<string, SkillConfig, TeamHero>(EventName.BATTLE_CAST_SKILL, OnSkillCast);
        EventBroadcast.Instance.RemoveListener<string>(EventName.RECORDPLAYER_END, RecordPlayerEnd);
        GlobalTimeEvent.Instance.secondEvent -= OnSecondEvent;
    }
@@ -191,6 +194,16 @@
        }
    }
    void OnSecondEvent()
    {
        if (waitEquipOPPack && Time.time - waitEquipOPTime > 2)
        {
            //避免装备卡死无法继续主线
            waitEquipOPPack = false;
        }
    }
    private void OnEquipResult(HA814_tagMCMakeItemAnswer info)
    {
        if (info.MakeType != (int)MakeType.EquipOP)
@@ -199,7 +212,10 @@
            return;
        if (info.MakeValue == 2)
        {
            waitEquipOPPack = false;
            Debug.LogWarning("穿戴装备,服务器响应解除等待状态");
        }
        bool isDone = false;    // 换上新装备且分解了旧装备
        //选中的地板装备进行处理,替换还是找下一件,检查OnEquipOPResultAction
        if (selectFloorEquip != null)
@@ -259,7 +275,11 @@
        pack.OPValue = (byte)(autoDecompose ? 1 : 0); // 替换后是否自动分解原装备:0否1是
        if (opType == 2)
        {
            waitEquipOPPack = true;
            waitEquipOPTime = Time.time;
            Debug.LogWarning("穿戴装备,向服务器请求");
        }
        GameNetSystem.Instance.SendInfo(pack);
    }
@@ -310,7 +330,10 @@
            return false;
        if (!DTC0403_tagPlayerLoginLoadOK.finishedLogin)
        {
            Debug.LogWarning("OpenEquipExchangeWin: 未登录");
            return false;
        }
        // if (!IsEquip(equip))
        //     return false;
@@ -325,7 +348,10 @@
        waitEquipOP.Enqueue(equip.gridIndex);
        //未回复装备操作结果,否则会显示旧装备
        if (waitEquipOPPack)
        {
            Debug.LogError("OpenEquipExchangeWin: 等待服务器响应");
            return false;
        }
        if (UIManager.Instance.IsOpened<EquipExchangeWin>())
@@ -351,11 +377,17 @@
        // 新手引导中,不允许切换装备界面
        if (NewBieCenter.Instance.inGuiding)
        {
            Debug.LogWarning("GetSelectFloorEquip: 新手引导中,不允许切换装备界面");
            return null;
        }
        string activeBattleName = BattleManager.Instance.GetActiveBattleName();
        if (activeBattleName != "" && activeBattleName != "StoryBattleField")
        {
            Debug.LogWarning("非主线战斗不弹窗");
            return null;
        }
        return PackManager.Instance.GetItemByIndex(PackType.DropItem, waitEquipOP.Dequeue());