Class ProxyGroup
A MARS Entity representing a grouping of related proxies to match simultaneously
Namespace: Unity.MARS
Syntax
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 |
ReacquireOnLoss
Should the group attempt to re-acquire on tracking loss?
Declaration
public bool ReacquireOnLoss { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Methods
GetChildList(List<Proxy>)
Declaration
public void GetChildList(List<Proxy> children)
Parameters
Type | Name | Description |
---|---|---|
List<Proxy> | children |
GetRequired(Proxy)
Returns true if the proxy child is required for matching.
Declaration
public bool GetRequired(Proxy proxy)
Parameters
Type | Name | Description |
---|---|---|
Proxy | proxy | The proxy to check against. |
Returns
Type | Description |
---|---|
Boolean | True if required, false if optional. |
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 |
SetRequired(Proxy, Boolean)
Sets if a proxy is required by the relevant relations.
Declaration
public void SetRequired(Proxy proxy, bool isRequired)
Parameters
Type | Name | Description |
---|---|---|
Proxy | proxy | The target proxy, which must be a child of this group. |
Boolean | isRequired | Whether or not the proxy is required. |
SyncModifications(Boolean)
Informs the DB of changes to this ProxyGroup's conditions and relations after activation.
Declaration
public void SyncModifications(bool updateReasoning = true)
Parameters
Type | Name | Description |
---|---|---|
Boolean | updateReasoning | Pass false if you plan to call UpdateReasoning manually, such as doing changes to multiple ProxyGroups at once |
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. |
UpdateReasoning()
Notifies the session and reasoning module to re-check the capabilities and add any reasoning APIs that may now be required after changing conditions and relationships on ProxyGroups If performing multiple
Declaration
public static void UpdateReasoning()
Events
MatchChanged
Occurs when the result of this proxy group changes, can be null to indicate no match.
Declaration
public event Action<SetQueryResult> MatchChanged
Event Type
Type | Description |
---|---|
Action<SetQueryResult> |