少年修仙传客户端代码仓库
lcy
2024-12-16 a39c35fc6449430cd02bccb681c4a0a880e46cd9
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
using UnityEngine;
using System.Collections.Generic;
 
using System;
using vnxbqy.UI;
using LitJson;
using System.Collections;
 
public class DropItemManager
{
    public class DropObject
    {
        public DropItem dropItem;
        public int dropID;
        public int itemID;
        public int ownerType;
        public uint ownerID;
        public float remainTime;
        public JsonData userData;
    }
 
    public static UnityEngine.Events.UnityAction<int> pickUpCallBack;
    public static event Action<List<Vector3>> guardPickupCallBack;
 
    private static Dictionary<int, DropObject> m_MapItemDict = new Dictionary<int, DropObject>();
    private static List<int> m_MapItemIdList = new List<int>();
    private static Dictionary<int, int> instanceIdToItemId = new Dictionary<int, int>();
    private static Dictionary<int, Vector3> intstanceIdToPosition = new Dictionary<int, Vector3>();
    public static bool StopMissionPickup = false;
    private static Dictionary<int, UIEffect> dropEffectDict = new Dictionary<int, UIEffect>();
 
    static PackModel _playerPack;
    static PackModel playerPack
    {
        get { return _playerPack ?? (_playerPack = ModelCenter.Instance.GetModel<PackModel>()); }
    }
 
    static GuardModel guardModel { get { return ModelCenter.Instance.GetModel<GuardModel>(); } }
 
    public static void Request(H0701_tagItemDrop h0701)
    {
#if UNITY_EDITOR
        string _content = string.Format("DropItemManager => 掉落物Id: dropID => {0}", h0701.DropID);
        RuntimeLogUtility.AddLog_Blue(_content, PlayerDatas.Instance.PlayerId);
#endif
        if (m_MapItemDict.ContainsKey(h0701.DropID))
        {
            Debug.LogErrorFormat("掉落物Id: {0} 已经存在与列表中, 是否出现bug?", h0701.DropID);
            return;
        }
 
        JsonData _userData = JsonMapper.ToObject(h0701.UserData);
 
        if (DungeonStage.CurrentMapType != MapType.OpenCountry
         && (_userData as IDictionary).Contains("4")
         && CrossServerUtility.IsCrossServer())
        {
            string _info = StringUtility.Contact(h0701.DropID, "|",
                                                 h0701.ItemTypeID, "|",
                                                 h0701.OwnerType, "|",
                                                 h0701.OwnerID);
#if UNITY_EDITOR
            Debug.Log(_info);
#endif
        }
 
        if (((System.Collections.IDictionary)_userData).Contains("5"))
        {
            if ((int)_userData["5"] == 1)
            {
                if (h0701.OwnerType == 1)
                {
                    if (h0701.OwnerID != PlayerDatas.Instance.PlayerId)
                    {
                        return;
                    }
                }
                else if (h0701.OwnerType == 2)
                {
                    TeamModel _teamModel = ModelCenter.Instance.GetModel<TeamModel>();
                    if (_teamModel.myTeam.teamId != h0701.OwnerID)
                    {
                        return;
                    }
                }
                else if (h0701.OwnerType == 5)
                {
                    if (PlayerDatas.Instance.baseData.faction != h0701.OwnerID)
                    {
                        return;
                    }
                }
                else if (h0701.OwnerType == 6)
                {
                    bool _result = false;
                    JsonData _owners = _userData["3"];
                    for (int i = 0; i < _owners.Count; ++i)
                    {
                        if ((int)_owners[i] == PlayerDatas.Instance.PlayerId)
                        {
                            _result = true;
                        }
                    }
 
                    if (!_result)
                    {
                        return;
                    }
                }
            }
        }
 
        Vector3 _dropPosition = new Vector3((h0701.PosX - GA_Hero.MapOffset.x) * .5f, 0, (h0701.PosY - GA_Hero.MapOffset.z) * .5f);
        RaycastHit _hitInfo;
        if (Physics.Raycast(_dropPosition + new Vector3(0, 30, 0), Vector3.down, out _hitInfo, 100, LayerUtility.WalkbleMask))
        {
            _dropPosition = _hitInfo.point;
        }
 
        DropItem _item = DropItem.Drop((int)h0701.ItemTypeID, _dropPosition, CameraController.Instance.CameraObject);
        DropObject _dropObject = new DropObject
        {
            dropItem = _item,
            ownerID = h0701.OwnerID,
            dropID = h0701.DropID,
            itemID = (int)h0701.ItemTypeID,
            ownerType = h0701.OwnerType,
            remainTime = h0701.RemainTime * Constants.F_GAMMA
        };
 
        if (DungeonStage.CurrentMapType != MapType.OpenCountry
         && (_userData as IDictionary).Contains("4")
         && CrossServerUtility.IsCrossServer())
        {
            string _info = StringUtility.Contact(h0701.DropID, "|",
                                                 h0701.ItemTypeID, "|",
                                                 h0701.OwnerType, "|",
                                                 h0701.OwnerID, "|",
                                                 _dropPosition);
#if UNITY_EDITOR
            Debug.Log(_info);
#endif
        }
 
        if (h0701.UserDataLen > 2)
        {
            _dropObject.userData = _userData;
        }
 
        m_MapItemDict.Add(h0701.DropID, _dropObject);
        m_MapItemIdList.Add(h0701.DropID);
        instanceIdToItemId[h0701.DropID] = (int)h0701.ItemTypeID;
        intstanceIdToPosition[h0701.DropID] = _dropPosition;
    }
 
