Esempio n. 1
0
 public void pegarCaixa(Pegavel pegavel)
 {
     this.AoPegar.Invoke();
     this._segurando = pegavel;
     this._segurando.pegar(this.pontoDeApoioCaixa);
     this.SendMessageUpwards("alterarComandoParaSoltarCaixa");
 }
Esempio n. 2
0
    void Update()
    {
        RaycastHit hit;

        if (this._segurando == null)
        {
            if (Physics.Raycast(this.transform.position, this.transform.forward, out hit, this.distanciaMiminaParaPegar, 1 << 8))
            {
                this.SendMessageUpwards("mostrarAtalhoLevantarCaixa");
                if (Input.GetKeyDown(KeyCode.E))
                {
                    Pegavel pegavel = hit.transform.GetComponent <Pegavel> ();
                    if (pegavel != null)
                    {
                        this.pegarCaixa(pegavel);
                    }
                }
            }
            else
            {
                this.SendMessageUpwards("esconderAtalhoLevantarCaixa");
            }
        }
        else
        {
            if (Input.GetKeyDown(KeyCode.E))
            {
                this.soltarCaixa();
            }
        }

        this.transform.rotation = this.controleCamera.rotation;
    }
Esempio n. 3
0
    private void _fixar(Transform cubo)
    {
        Pegavel pegavel = cubo.GetComponent <Pegavel> ();

        if (pegavel.ligada)
        {
            pegavel.SendMessageUpwards("soltarCaixa");
        }


        cubo.transform.parent = this.posicao;
        cubo.localPosition    = Vector3.zero;
        cubo.localRotation    = this.posicao.localRotation;
        cubo.GetComponent <Rigidbody> ().Sleep();
        pegavel.soltar();
        this._ocupante = cubo.gameObject;
    }
Esempio n. 4
0
 public void soltarCaixa()
 {
     this._segurando.soltar();
     this._segurando = null;
     this.SendMessageUpwards("alterarComandoParaPegarCaixa");
 }