Ejemplo n.º 1
0
    private void InteractCheck()
    {
        //Debug.DrawRay(head.position, head.forward * interectRange, Color.green);
        RaycastHit hit;

        Physics.Raycast(head.position, head.forward, out hit, interectRange);
        crosshair.sizeDelta = new Vector2(crosshairNormalSize, crosshairNormalSize);
        if (hit.collider)
        {
            GameObject gameObj = hit.collider.gameObject;
            ITrigger   trigger = gameObj.GetComponent <ITrigger>();
            if (trigger != null)
            {
                crosshair.sizeDelta = new Vector2(crosshairInterectSize, crosshairInterectSize);
                if (m_Interact)
                {
                    trigger.Interact();
                }
            }
        }
    }