コード例 #1
0
    public static void Send(ItemSlot playerSlot, ItemSlot targetSlot)
    {
        if (!Validation(playerSlot, targetSlot, PlayerManager.LocalPlayerScript, targetSlot.Player.gameObject, NetworkSide.Client))
        {
            return;
        }

        OtherPlayerSlotTransferMessage msg = new OtherPlayerSlotTransferMessage
        {
            PlayerStorage   = playerSlot.ItemStorageNetID,
            PlayerSlotIndex = playerSlot.SlotIdentifier.SlotIndex,
            PlayerNamedSlot = playerSlot.SlotIdentifier.NamedSlot.GetValueOrDefault(NamedSlot.back),
            TargetStorage   = targetSlot.ItemStorageNetID,
            TargetSlotIndex = targetSlot.SlotIdentifier.SlotIndex,
            TargetNamedSlot = targetSlot.SlotIdentifier.NamedSlot.GetValueOrDefault(NamedSlot.back)
        };

        msg.Send();
    }
コード例 #2
0
        private void InteractWithOtherPlayersSlot(ItemSlot targetSlot)
        {
            ItemSlot playerSlot;
            var      isGhost = PlayerManager.LocalPlayerScript.IsGhost;

            if (isGhost)
            {
                if (PlayerList.Instance.IsClientAdmin)
                {
                    playerSlot = AdminManager.Instance.LocalAdminGhostStorage.GetNamedItemSlot(NamedSlot.ghostStorage01);
                }
                else
                {
                    return;
                }
            }
            else
            {
                playerSlot = UIManager.Hands.CurrentSlot.ItemSlot;
            }
            OtherPlayerSlotTransferMessage.Send(playerSlot, targetSlot, isGhost);
        }
コード例 #3
0
    /// <summary>
    /// TODO interactions
    /// </summary>
    private void InteractWithOtherPlayersSlot(ItemSlot targetSlot)
    {
        var playerSlot = UIManager.Hands.CurrentSlot.ItemSlot;

        OtherPlayerSlotTransferMessage.Send(playerSlot, targetSlot);
    }