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
Mostrar archivo Open project: EECS390IndieTeam/GameProject Class Usage Examples

Public Methods

Method 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 method

public abstract Die ( string killer, int weaponID ) : void
killer string
weaponID int
return void

MoveTo() public method

public MoveTo ( Transform location ) : void
location Transform
return void

MoveTo() public abstract method

public abstract MoveTo ( Vector3 position, Quaternion rotation ) : void
position Vector3
rotation Quaternion
return void

RespawnAt() public method

public RespawnAt ( Transform location ) : void
location Transform
return void

RespawnAt() public abstract method

public abstract RespawnAt ( Vector3 position, Quaternion rotation ) : void
position Vector3
rotation Quaternion
return void

SetState() public method

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,
return void

TakeDamage() public abstract method

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