SearchProposition
Search propositions are used to display choices to the user to add new filters to a search query.
Read time 1 minuteLast updated 6 days ago
Definition
- Type: Struct
- Namespace: UnityEditor.Search
- Assembly: UnityEditor
- Implements: IEquatable<SearchProposition>, IComparable<SearchProposition>
public readonly struct SearchProposition : IEquatable<SearchProposition>, IComparable<SearchProposition>
Examples
static IEnumerable<SearchProposition> EnumerateDecalPropositions(SearchContext context, SearchPropositionOptions options){ if (!options.flags.HasAny(SearchPropositionFlags.QueryBuilder)) yield break; var shaderIcon = EditorGUIUtility.Load("Shader Icon") as Texture2D; yield return new SearchProposition(category: "Affects", label: "Base Color", replacement: "affectalbedo=1", icon: shaderIcon); yield return new SearchProposition(category: "Affects", label: "Normal", replacement: "affectnormal=1", icon: shaderIcon); yield return new SearchProposition(category: "Affects", label: "Metal", replacement: "affectmetal=1", icon: shaderIcon); yield return new SearchProposition(category: "Affects", label: "Ambient Occlusion", replacement: "affectao=1", icon: shaderIcon); yield return new SearchProposition(category: "Affects", label: "Smoothness", replacement: "affectsmoothness=1", icon: shaderIcon); yield return new SearchProposition(category: "Affects", label: "Emission", replacement: "affectemission=1", icon: shaderIcon);}
Fields
Value | Description |
|---|---|
| data | The data field can hold any user data that the user can retrieve later to determine the nature of the proposition. |
Constructors
Constructor | Description |
|---|---|
| SearchProposition(System.String,System.String,System.String,System.Int32,UnityEditor.Search.TextCursorPlacement,UnityEngine.Texture2D,UnityEngine.Color) | Create a new search proposition. |
| SearchProposition(System.String,System.String,System.String,System.Int32,UnityEngine.Texture2D,System.Object,UnityEngine.Color) | Create a new search proposition. |
| SearchProposition(System.String,System.String,System.String,System.String,System.Int32,UnityEditor.Search.TextCursorPlacement,UnityEngine.Texture2D,System.Type,System.Object,UnityEngine.Color) | Create a new search proposition. |