NetworkCulling
Jump To Parameters
Jump To Function Definitions
Parameter Definitions
Select the parameter name from below to jump directly to it on this page.
circleColor
distance
drawGizmos
interest_group
last_group
last_moveSpeed
last_rotateSpeed
moveSpeed
rotateSpeed
circleColor
This only applies to the color you want this circle to be in the gizmo in the editor.
| Exposed Value | Type | Default Value |
|---|---|---|
| public | Color | Color.green |
distance
The distance the other player must be at or less than to subscribe to be a part “
of this photon interest group.
| Exposed Value | Type | Default Value |
|---|---|---|
| public | float | 10 |
drawGizmos
Disable or enable the distance gizmos.
| Exposed Value | Type | Default Value |
|---|---|---|
| private | bool | true |
interest_group
The interest group to subscribe to when another player is within that distance.
| Exposed Value | Type | Default Value |
|---|---|---|
| public | byte | 0 |
last_group
The distances that will be used to send to certain interest groups. This is to help “
return the network load. Objects/Players that are greater distance than the last item in the “
list will always receive the least amount of network packets. \n\n”
EX: If the other “
player is less than or equal to 10 units away from this object and you have an “
item in this list with a distance of 10 that means they will be in that specified group “
for sending network data. The lower on the list/greater the distance means the less network “
packets that player will receive from this object.The interest group to use when the player is further than the greatest cullDistance.
| Exposed Value | Type | Default Value |
|---|---|---|
| protected | byte | 255 |
last_moveSpeed
How fast to move the networked players position when they’re in this interest group.
| Exposed Value | Type | Default Value |
|---|---|---|
| public | float | 3.0f |
last_rotateSpeed
How fast to move the networked players rotation when they’re in this interest group.
| Exposed Value | Type | Default Value |
|---|---|---|
| public | float | 3.0f |
moveSpeed
How fast to move the networked players position when they’re in this interest group.
| Exposed Value | Type | Default Value |
|---|---|---|
| public | float | 5.0f |
rotateSpeed
How fast to move the networked players rotation when they’re in this interest group.
| Exposed Value | Type | Default Value |
|---|---|---|
| public | float | 5.0f |
Function Definitions
Select the function name from below to jump directly to it on this page.
OnDrawGizmos
OnPhotonSerializeView
SetInterestGroups
protected void OnDrawGizmos()
This is used to draw the wire spheres that is helpful to visualize the distances you’re setting for player network culling.
| Expose Value | Overrideable | Returns |
|---|---|---|
| protected | False | Does not return anything |
No parameters
public void OnPhotonSerializeView(PhotonStream stream, PhotonMessageInfo info)
Used to network cull based on registered player distances. Will only send certain messages to certain interest groups. The furthest interest group will receive the least amount of messages while the first interest group will receive all the messages.
| Expose Value | Overrideable | Returns |
|---|---|---|
| public | False | Does not return anything |
| Parameter Name | Description |
|---|---|
| stream | Used by photon |
| info | Used by Photon |
protected void SetInterestGroups()
Used to register the groups you would like to send/receive messages to/from (doesn’t send the messages this is just to tell what groups you can actually send to/receive from).It is also responsible for setting the other players (that you see locally) speed and rotation as well as what group they should receive network messages from.
| Expose Value | Overrideable | Returns |
|---|---|---|
| protected | False | Does not return anything |
No parameters