Exemplo n.º 1
0
    public override void OnPickup(Player player)
    {
        base.OnPickup(player);

        if (socket)
        {
            socket.OnUnplugged();
            socket = null;
        }
    }
Exemplo n.º 2
0
    private void OnTriggerExit(Collider other)
    {
        PickupInsert insert = other.gameObject.GetComponentInChildren <PickupInsert>();

        if (insert != null)
        {
            Debug.Log("Remove insert " + insert.name);
            inserts.Remove(insert);
        }
    }
Exemplo n.º 3
0
    public override void Interact()
    {
        base.Interact();
        if (interactable != null)
        {
            PickupInsert insert = interactable.GetComponentInParent <PickupInsert>();
            if (insert.ProngType == prongType && insert.currentPlug == null)
            {
                socket = insert;

                body.isKinematic = true;
                socket.OnPluggedIn(this as Plug);
                LeaveHeld();
                body.isKinematic = true;
            }
        }
    }