| | |
| | | {
|
| | | List<GActor> _list = GetTypeList(E_ActorClassType.Pet);
|
| | |
|
| | | if (_list == null || _list.Count == 0)
|
| | | {
|
| | | return;
|
| | | }
|
| | |
|
| | | //Debug.LogFormat("共有: {0} 只宠物", _petList.Count);
|
| | | GA_Player _player = null;
|
| | | foreach (var _pet in _list)
|
| | | if (_list != null && _list.Count > 0)
|
| | | {
|
| | | var _parentID = _pet.ActorInfo.ownerSID;
|
| | | if (_parentID == PlayerDatas.Instance.PlayerId)
|
| | | //Debug.LogFormat("共有: {0} 只宠物", _petList.Count);
|
| | | foreach (var _pet in _list)
|
| | | {
|
| | | continue;
|
| | | }
|
| | | var _parentID = _pet.ActorInfo.ownerSID;
|
| | | if (_parentID == PlayerDatas.Instance.PlayerId)
|
| | | {
|
| | | continue;
|
| | | }
|
| | |
|
| | | _player = GetBySID(_parentID) as GA_Player;
|
| | | if (_player == null || !_player.ShowOrHide)
|
| | | {
|
| | | _pet.ShowOrHideModel(false);
|
| | | //Debug.LogFormat("宠物: {0} 的拥有者: {1} 不可见, 这里隐藏.", _pet.ServerInstID, _parentID);
|
| | | continue;
|
| | | }
|
| | | _player = GetBySID(_parentID) as GA_Player;
|
| | | if (_player == null || !_player.ShowOrHide)
|
| | | {
|
| | | _pet.ShowOrHideModel(false);
|
| | | //Debug.LogFormat("宠物: {0} 的拥有者: {1} 不可见, 这里隐藏.", _pet.ServerInstID, _parentID);
|
| | | continue;
|
| | | }
|
| | |
|
| | | var _index = BattleEffectPlayRule.Instance.GetIndex(_parentID);
|
| | | if (_index != -1 && _index < BattleEffectPlayRule.Instance.petLimit)
|
| | | {
|
| | | _pet.ShowOrHideModel(true);
|
| | | //Debug.LogFormat("宠物: {0} 的拥有者: {1} 在列表中且位于: {2}, 小于限制数量: {3}", _pet.ServerInstID, _parentID, _index, BattleEffectPlayRule.Instance.petLimit);
|
| | | }
|
| | | else
|
| | | {
|
| | | _pet.ShowOrHideModel(false);
|
| | | //Debug.LogFormat("宠物: {0} 的拥有者: {1} 在列表中且位于: {2}, 大于限制数量: {3}", _pet.ServerInstID, _parentID, _index, BattleEffectPlayRule.Instance.petLimit);
|
| | | var _index = BattleEffectPlayRule.Instance.GetIndex(_parentID);
|
| | | if (_index != -1 && _index < BattleEffectPlayRule.Instance.petLimit)
|
| | | {
|
| | | _pet.ShowOrHideModel(true);
|
| | | //Debug.LogFormat("宠物: {0} 的拥有者: {1} 在列表中且位于: {2}, 小于限制数量: {3}", _pet.ServerInstID, _parentID, _index, BattleEffectPlayRule.Instance.petLimit);
|
| | | }
|
| | | else
|
| | | {
|
| | | _pet.ShowOrHideModel(false);
|
| | | //Debug.LogFormat("宠物: {0} 的拥有者: {1} 在列表中且位于: {2}, 大于限制数量: {3}", _pet.ServerInstID, _parentID, _index, BattleEffectPlayRule.Instance.petLimit);
|
| | | }
|
| | | }
|
| | | }
|
| | |
|
| | | _list = GetTypeList(E_ActorClassType.Player);
|
| | |
|
| | | //Debug.LogFormat("共有: {0} 只守护", _list.Count);
|
| | | foreach (var _chkPlayer in _list)
|
| | | if (_list != null && _list.Count > 0)
|
| | | {
|
| | | _player = _chkPlayer as GA_Player;
|
| | | if (_chkPlayer == null || !_chkPlayer.ShowOrHide)
|
| | | //Debug.LogFormat("共有: {0} 只守护", _list.Count);
|
| | | foreach (var _chkPlayer in _list)
|
| | | {
|
| | | _player.SwitchGuard(0);
|
| | | //Debug.LogFormat("_list: {0} 的拥有者: {1} 不可见, 这里隐藏.", _chkPlayer.ServerInstID, _player.ServerInstID);
|
| | | continue;
|
| | | }
|
| | | _player = _chkPlayer as GA_Player;
|
| | | if (_chkPlayer == null || !_chkPlayer.ShowOrHide)
|
| | | {
|
| | | _player.SwitchGuard(0);
|
| | | //Debug.LogFormat("_list: {0} 的拥有者: {1} 不可见, 这里隐藏.", _chkPlayer.ServerInstID, _player.ServerInstID);
|
| | | continue;
|
| | | }
|
| | |
|
| | | var _index = BattleEffectPlayRule.Instance.GetIndex(_player.ServerInstID);
|
| | | if (_index != -1 && _index < BattleEffectPlayRule.Instance.petLimit)
|
| | | {
|
| | | _player.SwitchGuard((uint)_player.serverGuardId);
|
| | | //Debug.LogFormat("_list: {0} 的拥有者: {1} 在列表中且位于: {2}, 小于限制数量: {3}", _chkPlayer.ServerInstID, _player.ServerInstID, _index, BattleEffectPlayRule.Instance.petLimit);
|
| | | }
|
| | | else
|
| | | {
|
| | | _player.SwitchGuard(0);
|
| | | //Debug.LogFormat("_list: {0} 的拥有者: {1} 在列表中且位于: {2}, 大于限制数量: {3}", _chkPlayer.ServerInstID, _player.ServerInstID, _index, BattleEffectPlayRule.Instance.petLimit);
|
| | | var _index = BattleEffectPlayRule.Instance.GetIndex(_player.ServerInstID);
|
| | | if (_index != -1 && _index < BattleEffectPlayRule.Instance.petLimit)
|
| | | {
|
| | | _player.SwitchGuard((uint)_player.serverGuardId);
|
| | | //Debug.LogFormat("_list: {0} 的拥有者: {1} 在列表中且位于: {2}, 小于限制数量: {3}", _chkPlayer.ServerInstID, _player.ServerInstID, _index, BattleEffectPlayRule.Instance.petLimit);
|
| | | }
|
| | | else
|
| | | {
|
| | | _player.SwitchGuard(0);
|
| | | //Debug.LogFormat("_list: {0} 的拥有者: {1} 在列表中且位于: {2}, 大于限制数量: {3}", _chkPlayer.ServerInstID, _player.ServerInstID, _index, BattleEffectPlayRule.Instance.petLimit);
|
| | | }
|
| | | }
|
| | | }
|
| | | }
|