Class ProxyGroup
A MARS Entity representing a grouping of related proxies to match simultaneously
Inherited Members
Namespace: Unity.MARS
Assembly: Unity.MARS.dll
Syntax
[DisallowMultipleComponent]
[HelpURL("https://docs.unity3d.com/Packages/com.unity.mars@2.0/manual/MARSConcepts.html#proxy-groups")]
[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, bool> |
Properties
Priority
How important is this group matching
Declaration
public MarsEntityPriority Priority { get; set; }
Property Value
| Type | Description |
|---|---|
| MarsEntityPriority |
ReacquireOnLoss
Should the group attempt to re-acquire on tracking loss?
Declaration
public bool ReacquireOnLoss { get; set; }
Property Value
| Type | Description |
|---|---|
| bool |
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 |
|---|---|
| int | 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 |
colorIndex
The index in the color list that this color is using. If the color has been modified, it should be -1.
Declaration
public int colorIndex { get; set; }
Property Value
| Type | Description |
|---|---|
| int |
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 |
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 |
|---|---|
| bool | 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 |
|---|---|
| int | The index of the child if it's in the group's list. If the child is not found in the list, returns -1 |
OnValidate()
Declaration
public void OnValidate()
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, bool)
Declaration
public void SetChildRequired(Proxy child, bool required)
Parameters
| Type | Name | Description |
|---|---|---|
| Proxy | child | |
| bool | required |
SetRequired(Proxy, bool)
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. |
| bool | isRequired | Whether or not the proxy is required. |
SyncModifications(bool)
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 |
|---|---|---|
| bool | updateReasoning | Pass false if you plan to call UpdateReasoning manually, such as doing changes to multiple ProxyGroups at once |
Unmatch(bool)
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 |
|---|---|---|
| bool | 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 |
|---|---|
| bool | 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> |