Exemplo n.º 1
0
    void Update()
    {
        CameraControls();

        if (Input.GetMouseButtonDown(0))
        {
            RaycastHit hit;

            if (Physics.Raycast(transform.position, transform.forward, out hit, 25f))
            {
                try
                {
                    Glass G = hit.collider.transform.gameObject.GetComponent <Glass>();

                    if (G != null)
                    {
                        G.Break();
                    }
                }
                catch {}
            }
        }
    }