Class PolySpatialNetworkFilter
A PolySpatial-specific Network Filter that allows for filtering out objects for all players but one. This allows for marking objects to show for only a single player, when PolySpatial is connected to a multiplayer supported platform. When this component is active, objects under its influence are marked with PolySpatialNetworkFilterObject components.
Inherited Members
Namespace: Unity.PolySpatial
Assembly: Unity.PolySpatial.dll
Syntax
public class PolySpatialNetworkFilter : MonoBehaviour
Fields
ApplyToDescendantsOnEnable
This boolean only applies once when the component is first created or enabled. To delete any created PolySpatialNetworkFilterObjects created by this filter, disable this component.
Declaration
[Tooltip("If this filter should apply recursively to descendant game objects. Only applied once when this component is first created or enabled. Disabling this property at runtime does nothing.")]
public bool ApplyToDescendantsOnEnable
Field Value
| Type | Description |
|---|---|
| bool |
DynamicallyApplyToNewDescendants
If true, any newly created descendant game objects will be tagged with a PolySpatialNetworkFilterObject component. This can become an expensive operation if the game object hierarchy is changing frequently. If this filter is disabled, or if the newly added game object isn't a child of a game object that has already been tagged, then nothing will happen.
Declaration
[Tooltip("If true, any newly created descendant game objects will be tagged with a PolySpatialNetworkFilterObject component. Please see the function summary for more information on restrictions and limitations.")]
public bool DynamicallyApplyToNewDescendants
Field Value
| Type | Description |
|---|---|
| bool |
Properties
PlayerId
Corresponds to a specific player on the multiplayer supported platform. When a valid player id is set on this filter, objects that are affected by this filter will only appear to that corresponding player, and will not be visible to any other player. Platforms that don't support multiplayer will not have player ids, and this component will do nothing.
Declaration
public uint PlayerId { get; set; }
Property Value
| Type | Description |
|---|---|
| uint |
Methods
ApplyFilterToNewDescendants()
Traverses the descendant GameObjects of this filter, and tags any objects that don't already have PolySpatialNetworkFilterObject. If DynamicallyApplyToNewDescendants is disabled or if the filter is disabled, this function does nothing.
Declaration
public void ApplyFilterToNewDescendants()
RemoveFilterObject(PolySpatialNetworkFilterObject)
Let's filter know that it should stop keeping track of a certain PolySpatialNetworkFilterObject due to the object being destroyed.
Declaration
public void RemoveFilterObject(PolySpatialNetworkFilterObject filterObject)
Parameters
| Type | Name | Description |
|---|---|---|
| PolySpatialNetworkFilterObject | filterObject | Filter object to stop managing. |