示例#1
0
    void Update()
    {
        if (laberintoObjectGrabber.GetGrabbed() && !_haveRigidbody)
        {
            StartCoroutine(nameof(AddRigidbody));
            _haveRigidbody = true;
        }
        else if (!laberintoObjectGrabber.GetGrabbed())
        {
            Destroy(GetComponent <Rigidbody>());
            _haveRigidbody = false;
        }

        if (_open && _rotacion < 90)
        {
            if (!taza.activeSelf)
            {
                taza.SetActive(true);
                taza.transform.parent = null;
            }
            tapa.transform.Rotate(-1, 0, 0);
            _rotacion++;
        }
        else if (_rotacion >= 90)
        {
            Destroy(this.gameObject);
        }
    }
示例#2
0
 private void Update()
 {
     if (_objectGrabber.GetGrabbed() && !camera.enabled)
     {
         camera.enabled = true;
         return;
     }
     else if (!_objectGrabber.GetGrabbed())
     {
         camera.enabled = false;
     }
 }
示例#3
0
 private void Update()
 {
     if (_og.GetGrabbed())
     {
         ObjectInf.SetActive(true);
     }
 }
示例#4
0
    private void Update()
    {
        if (_objectGrabber.GetGrabbed())
        {
            marker.SetActive(false);
            var hand = _objectGrabber.GetHandGrabbing;
            if ((Input.GetButtonDown(_buttDer) && hand.GetComponent <AgarreMano>().GetMano()) || (Input.GetButtonDown(_buttIzq) && !hand.GetComponent <AgarreMano>().GetMano()))
            {
                _active = !_active;
                light.SetActive(_active);
            }
            return;
        }
        marker.SetActive(true);


        if (transform.position != pivote.position)
        {
            transform.position = pivote.position;
            transform.rotation = Quaternion.Euler(90, 0, 0);
            _active            = false;
            light.SetActive(false);
        }
    }