Photon Fusion 2.0.0

Classes | Public Types | Public Member Functions | List of all members
NetworkBehaviour.ChangeDetector Class Reference

Change detector for a NetworkBehaviour. More...

Classes

struct  Enumerable
 Struct representing a collection of changes detected in a NetworkBehaviour. More...
 
struct  Enumerator
 Enumerator for the collection of changes detected in a NetworkBehaviour. More...
 

Public Types

enum  Source
 Enum representing the source of a NetworkBehaviour's state. More...
 

Public Member Functions

Enumerable DetectChanges (NetworkBehaviour b, bool copyChanges=true)
 Detects changes in a NetworkBehaviour and returns an Enumerable of the changes.
 
Enumerable DetectChanges (NetworkBehaviour b, out NetworkBehaviourBuffer previous, out NetworkBehaviourBuffer current, bool copyChanges=true)
 Detects changes in a NetworkBehaviour and returns an Enumerable of the changes.
 
void Init (NetworkBehaviour networkBehaviour, Source source, bool copyInitial=true)
 Initializes the ChangeDetector for a given NetworkBehaviour.
 

Detailed Description

Change detector for a NetworkBehaviour.

This class is used to detect changes in a NetworkBehaviour. It can be used to detect changes in a NetworkBehaviour between two snapshots, or between the current state and a snapshot.

Member Enumeration Documentation

◆ Source

enum Source

Enum representing the source of a NetworkBehaviour's state.

Enumerator
SimulationState 

The state is the current simulation state of the NetworkBehaviour.

SnapshotFrom 

The state is from a previous snapshot of the NetworkBehaviour.

SnapshotTo 

The state is from a future snapshot of the NetworkBehaviour.

Member Function Documentation

◆ DetectChanges() [1/2]

Enumerable DetectChanges ( NetworkBehaviour  b,
bool  copyChanges = true 
)

Detects changes in a NetworkBehaviour and returns an Enumerable of the changes.

Parameters
bThe NetworkBehaviour instance to detect changes in.
copyChangesWhether to copy the changes detected. Defaults to true.
Returns
An Enumerable of the changes detected in the NetworkBehaviour.

◆ DetectChanges() [2/2]

Enumerable DetectChanges ( NetworkBehaviour  b,
out NetworkBehaviourBuffer  previous,
out NetworkBehaviourBuffer  current,
bool  copyChanges = true 
)

Detects changes in a NetworkBehaviour and returns an Enumerable of the changes.

Parameters
bThe NetworkBehaviour instance to detect changes in.
previousThe previous state of the NetworkBehaviour.
currentThe current state of the NetworkBehaviour.
copyChangesWhether to copy the changes detected. Defaults to true.
Returns
An Enumerable of the changes detected in the NetworkBehaviour.

◆ Init()

void Init ( NetworkBehaviour  networkBehaviour,
Source  source,
bool  copyInitial = true 
)

Initializes the ChangeDetector for a given NetworkBehaviour.

Parameters
networkBehaviourThe NetworkBehaviour instance to initialize the ChangeDetector for.
sourceThe source of the NetworkBehaviour's state.
copyInitialWhether to copy the initial state of the NetworkBehaviour. Defaults to true.