    public static bool HandupTryGetHeroItem(out DropObject dropObject)
    {
        try
        {
            dropObject = null;
            int _dropID;
            int _itemID;
 
            GA_Hero _hero = PlayerDatas.Instance.hero;
 
            m_MapItemIdList.Sort((i1, i2) =>
            {
                float _checkDist1 = 10000;
                if (m_MapItemDict.ContainsKey(i1))
                {
                    _checkDist1 = MathUtility.DistanceSqrtXZ(_hero.Pos, m_MapItemDict[i1].dropItem.transform.position);
                }
 
                float _checkDist2 = 10000;
                if (m_MapItemDict.ContainsKey(i2))
                {
                    _checkDist2 = MathUtility.DistanceSqrtXZ(_hero.Pos, m_MapItemDict[i2].dropItem.transform.position);
                }
 
                if (_checkDist1 < _checkDist2)
                {
                    return 1;
                }
                else if (_checkDist1 > _checkDist2)
                {
                    return -1;
                }
 
                return 0;
            });
 
            for (int i = m_MapItemIdList.Count - 1; i >= 0; --i)
            {
                _dropID = m_MapItemIdList[i];
 
                if (m_MapItemDict.ContainsKey(_dropID))
                {
                    if (CheckCanPickUp(m_MapItemDict[_dropID], false))
                    {
                        _itemID = (int)m_MapItemDict[_dropID].itemID;
 
                        if (SettingEffectMgr.Instance.GetSettingEffect())
                        {
                            if (CheckCanPickUp(m_MapItemDict[_dropID], false))
                            {
                                dropObject = m_MapItemDict[_dropID];
                                return true;
                            }
                        }
                        else
                        {
                            dropObject = m_MapItemDict[_dropID];
                            return true;
                        }
                    }
                }
            }
 
            return false;
        }
        catch (Exception ex)
        {
            DebugEx.Log(ex);
            dropObject = null;
            return false;
        }
 
    }
 
    private static float s_ChkPickupInterval;
 
