Beispiel #1
0
    public static RemoveEncryptionKeyMessage Send(GameObject headsetItem)
    {
        RemoveEncryptionKeyMessage msg = new RemoveEncryptionKeyMessage
        {
            HeadsetItem = headsetItem
        };

        msg.Send();

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

        //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>())
        {
            RemoveEncryptionKeyMessage.Send(otherHandsItem);
        }

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