/// <summary> /// 自动查找当前可用手雷,no vertify /// </summary> /// <param name="grenadeComp"></param> private void TryStuffEmptyGrenadeSlot(WeaponComponent grenadeComp) { var grenadeBagAgent = _playerEntity.grenadeInventoryHolder.Inventory; int nextId = grenadeBagAgent.PickNextGrenadeInstance(); if (nextId < 1) { return; } WeaponInfo wpInfo; Err_WeaponLogicErrCode errCode = AddWeaponToSlot(EWeaponSlotType.GrenadeWeapon, new WeaponInfo() { Id = nextId }, out wpInfo); if (errCode != Err_WeaponLogicErrCode.Sucess) { throw new System.Exception("Stuff empty grenade slot failed"); } }
private Err_WeaponLogicErrCode TryVarySlotGrenadeObject(System.Action <EWeaponSlotType, int> onSameSpeciesSwitch) { Err_WeaponLogicErrCode ret = IsGreandePull(); if (ret != Err_WeaponLogicErrCode.Sucess) { _playerEntity.tip.TipType = Core.Common.ETipType.CantSwithGrenade; return(ret); } int nextGrenadeId = _cacheAgent.PickNextGrenadeSpecies(); if (nextGrenadeId < 1) { return(Err_WeaponLogicErrCode.Err_GrenadeNotFindNextUsableId); } if (onSameSpeciesSwitch != null) { onSameSpeciesSwitch(EWeaponSlotType.GrenadeWeapon, nextGrenadeId); } return(Err_WeaponLogicErrCode.Sucess); }