    public static void Update()
    {
        if (Time.time - s_ChkPickupInterval > .5f)
        {
            GA_Hero _hero = PlayerDatas.Instance.hero;
            if (_hero != null)
            {
                CheckPickupItem(_hero.Pos);
                s_ChkPickupInterval = Time.time;
            }
        }
 
        int _dropID;
 
        for (int i = m_MapItemIdList.Count - 1; i >= 0; --i)
        {
            _dropID = m_MapItemIdList[i];
 
            if (m_MapItemDict.ContainsKey(_dropID))
            {
                if (m_MapItemDict[_dropID].remainTime > 0)
                {
                    m_MapItemDict[_dropID].remainTime -= Time.deltaTime;
                    if (m_MapItemDict[_dropID].remainTime < 0)
                    {
                        m_MapItemDict[_dropID].remainTime = 0;
                    }
                }
            }
        }
    }
 
    public static bool TryGetItemIdFromInstanceId(int _instanceId, out int _itemId)
    {
        return instanceIdToItemId.TryGetValue(_instanceId, out _itemId);
    }
 
    public static bool TryGetDropPositionFromInstanceId(int _instanceId, out Vector3 _position)
    {
        return intstanceIdToPosition.TryGetValue(_instanceId, out _position);
    }
 
    public static void ReleaseClientID(int dropID)
    {
        if (m_MapItemIdList.Contains(dropID))
        {
            m_MapItemIdList.Remove(dropID);
        }
    }
 
    public static void Release(int dropId)
    {
#if UNITY_EDITOR
        string _content = string.Format("DropItemManager => 清理掉落物Id: dropID => {0}", dropId);
        RuntimeLogUtility.AddLog_Blue(_content, PlayerDatas.Instance.PlayerId);
#endif
 
        if (m_MapItemDict.ContainsKey(dropId))
        {
            if (m_MapItemDict[dropId].dropItem)
            {
#if UNITY_EDITOR
                _content = string.Format("DropItemManager => |-- 正确执行了清理", dropId);
                RuntimeLogUtility.AddLog_Red(_content, PlayerDatas.Instance.PlayerId);
#endif
                DropItem.Reycle(m_MapItemDict[dropId].dropItem);
            }
            else
            {
#if UNITY_EDITOR
                _content = string.Format("DropItemManager => |-- 清理时对象不存在", dropId);
                RuntimeLogUtility.AddLog_Red(_content, PlayerDatas.Instance.PlayerId);
#endif
            }
            m_MapItemDict.Remove(dropId);
            instanceIdToItemId.Remove(dropId);
            intstanceIdToPosition.Remove(dropId);
        }
        else
        {
#if UNITY_EDITOR
            _content = string.Format("DropItemManager => |-- 掉落无不存在: dropID => {0}", dropId);
            RuntimeLogUtility.AddLog_Red(_content, PlayerDatas.Instance.PlayerId);
#endif
        }
 
        if (m_CacheTipErrorDict.ContainsKey(dropId))
        {
            m_CacheTipErrorDict.Remove(dropId);
        }
 
        ReleaseClientID(dropId);
    }
 
    public static void ReleaseAll()
    {
        for (int i = m_MapItemIdList.Count - 1; i >= 0; --i)
        {
            Release(m_MapItemIdList[i]);
        }
        m_CacheTipErrorDict.Clear();
    }
 
    public static void CheckPickupItem(Vector3 checkPosition)
    {
        // 挂机状态下
        if (SettingEffectMgr.Instance.GetSettingEffect() && !UserInputHandler.isTouched)
        {
            // 不自动拾取则直接返回
            if (HangUpSetModel.Instance.GetBool(HangUpAutoBoolType.isAutoDrop) == false)
            {
                return;
            }
        }
 
        DropObject _item = null;
 
        for (int i = m_MapItemIdList.Count - 1; i >= 0; --i)
        {
            if (m_MapItemDict.ContainsKey(m_MapItemIdList[i]) == false)
            {
                continue;
            }
 
            if (!CheckCanPickUp(m_MapItemDict[m_MapItemIdList[i]], false) && !UserInputHandler.isTouched)
            {
                continue;
            }
 
            _item = m_MapItemDict[m_MapItemIdList[i]];
 
            Vector3 _disVec = _item.dropItem.transform.position - checkPosition;
            _disVec.y = 0;
            float _chkDis = Vector3.SqrMagnitude(_disVec);
 
            if (_chkDis < 1f)
            {
                C0701_tagPickUpItem _proto = new C0701_tagPickUpItem();
                _proto.MapItemID = (uint)m_MapItemIdList[i];
 
                if (CrossServerUtility.IsCrossServer())
                {
                    GameNetSystem.Instance.SendToCrossServer(_proto);
                }
                else
                {
                    GameNetSystem.Instance.SendInfo(_proto);
                }
 
                //Debug.LogFormat("发送捡起物品: {0}的包", m_MapItemIdList[i]);
                //ReleaseClientID(m_MapItemIdList[i]);
            }
 
        }
 
    }
 
