| | |
| | | {
|
| | | GA_Hero _hero = PlayerDatas.Instance.hero;
|
| | | DropItemManager.DropObject _obj = null;
|
| | | if (DropItemManager.HandupTryGetHeroItem(out _obj))
|
| | | {
|
| | | bool _needPickupSelf = true;
|
| | | bool _needPickupSelf = true;
|
| | | Vector3 _destPosition = _hero.Pos;
|
| | |
|
| | | if (_needPickupSelf = DropItemManager.HandupTryGetHeroItem(out _obj))
|
| | | {
|
| | | // 有掉落物
|
| | | // 是否是强制守护不能拾取的
|
| | | if (_obj.ownerType != 7)
|
| | |
| | |
|
| | | if (_needPickupSelf)
|
| | | {
|
| | | _hero.StopRush();
|
| | | Vector3 _targetPosition = _obj.dropItem.transform.position;
|
| | | float _chkDistSqrt = MathUtility.DistanceSqrtXZ(_hero.Pos, _targetPosition);
|
| | | if (_chkDistSqrt > 0.5f)
|
| | | {
|
| | | _hero.MoveToPosition(_targetPosition);
|
| | | }
|
| | | return true;
|
| | | _destPosition = _obj.dropItem.transform.position;
|
| | | }
|
| | | }
|
| | |
|
| | | if (!_needPickupSelf)
|
| | | {
|
| | | DropItem _item = null;
|
| | | if (_needPickupSelf = ClientDropItemUtility.Instance.TryGetDropItem(out _item))
|
| | | {
|
| | | if (_needPickupSelf)
|
| | | {
|
| | | _destPosition = _item.transform.position;
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | if (_needPickupSelf)
|
| | | {
|
| | | _hero.StopRush();
|
| | | float _chkDistSqrt = MathUtility.DistanceSqrtXZ(_hero.Pos, _destPosition);
|
| | | if (_chkDistSqrt > 0.5f)
|
| | | {
|
| | | _hero.MoveToPosition(_destPosition);
|
| | | }
|
| | | return true;
|
| | | }
|
| | | return false;
|
| | | }
|
| | |
|