Photon Unity Networking 2 2.45

Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
CullArea Class Reference

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

Inherits MonoBehaviour.

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

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
 

Static Public Attributes

const int MAX_NUMBER_OF_SUBDIVISIONS = 3
 

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> 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 OnDrawGizmos ( )

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

Member Data Documentation

◆ FIRST_GROUP_ID

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.

◆ SUBDIVISION_FIRST_LEVEL_ORDER

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:

  • 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 [] 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 [] 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.