Class Proxy
Represents a link between one real-world object and a Unity GameObject
Namespace: Unity.MARS
Syntax
public class Proxy : MARSEntity, ISimulatable, IUsesQueryResults, IUsesMarsSceneEvaluation, IUsesDevQueryResults, IMRObject, IHasEditorColor
Fields
OnUnmatched
Called when this Proxy 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
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
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 |
---|---|
Int32 |
Implements
conditions
Data filters for this Object's query
Declaration
public ProxyConditions conditions { get; }
Property Value
Type | Description |
---|---|
ProxyConditions |
currentData
The current query result data
Declaration
public QueryResult currentData { get; }
Property Value
Type | Description |
---|---|
QueryResult |
exclusivity
Can the data captured by this Proxy be used by another Proxy?
Declaration
public Exclusivity exclusivity { get; set; }
Property Value
Type | Description |
---|---|
Exclusivity |
Priority
How important is this Proxy 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 Proxy is in
Declaration
public QueryState queryState { get; }
Property Value
Type | Description |
---|---|
QueryState |
ReacquireOnLoss
Should the proxy attempt to re-acquire on tracking loss?
Declaration
public bool ReacquireOnLoss { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
VisibilityStates
Mapping of this proxy's child objects to their associated visibility state data.
Declaration
public Dictionary<GameObject, Proxy.ObjectVisibilityInfo> VisibilityStates { get; }
Property Value
Type | Description |
---|---|
Dictionary<GameObject, Proxy.ObjectVisibilityInfo> |
Methods
AssignMatch(Int32, Boolean)
Manually match this Proxy to a data ID
Declaration
public bool AssignMatch(int newDataId, bool matchConditions = true)
Parameters
Type | Name | Description |
---|---|---|
Int32 | newDataId | The data ID to match |
Boolean | matchConditions | If true, all Conditions on the Proxy must be met by the new data. If false, the data only has to have all the traits required by the Proxy. |
Returns
Type | Description |
---|---|
Boolean |
GetRequirements()
Get the trait requirements for this Proxy
Declaration
public ProxyTraitRequirements GetRequirements()
Returns
Type | Description |
---|---|
ProxyTraitRequirements |
RequestEvaluation(Action)
Request the MARS scene this proxy 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 |
SyncModifications()
Informs the DB of changes to this proxy's conditions after activation.
Declaration
public void SyncModifications()
Unmatch(Boolean)
Cause this proxy to give up its match, without removing it from the system. If this Proxy is in a ProxyGroup, the effect depends on whether this proxy is marked as required by the group. Un-matching a Proxy that is required by a group will result in the loss of the entire ProxyGroup's match. Un-matching a Proxy that is in a group, but not required by it, will only lose the match for that Proxy.
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. Ignored when this Proxy is in a Group, but not required by it. |
Returns
Type | Description |
---|---|
Boolean | True if this proxy already had a match, and that was given up. False otherwise. |
Events
MatchChanged
Occurs when the result of this proxy changes, can be null to indicate no match.
Declaration
public event Action<QueryResult> MatchChanged
Event Type
Type | Description |
---|---|
Action<QueryResult> |