UnityEngine.UI.Selectable.IsInteractable C# (CSharp) Method

IsInteractable() public method

public IsInteractable ( ) : bool
return bool
        public virtual bool IsInteractable()
        {
            return (this.m_GroupsAllowInteraction && this.m_Interactable);
        }

Usage Example

        public Selectable FindSelectable(Vector3 dir)
        {
            dir = dir.normalized;
            Vector3    v      = Quaternion.Inverse(base.transform.rotation) * dir;
            Vector3    b      = base.transform.TransformPoint(Selectable.GetPointOnRectEdge(base.transform as RectTransform, v));
            float      num    = float.NegativeInfinity;
            Selectable result = null;

            for (int i = 0; i < Selectable.s_List.Count; i++)
            {
                Selectable selectable = Selectable.s_List[i];
                if (!(selectable == this) && !(selectable == null))
                {
                    if (selectable.IsInteractable() && selectable.navigation.mode != Navigation.Mode.None)
                    {
                        RectTransform rectTransform = selectable.transform as RectTransform;
                        Vector3       position      = (!(rectTransform != null)) ? Vector3.zero : rectTransform.rect.center;
                        Vector3       rhs           = selectable.transform.TransformPoint(position) - b;
                        float         num2          = Vector3.Dot(dir, rhs);
                        if (num2 > 0f)
                        {
                            float num3 = num2 / rhs.sqrMagnitude;
                            if (num3 > num)
                            {
                                num    = num3;
                                result = selectable;
                            }
                        }
                    }
                }
            }
            return(result);
        }
All Usage Examples Of UnityEngine.UI.Selectable::IsInteractable