C# Класс CatchThrowV2, goalBall

CatchThrowV2 This script controls the catching and trowing of the ball and the networked capabilities associated with those actions.
Наследование: NetworkBehaviour
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
ThrowDirection GameObject
aim GameObject
aimSpeed float
ball GameObject
maxHighAngle float
maxLeftAngle float
maxLowAngle float
maxRightAngle float
pickupDistance float
throwForce float

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

Метод Описание
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.

Приватные методы

Метод Описание
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

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

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

Changes where the player is looking based on the provided values.
public Aim ( float Horizontal, float Vertical ) : void
Horizontal float
Vertical float
Результат void

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

Throws the ball from a given player at a given position.
public ApplyForceToBall ( Vector3 Force ) : void
Force Vector3
Результат void

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

Makes the calls to Catch the ball.
public CatchBall ( ) : void
Результат void

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

Changes whos has the ball in a given game.
public ChangeBallHold ( bool held ) : void
held bool
Результат void

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

Makes the calls to charge the ball.
public ChargeBall ( ) : void
Результат void

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

Detect when the ball is dropped.
public Drop ( ) : void
Результат void

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

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
Результат void

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

Increments the value of the charging variable.
public FixedUpdate ( ) : void
Результат void

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

Resets the aim to the initial aim on a button click.
public ResetAim ( ) : void
Результат void

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

This function initializes all of the variables needed for the script.
public Start ( ) : void
Результат void

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

Makes the call to throw the ball. Differentiates calls depending on whether the player is hosing or a client.
public ThrowBall ( ) : void
Результат void

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

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
Результат void

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

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
Результат void

Описание свойств

ThrowDirection публичное свойство

public GameObject ThrowDirection
Результат GameObject

aim публичное свойство

public GameObject aim
Результат GameObject

aimSpeed публичное свойство

public float aimSpeed
Результат float

ball публичное свойство

public GameObject ball
Результат GameObject

maxHighAngle публичное свойство

public float maxHighAngle
Результат float

maxLeftAngle публичное свойство

public float maxLeftAngle
Результат float

maxLowAngle публичное свойство

public float maxLowAngle
Результат float

maxRightAngle публичное свойство

public float maxRightAngle
Результат float

pickupDistance публичное свойство

public float pickupDistance
Результат float

throwForce публичное свойство

public float throwForce
Результат float