コード例 #1
0
    public override void SelectItem(System.Guid itemGuid)
    {
        if (TreeView == null)
        {
            return;
        }

        if (TreeView.m_storedSearchString != string.Empty)
        {
            return;
        }

        if (!TreeView.ExpandItem(itemGuid, true))
        {
            var item = Find(itemGuid);
            treeviewCommandQueue.Enqueue(new TreeViewCommand(() => Expand(itemGuid, true)));

            if (item == null)
            {
                AkWaapiUtilities.GetResultListDelegate <WwiseObjectInfoJsonObject> callback = (List <WwiseObjectInfoJsonObject> items) =>
                {
                    AddItemWithAncestors(AkWaapiUtilities.ParseObjectInfo(items));
                };
                AkWaapiUtilities.GetWwiseObjectAndAncestors(itemGuid, waapiWwiseObjectOptions, callback);
            }
        }
    }
コード例 #2
0
    public void AddSearchResults(IEnumerable <WwiseObjectInfo> matchList)
    {
        try
        {
            foreach (var info in matchList)
            {
                if (!FilterPath(info.path))
                {
                    continue;
                }

                var match = Find(SearchItems, info.objectGUID);
                if (match != null)
                {
                    continue;
                }

                var matchItem = Find(info.objectGUID);
                if (matchItem == null)
                {
                    AkWaapiUtilities.GetResultListDelegate <WwiseObjectInfoJsonObject> callback = (List <WwiseObjectInfoJsonObject> items) =>
                    {
                        AddItemWithAncestorsToSearch(AkWaapiUtilities.ParseObjectInfo(items));
                    };
                    AkWaapiUtilities.GetWwiseObjectAndAncestors(info.objectGUID, waapiWwiseObjectOptions, callback);
                    continue;
                }

                AddItemToSearch(matchItem);
                treeviewCommandQueue.Enqueue(new TreeViewCommand(() => Expand(matchItem.objectGuid, false)));
            }
        }
        catch (System.Exception e)
        {
            UnityEngine.Debug.LogError("Search died");
            UnityEngine.Debug.LogError(e.Message);
        }
    }