DoopelPonger
Public Member Functions | Public Attributes | List of all members
CoopMiniCannons Class Reference

The mini cannons are two cannons that shoot good balls out of the center of the player. The two cannons are fired at the same time. More...

Inheritance diagram for CoopMiniCannons:
Inheritance graph
[legend]
Collaboration diagram for CoopMiniCannons:
Collaboration graph
[legend]

Public Member Functions

void Awake ()
 Initialize the references needed by the cannons. More...
 
void Init ()
 Initialize the variables in the cannon. More...
 
bool IsReadyToFire ()
 
void FireAnimation ()
 Tell the animator to play the animation for firing the bullets. More...
 
void FinishedSpawnAnimation ()
 Callback from the Unity Animator once the cannons are fully spawned. More...
 
void DespawnCannons (System.Action animationFinishedDelegate)
 Start the despawn animation of the cannons. More...
 
void FinishedDespawnAnimation ()
 Callback from the Unity Animator once the cannons are fully despawned. More...
 
void FixedUpdate ()
 Update the scale of the cannons to match the desired scale. More...
 
Vector3 GetRotation ()
 

Public Attributes

Transform [] spawnPositions
 
Vector3 ballRotation
 
float ballRotationDelta
 
Vector2 desiredScale
 

Detailed Description

The mini cannons are two cannons that shoot good balls out of the center of the player. The two cannons are fired at the same time.

Member Function Documentation

◆ Awake()

void CoopMiniCannons.Awake ( )

Initialize the references needed by the cannons.

◆ DespawnCannons()

void CoopMiniCannons.DespawnCannons ( System.Action  animationFinishedDelegate)

Start the despawn animation of the cannons.

Parameters
animationFinishedDelegateFunction to call once the cannons are finished despawning.

◆ FinishedDespawnAnimation()

void CoopMiniCannons.FinishedDespawnAnimation ( )

Callback from the Unity Animator once the cannons are fully despawned.

◆ FinishedSpawnAnimation()

void CoopMiniCannons.FinishedSpawnAnimation ( )

Callback from the Unity Animator once the cannons are fully spawned.

◆ FireAnimation()

void CoopMiniCannons.FireAnimation ( )

Tell the animator to play the animation for firing the bullets.

◆ FixedUpdate()

void CoopMiniCannons.FixedUpdate ( )

Update the scale of the cannons to match the desired scale.

◆ GetRotation()

Vector3 CoopMiniCannons.GetRotation ( )
Returns
The rotation the bullet use when fired. The rotation will have a small amount of jitter to it so the bullets won't fire in a straight line.

◆ Init()

void CoopMiniCannons.Init ( )

Initialize the variables in the cannon.

◆ IsReadyToFire()

bool CoopMiniCannons.IsReadyToFire ( )
Returns
True when the spawn animation of the cannons is finished and the cannons can start firing.

Member Data Documentation

◆ ballRotation

Vector3 CoopMiniCannons.ballRotation

The direction the balls should fire.

◆ ballRotationDelta

float CoopMiniCannons.ballRotationDelta

A small amount of variation of the balls fired is added to make a small amount of spread.

◆ desiredScale

Vector2 CoopMiniCannons.desiredScale

The size of the cannons once they are children of the player. The cannons were design before it was decided to make the player the parent of the cannons, so that scales end up being weird if they are not adjusted.

◆ spawnPositions

Transform [] CoopMiniCannons.spawnPositions

The position the bullets should spawn at.


The documentation for this class was generated from the following file: