Class ProxyGroup
Namespace: Unity.MARS
Syntax
[ComponentTooltip("Represents a grouping of related proxies to match simultaneously")]
[MonoBehaviourComponentMenu(typeof(ProxyGroup), "Proxy Group")]
public class ProxyGroup : MARSEntity, ISimulatable, IUsesSetQueryResults, IUsesMarsSceneEvaluation, IHasEditorColor
Fields
OnUnmatched
Called when this ProxyGroup is manually un-matched, but not in the event of data loss leading to unmatching
Declaration
public Action<QueryMatchID, bool> OnUnmatched
Field Value
Type | Description |
---|---|
Action<QueryMatchID, Boolean> |
Properties
childCount
The number of children this group currently has in its list. Call RepopulateChildList before getting this value to ensure it is most updated.
Declaration
public int childCount { get; }
Property Value
Type | Description |
---|---|
Int32 | Number of child objects of the group |
color
A color that will be associated with this object in the editor.
Declaration
public Color color { get; set; }
Property Value
Type | Description |
---|---|
Color |
Implements
colorIndex
Declaration
public int colorIndex { get; set; }
Property Value
Type | Description |
---|---|
Int32 |
Implements
Priority
How important is this group matching
Declaration
public MarsEntityPriority Priority { get; set; }
Property Value
Type | Description |
---|---|
MarsEntityPriority |
queryID
The identifier for this Object's query
Declaration
public QueryMatchID queryID { get; }
Property Value
Type | Description |
---|---|
QueryMatchID |
queryState
What part of the query lifecycle this group is in
Declaration
public QueryState queryState { get; }
Property Value
Type | Description |
---|---|
QueryState |
Methods
GetChildList(List<Proxy>)
Declaration
public void GetChildList(List<Proxy> children)
Parameters
Type | Name | Description |
---|---|---|
List<Proxy> | children |
IndexOfChild(Proxy)
Finds the index of a child in the child list
Declaration
public int IndexOfChild(Proxy child)
Parameters
Type | Name | Description |
---|---|---|
Proxy | child | The child object |
Returns
Type | Description |
---|---|
Int32 | The index of the child if it's in the group's list. If the child is not found in the list, returns -1 |
RepopulateChildList()
Declaration
public void RepopulateChildList()
RequestEvaluation(Action)
Request the MARS scene this proxy group is in to be evaluated for matches
Declaration
public MarsSceneEvaluationRequestResponse RequestEvaluation(Action onEvaluationComplete = null)
Parameters
Type | Name | Description |
---|---|---|
Action | onEvaluationComplete | An optional callback, executed when the evaluation process completes |
Returns
Type | Description |
---|---|
MarsSceneEvaluationRequestResponse | A description of the system's response to the request |
SetChildRequired(Proxy, Boolean)
Declaration
public void SetChildRequired(Proxy child, bool required)
Parameters
Type | Name | Description |
---|---|---|
Proxy | child | |
Boolean | required |
Unmatch(Boolean)
Cause this proxy group to give up its match, without removing it from the system.
Declaration
public bool Unmatch(bool searchForNewMatch = true)
Parameters
Type | Name | Description |
---|---|---|
Boolean | searchForNewMatch | If true, the system will search for a different match automatically. If false, the system will not search for a new match automatically. |
Returns
Type | Description |
---|---|
Boolean | True if this group already had a match, and that was given up. False otherwise. |