Beispiel #1
0
    private void CheckForMouseInteractible()
    {
        _ray = Camera.main.ScreenPointToRay(Input.mousePosition);

        if (Input.GetMouseButton(0))
        {
            if (Physics.Raycast(_ray, out _hit, 100.0f))
            {
                if (_hit.transform != null && _hit.collider.gameObject.GetComponent <InteractibleMouse>() != null)
                {
                    InteractibleMouse newInteractible = _hit.collider.gameObject.GetComponent <InteractibleMouse>();
                    SetInteractible(newInteractible);
                }
            }
        }
        else
        {
            _desiredObject = null;
        }
    }
Beispiel #2
0
 private void SetInteractible(InteractibleMouse newInteractible)
 {
     _desiredObject = newInteractible;
 }