public static UpdateHeadsetKeyMessage Send(GameObject headsetItem, GameObject encryptionkey = null)
    {
        UpdateHeadsetKeyMessage msg = new UpdateHeadsetKeyMessage
        {
            HeadsetItem   = headsetItem ? headsetItem.GetComponent <NetworkIdentity>().netId : NetworkInstanceId.Invalid,
            EncryptionKey = encryptionkey ? encryptionkey.GetComponent <NetworkIdentity>().netId : NetworkInstanceId.Invalid
        };

        msg.Send();

        return(msg);
    }
Ejemplo n.º 2
0
    public bool Interact(InventoryApply interaction)
    {
        //remove the headset key if this is used on a headset
        if (interaction.HandObject == gameObject &&
            interaction.TargetObject.GetComponent <Headset>() != null)
        {
            UpdateHeadsetKeyMessage.Send(interaction.TargetObject);
            return(true);
        }

        return(false);
    }
Ejemplo n.º 3
0
    public override bool Interact(GameObject originator, Vector3 position, string hand)
    {
        //Only peform EncryptionKey actions on other things when holding the encryptionkey
        if (UIManager.Hands.CurrentSlot.Item != gameObject)
        {
            return(base.Interact(originator, position, hand));
        }

        GameObject otherHandsItem = UIManager.Hands.OtherSlot.Item;

        if (otherHandsItem && otherHandsItem.GetComponent <Headset>())
        {
            UpdateHeadsetKeyMessage.Send(otherHandsItem, gameObject);
        }

        return(base.Interact(originator, position, hand));
    }
Ejemplo n.º 4
0
    public override bool Interact(GameObject originator, Vector3 position, string hand)
    {
        //Only peform screwdriver actions on other things when holding the screwdriver
        if (UIManager.Hands.CurrentSlot.Item != gameObject)
        {
            return(base.Interact(originator, position, hand));
        }

        //TODO detect the actual target of the interact, instead of requiring the headset to be in the other hand
        GameObject otherHandsItem = UIManager.Hands.OtherSlot.Item;

        if (otherHandsItem && otherHandsItem.GetComponent <Headset>())
        {
            //Remove encryption key
            UpdateHeadsetKeyMessage.Send(otherHandsItem);
        }

        return(base.Interact(originator, position, hand));
    }