Exemplo n.º 1
0
            private void UpdateUiRayCast()
            {
                if (!_isReady || !InputHelper.IsUIInteractionMode(true) || LoadManager.IsBusy())
                {
                    return;
                }

                if (Physics.Raycast(Laser.position, Laser.forward, out var hit, _menuLineLength, LayerMask.GetMask("UI")))
                {
                    SetLineLength(hit.distance);
                    if (hit.transform == _prevRayHit && !IsSelectNewlyPressed())
                    {
                        return;
                    }
                    _prevRayHit = hit.transform;

                    var selectable = hit.transform.GetComponent <Selectable>();
                    if (selectable != null)
                    {
                        HandleSelectableRayHit(selectable);
                        return;
                    }
                    var dialogueOption = hit.transform.GetComponent <DialogueOptionUI>();
                    if (dialogueOption != null)
                    {
                        HandleDialogueOptionHit(dialogueOption);
                        return;
                    }
                }
Exemplo n.º 2
0
            private void UpdateUiRayCast()
            {
                if (!_isReady || !InputHelper.IsUIInteractionMode(true) || LoadManager.IsBusy())
                {
                    return;
                }

                if (Physics.Raycast(Laser.position, Laser.forward, out var hit, _menuLineLength, LayerMask.GetMask("UI")))
                {
                    SetLineLength(hit.distance);
                    if (hit.transform == _prevRayHit && !IsSelectNewlyPressed())
                    {
                        return;
                    }
                    _prevRayHit = hit.transform;

                    if (HandleTransformHit(hit.transform))
                    {
                        return;
                    }
                }