    private static Dictionary<int, float> m_CacheTipErrorDict = new Dictionary<int, float>();
    private static void TipOthersItem(int id, bool isNotify)
    {
        if (m_CacheTipErrorDict.ContainsKey(id))
        {
            if (Time.realtimeSinceStartup - m_CacheTipErrorDict[id] > 1)
            {
                m_CacheTipErrorDict[id] = Time.realtimeSinceStartup;
            }
            else
            {
                return;
            }
        }
        if (isNotify)
        {
            SysNotifyMgr.Instance.ShowTip("OpenHazyRegionError_5");
        }
    }
 
    private static bool CheckCanPickUp(DropObject dropObject, bool isNotify=true)
    {
        if (dropObject.ownerType == 1)
        {
            if (dropObject.ownerID != PlayerDatas.Instance.PlayerId)
            {
                TipOthersItem(dropObject.dropID, isNotify);
                return false;
            }
        }
        else if (dropObject.ownerType == 2)
        {
            TeamModel _teamModel = ModelCenter.Instance.GetModel<TeamModel>();
            if (_teamModel.myTeam.teamId != dropObject.ownerID)
            {
                TipOthersItem(dropObject.dropID, isNotify);
                return false;
            }
        }
        else if (dropObject.ownerType == 5)
        {
            if (PlayerDatas.Instance.baseData.faction != dropObject.ownerID)
            {
                TipOthersItem(dropObject.dropID, isNotify);
                return false;
            }
        }
        else if (dropObject.ownerType == 6)
        {
            bool _result = false;
            JsonData _owners = dropObject.userData["3"];
            for (int i = 0; i < _owners.Count; ++i)
            {
                if ((int)_owners[i] == PlayerDatas.Instance.PlayerId)
                {
                    _result = true;
                }
            }
 
            if (!_result)
            {
                TipOthersItem(dropObject.dropID, isNotify);
                return false;
            }
        }
        else if (dropObject.ownerType == 7)
        {
            if (dropObject.ownerID != PlayerDatas.Instance.baseData.FamilyId)
            {
                TipOthersItem(dropObject.dropID, isNotify);
                return false;
            }
        }
 
        ItemConfig _itemModel = ItemConfig.Get(dropObject.itemID);
 
        // 背包已满,且不是铜钱不拾取
        if (playerPack.GetEmptyGridCount(PackType.Item) == 0
            && _itemModel.Type != (int)ItemType.DropCopper
            && _itemModel.Type != (int)ItemType.Copper)
        {
            return false;
        }
 
        // 判断是否处于挂机状态, 不是的话不判断设置信息
        if (PlayerDatas.Instance.hero != null)
        {
            if (PlayerDatas.Instance.hero.aiHandler.IsAuto()
            && !HangUpSetModel.Instance.GetBool(HangUpAutoBoolType.isAutoDrop))
            {
                return false;
            }
 
            // 对装备是否拾取的判断
            if (PlayerDatas.Instance.IsEquip((ItemType)_itemModel.Type))
            {
                //Debug.LogFormat("检测装备: {0} 是否可以拾取, 颜色: {1}", _itemModel.ID, (E_ItemColor)_itemModel.ItemColor);
                // 是否配置了白色,蓝色装备不捡
                if (HangUpSetModel.Instance.GetBool(HangUpAutoBoolType.whiteEquip)
                    && (_itemModel.ItemColor == (int)E_ItemColor.White
                     || _itemModel.ItemColor == (int)E_ItemColor.Blue))
                {
                    //Debug.Log(" |-- 配置了白色/蓝色不拾取, 这个是白色/蓝色的, 不拾取");
                    return true;
                }
 
                // 是否配置了紫色装备不捡
                if (HangUpSetModel.Instance.GetBool(HangUpAutoBoolType.purpleEquip)
                    && _itemModel.ItemColor >= (int)E_ItemColor.Purple)
                {
                    //Debug.Log(" |-- 配置了紫色以上不拾取, 这个是紫色以上的, 不拾取");
                    return true;
                }
            }
            // 项链或者仙器
            else if (
               ((ItemType)_itemModel.Type == ItemType.Equip_FairyCan1
                || (ItemType)_itemModel.Type == ItemType.Equip_FairyCan2
                || (ItemType)_itemModel.Type == ItemType.Equip_Jade
                || (ItemType)_itemModel.Type == ItemType.Equip_Neck)
                && HangUpSetModel.Instance.GetBool(HangUpAutoBoolType.necklaces))
            {
                //Debug.Log(" |-- 配置了项链或者仙器不拾取, 这个是项链或者仙器, 不拾取");
                return true;
            }
            // 宝石
            else if ((ItemType)_itemModel.Type == ItemType.Gemstone
                  && HangUpSetModel.Instance.GetBool(HangUpAutoBoolType.gem))
            {
                //Debug.Log(" |-- 配置了项链或者仙器不拾取, 这个是项链或者仙器, 不拾取");
                return true;
            }
            // 药品(改贵重物品)
            else if (Array.IndexOf(GeneralDefine.ImportantItemType, _itemModel.Type) >= 0
                  && Array.IndexOf(GeneralDefine.ImportantItemID, _itemModel.ID) >= 0
                  && HangUpSetModel.Instance.GetBool(HangUpAutoBoolType.drug))
            {
                return true;
            }
            // 金币
            else if ((ItemType)_itemModel.Type == ItemType.DropCopper
                  && HangUpSetModel.Instance.GetBool(HangUpAutoBoolType.coins))
            {
                return true;
            }
            else if (((ItemType)_itemModel.Type == ItemType.Equip_Neck
                   || (ItemType)_itemModel.Type == ItemType.Equip_FairyCan1
                   || (ItemType)_itemModel.Type == ItemType.Equip_FairyCan2
                   || (ItemType)_itemModel.Type == ItemType.Equip_Jade)
                 && HangUpSetModel.Instance.GetBool(HangUpAutoBoolType.necklaces))
            {
                return true;
            }
            // 其他
            else
            {
                if ((ItemType)_itemModel.Type != ItemType.DropCopper
                 && (ItemType)_itemModel.Type != ItemType.Drugs
                 && (ItemType)_itemModel.Type != ItemType.Gemstone
                 && !PlayerDatas.Instance.IsEquip((ItemType)_itemModel.Type)
                 // 以上类型都不是且开启了其他拾取的时候
                 && HangUpSetModel.Instance.GetBool(HangUpAutoBoolType.other))
                {
                    return true;
                }
            }
        }
 
        return false;
    }
 
