Raycaster.Update C# (CSharp) Method

Update() public method

public Update ( ) : void
return void
    void Update()
    {
        doRay();
    }

Usage Example

    void Update()
    {
        if (Camera.main == null)
        {
            return;
        }

        Vector2 mousePosition = Camera.main.ScreenToWorldPoint(Input.mousePosition);
        bool    valid         = (EventSystem.current != null && !EventSystem.current.IsPointerOverGameObject());

        for (int layerIndex = 0; layerIndex < m_Raycasters.Length; ++layerIndex)
        {
            Raycaster raycaster = m_Raycasters[layerIndex];
            raycaster.Update(mousePosition, valid);
        }
    }
All Usage Examples Of Raycaster::Update