C# Class CatchThrowV2, goalBall

CatchThrowV2 This script controls the catching and trowing of the ball and the networked capabilities associated with those actions.
Inheritance: NetworkBehaviour
Exibir arquivo Open project: DrexelGoalBall/goalBall Class Usage Examples

Public Properties

Property Type Description
ThrowDirection GameObject
aim GameObject
aimSpeed float
ball GameObject
maxHighAngle float
maxLeftAngle float
maxLowAngle float
maxRightAngle float
pickupDistance float
throwForce float

Public Methods

Method Description
Aim ( float Horizontal, float Vertical ) : void

Changes where the player is looking based on the provided values.

ApplyForceToBall ( Vector3 Force ) : void

Throws the ball from a given player at a given position.

CatchBall ( ) : void

Makes the calls to Catch the ball.

ChangeBallHold ( bool held ) : void

Changes whos has the ball in a given game.

ChargeBall ( ) : void

Makes the calls to charge the ball.

Drop ( ) : void

Detect when the ball is dropped.

FPSAim ( float xAim, float yAim ) : void

Classic first person shooter aiming that allows the palyers to look around and not have their view reset to the origonal position.

FixedUpdate ( ) : void

Increments the value of the charging variable.

ResetAim ( ) : void

Resets the aim to the initial aim on a button click.

Start ( ) : void

This function initializes all of the variables needed for the script.

ThrowBall ( ) : void

Makes the call to throw the ball. Differentiates calls depending on whether the player is hosing or a client.

Update ( ) : void

Detects the distance between the player and the ball and determines if the player is in range to pick up the ball. DEBUGGING: can be used to change the player controls when the M key is pressed.

stiffAim ( float xAim, float yAim ) : void

Stiff aim is when the player uses the control stick to change the direction of the ball from the center of their initial view. When the control stick is released the aim will center.

Private Methods

Method Description
CmdBallPickup ( bool held ) : void
CmdBallThrow ( Vector3 pForce ) : void
DropIfHolding ( bool drop ) : void

If the player is holding the ball and it needs to be dropped it will drop it.

TransmitBallPickup ( bool held ) : void
TransmitBallThrow ( Vector3 pForce ) : void
delayControl ( ) : bool

Delays the control to prevent multiple messages being sent to the server too quickly

Method Details

Aim() public method

Changes where the player is looking based on the provided values.
public Aim ( float Horizontal, float Vertical ) : void
Horizontal float
Vertical float
return void

ApplyForceToBall() public method

Throws the ball from a given player at a given position.
public ApplyForceToBall ( Vector3 Force ) : void
Force Vector3
return void

CatchBall() public method

Makes the calls to Catch the ball.
public CatchBall ( ) : void
return void

ChangeBallHold() public method

Changes whos has the ball in a given game.
public ChangeBallHold ( bool held ) : void
held bool
return void

ChargeBall() public method

Makes the calls to charge the ball.
public ChargeBall ( ) : void
return void

Drop() public method

Detect when the ball is dropped.
public Drop ( ) : void
return void

FPSAim() public method

Classic first person shooter aiming that allows the palyers to look around and not have their view reset to the origonal position.
public FPSAim ( float xAim, float yAim ) : void
xAim float
yAim float
return void

FixedUpdate() public method

Increments the value of the charging variable.
public FixedUpdate ( ) : void
return void

ResetAim() public method

Resets the aim to the initial aim on a button click.
public ResetAim ( ) : void
return void

Start() public method

This function initializes all of the variables needed for the script.
public Start ( ) : void
return void

ThrowBall() public method

Makes the call to throw the ball. Differentiates calls depending on whether the player is hosing or a client.
public ThrowBall ( ) : void
return void

Update() public method

Detects the distance between the player and the ball and determines if the player is in range to pick up the ball. DEBUGGING: can be used to change the player controls when the M key is pressed.
public Update ( ) : void
return void

stiffAim() public method

Stiff aim is when the player uses the control stick to change the direction of the ball from the center of their initial view. When the control stick is released the aim will center.
public stiffAim ( float xAim, float yAim ) : void
xAim float
yAim float
return void

Property Details

ThrowDirection public_oe property

public GameObject ThrowDirection
return GameObject

aim public_oe property

public GameObject aim
return GameObject

aimSpeed public_oe property

public float aimSpeed
return float

ball public_oe property

public GameObject ball
return GameObject

maxHighAngle public_oe property

public float maxHighAngle
return float

maxLeftAngle public_oe property

public float maxLeftAngle
return float

maxLowAngle public_oe property

public float maxLowAngle
return float

maxRightAngle public_oe property

public float maxRightAngle
return float

pickupDistance public_oe property

public float pickupDistance
return float

throwForce public_oe property

public float throwForce
return float