Unclaimed Package Is this your package? Claim it to unlock full analytics and manage your listing.
Claim This Package

Install via UPM

Add to Unity Package Manager using this URL

https://www.pkglnk.dev/track/bettersearchwindow.git#upm

README

Better Search Window

openupm

A simple extension/wrapper to simplify the usage of the UnityEditor.Experimental.GraphView.SearchWindow API.

bettersearchwindow-showcase

Usage

  1. Create a new search window class that inherits from BetterSearchWindow<TWindow, TPayload>:
using BetterSearchWindow;

// TWindow should just be your class and TPayload is the type of payload you would like to use in the window.
public class SampleSearchWindow : BetterSearchWindow<SampleSearchWindow, string>
{
}
  1. Implement CreateSearchTree(SearchWindowContext context) using BetterSearchTree<TPayload> to create the List<SearchTreeEntry>:
public override List<SearchTreeEntry> CreateSearchTree(SearchWindowContext context)
{
    // You can just use BetterSearchTree<T> (where T is you payload type) to build your search tree
    return new BetterSearchTree<string>()
        .AddLeaf("Hello/Hello World", "Hello World!")
        .AddLeaf("Hello/Hello There", "Hello there.")
        .AddLeaf("Test", "This is a test.")

        // Finally just convert the tree to a list of search tree entries while providing the root name
        // which is just the window title displayed at the root of the search window
        .ToSearchTreeEntries("Sample Window");
}
  1. Provide a callback method that should be called when a leaf entry is selected:
// Just a method that receives the payload of the selected entry
private static void MyItemSelectedCallback(string payload)
{
    Debug.Log(payload);
}
  1. Show the window using the static Show(Action<TPayload> callback, Vector2 position) method:
// Position is optional. It will try to fallback to the mouse position if nothing else is specified
SampleSearchWindow.Show(MyItemSelectedCallback, new Vector2(300, 30));

Install

Open UPM

The package is available on the openupm registry. You can install it via openupm-cli.

openupm add com.freshlybrewedcode.bettersearchwindow

Git Url

Open the Package Manager in Unity (Window/Package Manager), on the top left click on the plus icon and select "Add package from git URL...", enter the following url and click "Add"

https://github.com/FreshlyBrewedCode/BetterSearchWindow.git#upm

Download

Go to the releases tab of this repository and download the source code for the latest release. Place the "Better Search Window" directory into your projects Assets or Packages folder.

Total Installs
0
Last 30 days
Unique IPs
0
Approximate users

Installs Over Time

Operating Systems

No data yet

Top Countries

No data yet

Git Versions

No data yet

Embed Install Badge

Add an install count badge to your README

Style
Preview
pkglnk installs badge
Markdown
[![pkglnk installs](https://www.pkglnk.dev/badge/bettersearchwindow.svg?style=pkglnk)](https://www.pkglnk.dev/pkg/bettersearchwindow)
HTML
<a href="https://www.pkglnk.dev/pkg/bettersearchwindow"><img src="https://www.pkglnk.dev/badge/bettersearchwindow.svg?style=pkglnk" alt="pkglnk installs"></a>

Comments

No comments yet. Be the first!