Пример #1
0
    public void Activate()
    {
        RaycastHit hit;

        //if (state == transformations.GIGANT) {
        if (actions == Comport.CARGANDO)
        {
            bxSript.Soltar();
            actions = Comport.IDDLE;
        }

        Debug.DrawRay(transform.position, transform.TransformDirection(Vector3.forward) * 10, Color.yellow);
        if (Physics.Raycast(transform.position, transform.TransformDirection(Vector3.forward), out hit, 10))
        {
            if (hit.transform.gameObject.layer == 10)
            {
                bxSript = hit.transform.GetComponent <BoxScript>();
                bxSript.Agarre();
                Debug.DrawRay(transform.position, transform.TransformDirection(Vector3.forward) * 10, Color.red);
                Debug.Log("Did Hit");
                actions = Comport.CARGANDO;
            }
        }


        //}
    }