Пример #1
0
    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
    }
Пример #2
0
    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);
    }