public void SaveExpansionStatus() { if (AkUtilities.IsWwiseProjectAvailable) { if (RootItem.Header == "Root item") { // We were unpopulated, no need to save. But we still need to display the correct data, though. AkWwisePicker.PopulateTreeview(); return; } if (AkWwiseProjectInfo.GetData() != null) { var PreviousExpandedItems = AkWwiseProjectInfo.GetData().ExpandedItems; AkWwiseProjectInfo.GetData().ExpandedItems.Clear(); var path = string.Empty; if (RootItem.HasChildItems() && RootItem.IsExpanded) { SaveExpansionStatus(RootItem, path); } AkWwiseProjectInfo.GetData().ExpandedItems.Sort(); if (System.Linq.Enumerable.Count(System.Linq.Enumerable.Except(AkWwiseProjectInfo.GetData().ExpandedItems, PreviousExpandedItems)) > 0) { UnityEditor.EditorUtility.SetDirty(AkWwiseProjectInfo.GetData()); } } } }
public void SaveExpansionStatus() { if (AkWwisePicker.WwiseProjectFound == true) { if (RootItem.Header == "Root item") { // We were unpopulated, no need to save. But we still need to display the correct data, though. AkWwisePicker.PopulateTreeview(); return; } if (AkWwiseProjectInfo.GetData() != null) { AkWwiseProjectInfo.GetData().ExpandedItems.Clear(); string path = string.Empty; if (RootItem.HasChildItems() && RootItem.IsExpanded) { SaveExpansionStatus(RootItem, path); } AkWwiseProjectInfo.GetData().ExpandedItems.Sort(); EditorUtility.SetDirty(AkWwiseProjectInfo.GetData()); } } }