GetSelectedItem() public method

public GetSelectedItem ( ) : TreeViewItem,
return TreeViewItem,
    public void OnGUI()
    {
        GUILayout.BeginVertical();
        {
            m_treeView.DisplayTreeView(TreeViewControl.DisplayTypes.USE_SCROLL_VIEW);

            EditorGUILayout.BeginHorizontal("Box");
            {
                if (GUILayout.Button("Ok"))
                {
                    //Get the selected item
                    TreeViewItem selectedItem = m_treeView.GetSelectedItem();

                    //Check if the selected item has the correct type
                    if (selectedItem != null && m_type == (selectedItem.DataContext as AkWwiseTreeView.AkTreeInfo).ObjectType)
                    {
                        SetGuid(selectedItem);
                    }

                    //The window can now be closed
                    m_close = true;
                }
                else if (GUILayout.Button("Cancel"))
                {
                    m_close = true;
                }
                else if (GUILayout.Button("Reset"))
                {
                    ResetGuid();
                    m_close = true;
                }
                //We must be in 'used' mode in order for this to work
#if UNITY_2017_3_OR_NEWER
                else if (Event.current.type == EventType.Used && m_treeView.LastDoubleClickedItem != null && m_type == (m_treeView.LastDoubleClickedItem.DataContext as AkWwiseTreeView.AkTreeInfo).ObjectType)
#else
                else if (Event.current.type == EventType.used && m_treeView.LastDoubleClickedItem != null && m_type == (m_treeView.LastDoubleClickedItem.DataContext as AkWwiseTreeView.AkTreeInfo).ObjectType)
#endif

                {
                    SetGuid(m_treeView.LastDoubleClickedItem);
                    m_close = true;
                }
            }
            EditorGUILayout.EndHorizontal();
        }
        EditorGUILayout.EndVertical();
    }
    public void OnGUI()
    {
        UnityEngine.GUILayout.BeginVertical();
        {
            m_treeView.DisplayTreeView(AK.Wwise.TreeView.TreeViewControl.DisplayTypes.USE_SCROLL_VIEW);

            UnityEditor.EditorGUILayout.BeginHorizontal("Box");
            {
                if (UnityEngine.GUILayout.Button("Ok"))
                {
                    //Get the selected item
                    var selectedItem = m_treeView.GetSelectedItem();

                    //Check if the selected item has the correct type
                    if (selectedItem != null && m_type == (selectedItem.DataContext as AkWwiseTreeView.AkTreeInfo).ObjectType)
                    {
                        SetGuid(selectedItem);
                    }

                    //The window can now be closed
                    m_close = true;
                }
                else if (UnityEngine.GUILayout.Button("Cancel"))
                {
                    m_close = true;
                }
                else if (UnityEngine.GUILayout.Button("Reset"))
                {
                    ResetGuid();
                    m_close = true;
                }
                else if (UnityEngine.Event.current.type == UnityEngine.EventType.Used && m_treeView.LastDoubleClickedItem != null &&
                         m_type == (m_treeView.LastDoubleClickedItem.DataContext as AkWwiseTreeView.AkTreeInfo).ObjectType)
                {
                    //We must be in 'used' mode in order for this to work
                    SetGuid(m_treeView.LastDoubleClickedItem);
                    m_close = true;
                }
            }
            UnityEditor.EditorGUILayout.EndHorizontal();
        }
        UnityEditor.EditorGUILayout.EndVertical();
    }