public PlayerWeapon(Player pOwner, EWeaponId pId, InHandWeaponInfo pInHandInfo, InHandWeaponVisualInfo pInHandVisualInfo) { Id = pId; Owner = pOwner; AmmoLeft = pInHandInfo.Ammo; MagazinesLeft = pInHandInfo.Magazines; Info = pInHandInfo; VisualInfo = pInHandVisualInfo; RealoadTimeLeft = pInHandInfo.Cooldown; //has to be (re)set for UI reloading }
public void SetActiveWeapon(EWeaponId pId, float pCadency) { if(activeWeapon == pId) return; activeWeapon = pId; activeWeaponCadency = pCadency; //weapon sprite InHandWeaponVisualInfo info = brainiacs.ItemManager.GetWeaponConfig(pId).VisualInfo; weapon.sprite = info.InfoSprite; player.Photon.Send(EPhotonMsg.Player_UI_PlayerInfo_SetActiveWeapon, pId, pCadency); }