Class SelectionGroup
A component to group a number of GameObjects under a common name.
Namespace: Unity.SelectionGroups
Syntax
public class SelectionGroup : MonoBehaviour, ISerializationCallbackReceiver
Properties
Color
Sets/gets the color of the SelectionGroup
Declaration
public Color Color { get; set; }
Property Value
Type | Description |
---|---|
Color |
Count
Gets the number of members in this SelectionGroup
Declaration
public int Count { get; }
Property Value
Type | Description |
---|---|
Int32 |
Members
Get the members of the SelectionGroup
Declaration
public IList<UnityEngine.Object> Members { get; }
Property Value
Type | Description |
---|---|
IList<UnityEngine.Object> |
Name
Sets/gets the name of the SelectionGroup
Declaration
public string Name { get; set; }
Property Value
Type | Description |
---|---|
String |
Query
Sets/gets the query which will automatically include GameObjects from the hierarchy that match the query into the group.
Declaration
public string Query { get; }
Property Value
Type | Description |
---|---|
String |
Methods
Add(IEnumerable<UnityEngine.Object>)
Adds a list of objects to the SelectionGroup
Declaration
public void Add(IEnumerable<UnityEngine.Object> objects)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<UnityEngine.Object> | objects | A list of objects to be added |
Add(UnityEngine.Object)
Adds an object to the SelectionGroup Does nothing if the group is automatically filled.
Declaration
public void Add(UnityEngine.Object obj)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Object | obj | the object to be added |
Clear()
Clears the members of the SelectionGroup
Declaration
public void Clear()
EnableEditorTool(Int32, Boolean)
Declaration
public void EnableEditorTool(int toolID, bool toolEnabled)
Parameters
Type | Name | Description |
---|---|---|
Int32 | toolID | |
Boolean | toolEnabled |
GetLastQueryParseResult()
Declaration
public ParseResult GetLastQueryParseResult()
Returns
Type | Description |
---|---|
ParseResult |
IsAutoFilled()
Gets whether the group is automatically filled
Declaration
public bool IsAutoFilled()
Returns
Type | Description |
---|---|
Boolean |
OnAfterDeserialize()
Declaration
public void OnAfterDeserialize()
OnBeforeSerialize()
Declaration
public void OnBeforeSerialize()
Remove(IEnumerable<UnityEngine.Object>)
Removes a list of objects from the SelectionGroup
Declaration
public void Remove(IEnumerable<UnityEngine.Object> objectReferences)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<UnityEngine.Object> | objectReferences | A list of objects to be removed |
Remove(UnityEngine.Object)
Removes an object from the SelectionGroup. Does nothing if the group is automatically filled.
Declaration
public void Remove(UnityEngine.Object obj)
Parameters
Type | Name | Description |
---|---|---|
UnityEngine.Object | obj | The object to be removed |
SetMembers(IEnumerable<UnityEngine.Object>)
Clears and set the members of the SelectionGroup
Declaration
public void SetMembers(IEnumerable<UnityEngine.Object> objects)
Parameters
Type | Name | Description |
---|---|---|
IEnumerable<UnityEngine.Object> | objects | A enumerable collection of objects to be added |
SetQuery(String)
Sets the query which will automatically include GameObjects from the hierarchy that match the query into the group. Returns early when the query is not valid (GoQL.ParseResult.OK).
Declaration
public void SetQuery(string q)
Parameters
Type | Name | Description |
---|---|---|
String | q | The query |