Exemplo n.º 1
0
    void HandleUpdateItemPosition(NetworkMessage netMsg)
    {
        Message.ItemPositionUpdate update = netMsg.ReadMessage <Message.ItemPositionUpdate>();

        Player_Item item = Data_ListPlayerOnScene.GetItem(update.itemIndex);

        if (item)
        {
            item.SyncPosition(update.vect, update.rotate);
        }
    }
Exemplo n.º 2
0
    void HandlePickUpItem(NetworkMessage netMsg)
    {
        Message.PickUpItem up = netMsg.ReadMessage <Message.PickUpItem>();

        Player_AnimateControl controll = Data_ListPlayerOnScene.GetPlayerControll(up.index);

        if (controll)
        {
            Player_Item item = Data_ListPlayerOnScene.GetItem(up.itemIndex);
            if (item)
            {
                item.TakeWeapon(controll.rightHand, controll);
            }
            if (up.thisPlayer)
            {
                Chat.AmmoMax(up.ammo, up.ammoMax);
            }
        }
    }