C# Класс AbstractPlayer, GameProject

An abstract implemtation of IPlayer. This class contains all the code common to both OwnerPlayers and ProxyPlayers. This class handles any IPlayer fields that need to be synchronized by simply forwarding the gets and sets to the corresponding fields in the PlayerState.
Наследование: MonoBehaviour, IPlayer
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
Die ( string killer, int weaponID ) : void
MoveTo ( Transform location ) : void
MoveTo ( Vector3 position, Quaternion rotation ) : void
RespawnAt ( Transform location ) : void
RespawnAt ( Vector3 position, Quaternion rotation ) : void
SetState ( PlayerState, newState ) : void

Sets the PlayerState to use. We can't simply use GetComponent because when the prefab containing the implementation of this script, it initially has no parent transform, so we don't have a good way to find the PlayerState. instead, the PlayerState itself calls SetState(this) after it is done with all its instantiation.

TakeDamage ( float Damage, string DamageSource, Vector3 direction, int weaponID ) : void

Описание методов

Die() публичный абстрактный Метод

public abstract Die ( string killer, int weaponID ) : void
killer string
weaponID int
Результат void

MoveTo() публичный Метод

public MoveTo ( Transform location ) : void
location Transform
Результат void

MoveTo() публичный абстрактный Метод

public abstract MoveTo ( Vector3 position, Quaternion rotation ) : void
position Vector3
rotation Quaternion
Результат void

RespawnAt() публичный Метод

public RespawnAt ( Transform location ) : void
location Transform
Результат void

RespawnAt() публичный абстрактный Метод

public abstract RespawnAt ( Vector3 position, Quaternion rotation ) : void
position Vector3
rotation Quaternion
Результат void

SetState() публичный Метод

Sets the PlayerState to use. We can't simply use GetComponent because when the prefab containing the implementation of this script, it initially has no parent transform, so we don't have a good way to find the PlayerState. instead, the PlayerState itself calls SetState(this) after it is done with all its instantiation.
public SetState ( PlayerState, newState ) : void
newState PlayerState,
Результат void

TakeDamage() публичный абстрактный Метод

public abstract TakeDamage ( float Damage, string DamageSource, Vector3 direction, int weaponID ) : void
Damage float
DamageSource string
direction Vector3
weaponID int
Результат void