    #region 守护拾取
    public static bool TryGetGuardPickUpItem(Vector3 position, ref List<int> dropRefItemList)
    {
        for (int i = 0; i < m_MapItemIdList.Count; i++)
        {
            if (CheckCanGuardPickUp(position, guardModel.pickUpViewRange, i))
            {
                dropRefItemList.Add(m_MapItemIdList[i]);
            }
        }
        return dropRefItemList.Count > 0;
    }
 
    public static bool CheckCanGuardPickUp(Vector3 position)
    {
        for (int i = 0; i < m_MapItemIdList.Count; i++)
        {
            if (CheckCanGuardPickUp(position, guardModel.pickUpViewRange, i))
            {
                return true;
            }
        }
        return false;
    }
 
    public static void CheckGuardPickUpItem(Vector3 position)
    {
        guardSendPickList.Clear();
        for (int i = 0; i < m_MapItemIdList.Count; i++)
        {
            if (guardSendedItemDict.ContainsKey(m_MapItemIdList[i]))
            {
                var guardDropItem = guardSendedItemDict[m_MapItemIdList[i]];
                var t = DateTime.Now - guardDropItem.sendTime;
                if (t.TotalSeconds > 3)
                {
                    guardSendedItemDict.Remove(m_MapItemIdList[i]);
                }
                else
                {
                    continue;
                }
            }
 
            if (CheckCanGuardPickUp(position, guardModel.pickUpAreaRange, i))
            {
                guardSendPickList.Add((ushort)m_MapItemIdList[i]);
                Vector3 _pos = Vector3.zero;
                if (TryGetDropPositionFromInstanceId(m_MapItemIdList[i], out _pos))
                {
                    GuardDropItem guardDropItem = new GuardDropItem();
                    guardDropItem.dropItemPos = _pos;
                    guardDropItem.sendTime = DateTime.Now;
                    guardSendedItemDict.Add(m_MapItemIdList[i], guardDropItem);
                }
            }
        }
        if (guardSendPickList.Count > 0)
        {
            CA312_tagCMGuardPickupItem _proto = new CA312_tagCMGuardPickupItem();
            _proto.MapItemID = guardSendPickList.ToArray();
            _proto.ItemCount = (ushort)_proto.MapItemID.Length;
 
            if (CrossServerUtility.IsCrossServer())
            {
                GameNetSystem.Instance.SendToCrossServer(_proto);
            }
            else
            {
                GameNetSystem.Instance.SendInfo(_proto);
            }
        }
    }
 
