Photon Fusion 1.1.2

Public Member Functions | Static Public Member Functions | Public Attributes | Static Public Attributes | Properties | List of all members
PlayerRef Struct Reference

Represents a Fusion player. More...

Inherits INetworkStruct.

Public Member Functions

override bool Equals (object obj)
override int GetHashCode ()
override string ToString ()

Static Public Member Functions

static implicit operator PlayerRef (int value)
static implicit operator bool (PlayerRef value)
static implicit operator int (PlayerRef value)
static bool operator== (PlayerRef a, PlayerRef b)
static bool operator!= (PlayerRef a, PlayerRef b)
static unsafe void Write (NetBitBuffer *buffer, PlayerRef playerRef)
static unsafe void Write< T > (T *buffer, PlayerRef playerRef)
static unsafe PlayerRef Read (NetBitBuffer *buffer)

Public Attributes

int _index

Static Public Attributes

const int SIZE = 4


static PlayerRef None [get]
 None player More...
bool IsValid [get]
 If this player index is valid More...
bool IsNone [get]
int RawEncoded [get]
 Raw encoded value More...
int PlayerId [get]
 Player id this player ref represents More...

Detailed Description

Represents a Fusion player.

The PlayerRef, in contrast to the player index, is 1-based. The reason is that default(PlayerRef) will return a "null/invalid" player ref struct for convenience. There are automatic cast operators that can cast an int into a PlayerRef.

default(PlayerRef), internally a 0, means NOBODY
PlayerRef, internally 1, is the same as player index 0
PlayerRef, internally 2, is the same as player index 1

Property Documentation

◆ IsValid

bool IsValid

If this player index is valid

◆ None

PlayerRef None

None player

◆ PlayerId

int PlayerId

Player id this player ref represents

◆ RawEncoded

int RawEncoded

Raw encoded value