Photon Fusion 1.1.12

Public Member Functions | Public Attributes | Properties | List of all members
Changed< T > Struct Template Reference

Wrapping struct around changed behaviours which allows you to load old and new values. More...

Public Member Functions

void LoadNew ()
 Sets the Behaviour to represent the changed state after the triggering change occurred. This is the already default state of the behaviour when an OnChanged callback occurs, and only needs to be called to revert from a previous LoadOld() call in your changed callback handler. More...
 
void LoadOld ()
 Sets the changed behaviour to represent the previous state before the triggering change occurred. To get previous values, call this before getting networked properties of Behaviour. More...
 
void Rescan ()
 Tells the OnChanged callback system that this object needs to be re-scanned for changes after the current change scan is completed. Call this is you are changing data inside an OnChange callback and can't wait for the next tick to execute until the callback is triggered. More...
 

Public Attributes

_behaviour
 
int * _new
 
int * _old
 
bool _rescan
 

Properties

Behaviour [get]
 The wrapped changed behaviour instance. The behaviour will have the new networked values. Previous values can be obtained by calling changed.Behaviour.LoadOld(), then accessing the networked properties of changed.behaviour. More...
 

Detailed Description

Wrapping struct around changed behaviours which allows you to load old and new values.

Type Constraints
T :NetworkBehaviour 

Member Function Documentation

◆ LoadNew()

void LoadNew ( )

Sets the Behaviour to represent the changed state after the triggering change occurred. This is the already default state of the behaviour when an OnChanged callback occurs, and only needs to be called to revert from a previous LoadOld() call in your changed callback handler.

◆ LoadOld()

void LoadOld ( )

Sets the changed behaviour to represent the previous state before the triggering change occurred. To get previous values, call this before getting networked properties of Behaviour.

◆ Rescan()

void Rescan ( )

Tells the OnChanged callback system that this object needs to be re-scanned for changes after the current change scan is completed. Call this is you are changing data inside an OnChange callback and can't wait for the next tick to execute until the callback is triggered.

Property Documentation

◆ Behaviour

T Behaviour
get

The wrapped changed behaviour instance. The behaviour will have the new networked values. Previous values can be obtained by calling changed.Behaviour.LoadOld(), then accessing the networked properties of changed.behaviour.