Library/PackageCache/com.unity.quicksearch@1.6.0-preview.8/Editor/Providers/SceneProvider.cs
/// <summary>
/// Create default action handles for scene SearchItem. See <see cref="SearchAction"/>.
/// </summary>
/// <param name="providerId">Provider Id registered for the action.</param>
/// <returns>A collection of SearchActions working for a Scene SearchItem.</returns>
Create default action handles for scene SearchItem. See .
Create default action handles for scene SearchItem . See .
public static IEnumerable<SearchAction> CreateActionHandlers(string providerId)
        {
            return new SearchAction[]
            {
                new SearchAction(providerId, "select", null, "Select object(s) in scene...")
                {
                    execute = (items) =>
                    {
                        FrameObjects(items.Select(i => i.provider.toObject(i, typeof(GameObject))).Where(i=>i).ToArray());
                    }
                },
                new SearchAction(providerId, "open", null, "Select containing asset...")
                {
                    handler = (item) =>
                    {
                        var pingedObject = PingItem(item);
                        if (pingedObject != null)
                        {
                            var go = pingedObject as GameObject;
                            var assetPath = SearchUtils.GetHierarchyAssetPath(go);
                            if (!String.IsNullOrEmpty(assetPath))
                                Utils.FrameAssetFromPath(assetPath);
                            else
                                FrameObject(go);
                        }
                    }
                }
            };
        }
public static IEnumerable < SearchAction > CreateActionHandlers ( string providerId ) { return new SearchAction [ ] { new SearchAction ( providerId , " " , null , " " ) { execute = ( items ) => { FrameObjects ( items . Select ( i => i . provider . toObject ( i , typeof ( GameObject ) ) ) . Where ( i => i ) . ToArray ( ) ) ; } } , new SearchAction ( providerId , " " , null , " " ) { handler = ( item ) => { var pingedObject = PingItem ( item ) ; if ( pingedObject != null ) { var go = pingedObject as GameObject ; var assetPath = SearchUtils . GetHierarchyAssetPath ( go ) ; if ( ! String . IsNullOrEmpty ( assetPath ) ) Utils . FrameAssetFromPath ( assetPath ) ; else FrameObject ( go ) ; } } } } ; }
Create default action handles for scene SearchItem.
Create default action handles for scene SearchItem .
A collection of SearchActions working for a Scene SearchItem.
A collection of SearchActions working for a Scene SearchItem .
providerId
string
Provider Id registered for the action.
Provider Id registered for the action .