Photon.Pun.UtilityScripts.CullArea Class Reference

Represents the cull area used for network culling. More...

Inheritance diagram for Photon.Pun.UtilityScripts.CullArea:

Public Member Functions

void OnDrawGizmos ()
 Creates the cell hierarchy in editor and draws the cell view. More...
 
List< byte > GetActiveCells (Vector3 position)
 Gets a list of all cell IDs the player is currently inside or nearby. More...
 

Public Attributes

const int MAX_NUMBER_OF_SUBDIVISIONS = 3
 
readonly byte FIRST_GROUP_ID = 1
 This represents the first ID which is assigned to the first created cell. If you already have some interest groups blocking this first ID, fell free to change it. However increasing the first group ID decreases the maximum amount of allowed cells. Allowed values are in range from 1 to 250. More...
 
readonly int [] SUBDIVISION_FIRST_LEVEL_ORDER = new int[4] { 0, 1, 1, 1 }
 This represents the order in which updates are sent. The number represents the subdivision of the cell hierarchy: More...
 
readonly int [] SUBDIVISION_SECOND_LEVEL_ORDER = new int[8] { 0, 2, 1, 2, 0, 2, 1, 2 }
 This represents the order in which updates are sent. The number represents the subdivision of the cell hierarchy: More...
 
readonly int [] SUBDIVISION_THIRD_LEVEL_ORDER = new int[12] { 0, 3, 2, 3, 1, 3, 2, 3, 1, 3, 2, 3 }
 This represents the order in which updates are sent. The number represents the subdivision of the cell hierarchy: More...
 
Vector2 Center
 
Vector2 Size = new Vector2(25.0f, 25.0f)
 
Vector2 [] Subdivisions = new Vector2[MAX_NUMBER_OF_SUBDIVISIONS]
 
int NumberOfSubdivisions
 
bool YIsUpAxis = false
 
bool RecreateCellHierarchy = false
 

Properties

int CellCount [get]
 
CellTree CellTree [get]
 
Dictionary< int, GameObject > Map [get]
 

Detailed Description

Represents the cull area used for network culling.

Member Function Documentation

◆ GetActiveCells()

List<byte> Photon.Pun.UtilityScripts.CullArea.GetActiveCells ( Vector3  position)

Gets a list of all cell IDs the player is currently inside or nearby.

Parameters
positionThe current position of the player.
Returns
A list containing all cell IDs the player is currently inside or nearby.

◆ OnDrawGizmos()

void Photon.Pun.UtilityScripts.CullArea.OnDrawGizmos ( )

Creates the cell hierarchy in editor and draws the cell view.

Member Data Documentation

◆ Center

Vector2 Photon.Pun.UtilityScripts.CullArea.Center

◆ FIRST_GROUP_ID

readonly byte Photon.Pun.UtilityScripts.CullArea.FIRST_GROUP_ID = 1

This represents the first ID which is assigned to the first created cell. If you already have some interest groups blocking this first ID, fell free to change it. However increasing the first group ID decreases the maximum amount of allowed cells. Allowed values are in range from 1 to 250.

◆ MAX_NUMBER_OF_SUBDIVISIONS

const int Photon.Pun.UtilityScripts.CullArea.MAX_NUMBER_OF_SUBDIVISIONS = 3

◆ NumberOfSubdivisions

int Photon.Pun.UtilityScripts.CullArea.NumberOfSubdivisions

◆ RecreateCellHierarchy

bool Photon.Pun.UtilityScripts.CullArea.RecreateCellHierarchy = false

◆ Size

Vector2 Photon.Pun.UtilityScripts.CullArea.Size = new Vector2(25.0f, 25.0f)

◆ SUBDIVISION_FIRST_LEVEL_ORDER

readonly int [] Photon.Pun.UtilityScripts.CullArea.SUBDIVISION_FIRST_LEVEL_ORDER = new int[4] { 0, 1, 1, 1 }

This represents the order in which updates are sent. The number represents the subdivision of the cell hierarchy:

  • 0: message is sent to all players
  • 1: message is sent to players who are interested in the matching cell of the first subdivision If there is only one subdivision we are sending one update to all players before sending three consequent updates only to players who are in the same cell or interested in updates of the current cell.

◆ SUBDIVISION_SECOND_LEVEL_ORDER

readonly int [] Photon.Pun.UtilityScripts.CullArea.SUBDIVISION_SECOND_LEVEL_ORDER = new int[8] { 0, 2, 1, 2, 0, 2, 1, 2 }

This represents the order in which updates are sent. The number represents the subdivision of the cell hierarchy:

  • 0: message is sent to all players
  • 1: message is sent to players who are interested in the matching cell of the first subdivision
  • 2: message is sent to players who are interested in the matching cell of the second subdivision If there are two subdivisions we are sending every second update only to players who are in the same cell or interested in updates of the current cell.

◆ SUBDIVISION_THIRD_LEVEL_ORDER

readonly int [] Photon.Pun.UtilityScripts.CullArea.SUBDIVISION_THIRD_LEVEL_ORDER = new int[12] { 0, 3, 2, 3, 1, 3, 2, 3, 1, 3, 2, 3 }

This represents the order in which updates are sent. The number represents the subdivision of the cell hierarchy:

  • 0: message is sent to all players
  • 1: message is sent to players who are interested in the matching cell of the first subdivision
  • 2: message is sent to players who are interested in the matching cell of the second subdivision
  • 3: message is sent to players who are interested in the matching cell of the third subdivision If there are two subdivisions we are sending every second update only to players who are in the same cell or interested in updates of the current cell.

◆ Subdivisions

Vector2 [] Photon.Pun.UtilityScripts.CullArea.Subdivisions = new Vector2[MAX_NUMBER_OF_SUBDIVISIONS]

◆ YIsUpAxis

bool Photon.Pun.UtilityScripts.CullArea.YIsUpAxis = false

Property Documentation

◆ CellCount

int Photon.Pun.UtilityScripts.CullArea.CellCount
get

◆ CellTree

CellTree Photon.Pun.UtilityScripts.CullArea.CellTree
get

◆ Map

Dictionary<int, GameObject> Photon.Pun.UtilityScripts.CullArea.Map
get

The documentation for this class was generated from the following file:
  • 3rd-Party/Photon/PhotonUnityNetworking/UtilityScripts/Culling/CullArea.cs