    private static Dictionary<int, GuardDropItem> guardSendedItemDict = new Dictionary<int, GuardDropItem>();
    private static List<ushort> guardSendPickList = new List<ushort>();
    private static List<Vector3> guardDropItemPosList = new List<Vector3>();
 
    public struct GuardDropItem
    {
        public DateTime sendTime;
        public Vector3 dropItemPos;
    }
 
    public static void GuardPickupItemSucc(ushort[] mapItemID)
    {
        guardDropItemPosList.Clear();
        for (int i = 0; i < mapItemID.Length; i++)
        {
            if (guardSendedItemDict.ContainsKey(mapItemID[i]))
            {
                guardDropItemPosList.Add(guardSendedItemDict[mapItemID[i]].dropItemPos);
                guardSendedItemDict.Remove(mapItemID[i]);
            }
        }
        if (guardDropItemPosList.Count > 0)
        {
            guardPickupCallBack(guardDropItemPosList);
        }
    }
 
    private static bool CheckCanGuardPickUp(Vector3 position, float _pickRange, int _itemIndex)
    {
        DropObject _item = null;
        if (m_MapItemDict.ContainsKey(m_MapItemIdList[_itemIndex]) == false)
        {
            return false;
        }
        _item = m_MapItemDict[m_MapItemIdList[_itemIndex]];
        if (_item != null && _item.ownerType == 7)//守护过滤归属为仙盟的类型
        {
            return false;
        }
        Vector3 _disVec = _item.dropItem.transform.position - position;
        _disVec.y = 0;
        float _chkDis = Vector3.SqrMagnitude(_disVec);
        if (_chkDis > _pickRange)
        {
            return false;
        }
 
        // 如果是仙盟归属的, 设定为守护不拾取
        if (_item.ownerType == 7)
        {
            return false;
        }
 
        return CheckCanPickUp(_item, false);
    }
    #endregion
 
}