C# Class 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.
Inheritance: MonoBehaviour, IPlayer
Afficher le fichier Open project: EECS390IndieTeam/GameProject Class Usage Examples

Méthodes publiques

Méthode Description
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

Method Details

Die() public abstract méthode

public abstract Die ( string killer, int weaponID ) : void
killer string
weaponID int
Résultat void

MoveTo() public méthode

public MoveTo ( Transform location ) : void
location Transform
Résultat void

MoveTo() public abstract méthode

public abstract MoveTo ( Vector3 position, Quaternion rotation ) : void
position Vector3
rotation Quaternion
Résultat void

RespawnAt() public méthode

public RespawnAt ( Transform location ) : void
location Transform
Résultat void

RespawnAt() public abstract méthode

public abstract RespawnAt ( Vector3 position, Quaternion rotation ) : void
position Vector3
rotation Quaternion
Résultat void

SetState() public méthode

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,
Résultat void

TakeDamage() public abstract méthode

public abstract TakeDamage ( float Damage, string DamageSource, Vector3 direction, int weaponID ) : void
Damage float
DamageSource string
direction Vector3
weaponID int
Résultat void