DisplayTreeView() public method

public DisplayTreeView ( TreeViewControl, displayType ) : void
displayType TreeViewControl,
return void
Beispiel #1
0
    public void OnGUI()
    {
        GUILayout.BeginHorizontal("Box");

        AkWwiseProjectInfo.GetData().autoPopulateEnabled = GUILayout.Toggle(AkWwiseProjectInfo.GetData().autoPopulateEnabled, "Auto populate");

        if (AkWwiseProjectInfo.GetData().autoPopulateEnabled&& WwiseProjectFound)
        {
            AkWwiseWWUWatcher.GetInstance().StartWWUWatcher();
        }
        else
        {
            AkWwiseWWUWatcher.GetInstance().StopWWUWatcher();
        }
        GUILayout.FlexibleSpace();
        if (GUILayout.Button("Refresh Project", GUILayout.Width(200)))
        {
            treeView.SaveExpansionStatus();
            AkWwiseProjectInfo.Populate();
            PopulateTreeview();
        }

        GUILayout.EndHorizontal();

        GUILayout.Space(5);

        treeView.DisplayTreeView(TreeViewControl.DisplayTypes.USE_SCROLL_VIEW);

        if (GUI.changed && WwiseProjectFound)
        {
            EditorUtility.SetDirty(AkWwiseProjectInfo.GetData());
        }
        // TODO: RTP Parameters List
    }
    public void OnGUI()
    {
        GUILayout.BeginHorizontal("Box");

        AkWwiseProjectInfo.GetData().autoPopulateEnabled = GUILayout.Toggle(AkWwiseProjectInfo.GetData().autoPopulateEnabled, "Auto populate");

        if (AkWwiseProjectInfo.GetData().autoPopulateEnabled&& WwiseProjectFound)
        {
            AkWwiseWWUBuilder.StartWWUWatcher();
        }
        else
        {
            AkWwiseWWUBuilder.StopWWUWatcher();
        }
        GUILayout.FlexibleSpace();
        if (GUILayout.Button("Refresh Project", GUILayout.Width(200)))
        {
            treeView.SaveExpansionStatus();
            if (AkWwiseProjectInfo.Populate())
            {
                PopulateTreeview();
            }
        }

        if (GUILayout.Button("Generate SoundBanks", GUILayout.Width(200)))
        {
            if (AkUtilities.IsSoundbankGenerationAvailable())
            {
                AkUtilities.GenerateSoundbanks();
            }
            else
            {
                string errorMessage;

#if UNITY_EDITOR_WIN
                errorMessage = "Access to Wwise is required to generate the SoundBanks. Please select the Wwise Windows Installation Path from the Edit > Wwise Settings... menu.";
#elif UNITY_EDITOR_OSX
                errorMessage = "Access to Wwise is required to generate the SoundBanks. Please select the Wwise Application from the Edit > Wwise Settings... menu.";
#endif

                Debug.LogError(errorMessage);
            }
        }

        GUILayout.EndHorizontal();

        GUILayout.Space(5);

        treeView.DisplayTreeView(TreeViewControl.DisplayTypes.USE_SCROLL_VIEW);

        if (GUI.changed && WwiseProjectFound)
        {
            EditorUtility.SetDirty(AkWwiseProjectInfo.GetData());
        }
        // TODO: RTP Parameters List
    }
    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();
    }