コード例 #1
0
        void ColumnGUI(Rect cellRect, Item item, int column, ref RowGUIArgs args)
        {
            CenterRectUsingSingleLineHeight(ref cellRect);

            if (column == (int)ColumnId.Name)
            {
                args.rowRect = cellRect;
                base.RowGUI(args);
            }

            if (item.interactor != null)
            {
                switch (column)
                {
                case (int)ColumnId.Type:
                    GUI.Label(cellRect, item.interactor.GetType().Name);
                    break;

                case (int)ColumnId.HoverActive:
                    GUI.Label(cellRect, item.interactor.isHoverActive.ToString());
                    break;

                case (int)ColumnId.SelectActive:
                    GUI.Label(cellRect, item.interactor.isSelectActive.ToString());
                    break;

                case (int)ColumnId.HoverInteractable:
                    item.interactor.GetHoverTargets(m_Targets);
                    if (m_Targets.Count > 0)
                    {
                        GUI.Label(cellRect, XRInteractionDebuggerWindow.JoinNames(",", m_Targets));
                    }
                    break;

                case (int)ColumnId.SelectInteractable:
                    if (item.interactor.selectTarget != null)
                    {
                        GUI.Label(cellRect, item.interactor.selectTarget.name);
                    }
                    break;

                case (int)ColumnId.ValidTargets:
                    item.interactor.GetValidTargets(m_Targets);
                    if (m_Targets.Count > 0)
                    {
                        GUI.Label(cellRect, XRInteractionDebuggerWindow.JoinNames(",", m_Targets));
                    }
                    break;
                }
            }
        }
コード例 #2
0
 public static void Init()
 {
     if (s_Instance == null)
     {
         s_Instance = GetWindow <XRInteractionDebuggerWindow>();
         s_Instance.Show();
         s_Instance.titleContent = EditorGUIUtility.TrTextContent("XR Interaction Debugger");
     }
     else
     {
         s_Instance.Show();
         s_Instance.Focus();
     }
 }
コード例 #3
0
        void ColumnGUI(Rect cellRect, Item item, int column, ref RowGUIArgs args)
        {
            CenterRectUsingSingleLineHeight(ref cellRect);

            if (column == (int)ColumnId.Name)
            {
                args.rowRect = cellRect;
                base.RowGUI(args);
            }

            if (item.interactable != null)
            {
                switch (column)
                {
                case (int)ColumnId.Type:
                    GUI.Label(cellRect, item.interactable.GetType().Name);
                    break;

                case (int)ColumnId.LayerMask:
                    GUI.Label(cellRect, item.interactable.interactionLayerMask.value.ToString());
                    break;

                case (int)ColumnId.Colliders:
                    GUI.Label(cellRect, XRInteractionDebuggerWindow.JoinNames(",", item.interactable.colliders));
                    break;

                case (int)ColumnId.Hover:
                    GUI.Label(cellRect, item.interactable.isHovered ? "True" : "False");
                    break;

                case (int)ColumnId.Select:
                    GUI.Label(cellRect, item.interactable.isSelected ? "True" : "False");
                    break;
                }
            }
        }