C# Class ProjectStorms.ShipPartDestroy

Manages the destruction of player ship parts, and parent mass change.
Inheritance: UnityEngine.MonoBehaviour
Afficher le fichier Open project: patferguson/Storms-Project Class Usage Examples

Méthodes publiques

Свойство Type Description
balDestForce float
balDestRumbleDurr float
balDestRumbleStr float
balloonPopNoise UnityEngine.AudioSource
bumpRumbleDurr float
bumpRumbleStr float
bumpVelThreshold float
colDirThreshold float
destructableParts ShipPart[]

Méthodes publiques

Méthode Description
Awake ( ) : void
BreakPart ( ShipPart a_part ) : void

Breaks the part, takes mass and hampers control to the ship.

EvaluatePartCollision ( Collider a_otherCol, float a_colVelSqr ) : void

Evaluates the collision with the input collider.

IsPartDestroyed ( ShipPart a_part ) : bool

Returns whether the part has been destroyed.

IsPartTypeDestroyed ( EShipPartType a_type ) : bool

Returns whether a part of the input type is still active.

OnCollisionEnter ( Collision a_colInfo ) : void

Called when a collision begins to objects.

OnTriggerEnter ( Collider a_otherCol ) : void

Called when a trigger enter begins to objects.

RepairAllParts ( ) : void

Repairs all of the destructible parts on the ship.

RepairPart ( ShipPart a_part ) : void

Re-enables the part, returns mass and thus restores control to the ship.

Start ( ) : void

Use this for initialisation.

Update ( ) : void

Update is called once per frame.

Private Methods

Méthode Description
ApplyPartCollision ( ShipPart a_part, float a_colVelSqr ) : void

Actually applies the collision to the part, shares this method with the trigger system.

ClearPartDestroyFlags ( ShipPart a_part ) : void

Clears the conditions necessary for ship destruction.

EvaluatePlayerCollision ( Collider a_otherCol, Vector3 a_velDiff, float a_colVelSqr ) : void

Evaluates the collision with the input collider.

TestShipDestroyed ( ShipPart a_part ) : void

Tests the conditions necessary for ship destruction.

Method Details

Awake() public méthode

public Awake ( ) : void
Résultat void

BreakPart() public méthode

Breaks the part, takes mass and hampers control to the ship.
public BreakPart ( ShipPart a_part ) : void
a_part ShipPart The part to test
Résultat void

EvaluatePartCollision() public méthode

Evaluates the collision with the input collider.
public EvaluatePartCollision ( Collider a_otherCol, float a_colVelSqr ) : void
a_otherCol UnityEngine.Collider
a_colVelSqr float Squared relative collision velocity magnitude.
Résultat void

IsPartDestroyed() public méthode

Returns whether the part has been destroyed.
public IsPartDestroyed ( ShipPart a_part ) : bool
a_part ShipPart The part to test
Résultat bool

IsPartTypeDestroyed() public méthode

Returns whether a part of the input type is still active.
public IsPartTypeDestroyed ( EShipPartType a_type ) : bool
a_type EShipPartType Ship part type.
Résultat bool

OnCollisionEnter() public méthode

Called when a collision begins to objects.
public OnCollisionEnter ( Collision a_colInfo ) : void
a_colInfo UnityEngine.Collision Collision information.
Résultat void

OnTriggerEnter() public méthode

Called when a trigger enter begins to objects.
public OnTriggerEnter ( Collider a_otherCol ) : void
a_otherCol UnityEngine.Collider Other collider.
Résultat void

RepairAllParts() public méthode

Repairs all of the destructible parts on the ship.
public RepairAllParts ( ) : void
Résultat void

RepairPart() public méthode

Re-enables the part, returns mass and thus restores control to the ship.
public RepairPart ( ShipPart a_part ) : void
a_part ShipPart The part to test
Résultat void

Start() public méthode

Use this for initialisation.
public Start ( ) : void
Résultat void

Update() public méthode

Update is called once per frame.
public Update ( ) : void
Résultat void

Property Details

balDestForce public_oe property

Force to explode the balloons with.
public float balDestForce
Résultat float

balDestRumbleDurr public_oe property

How long to rumble and screenshake the balloon destruction for.
public float balDestRumbleDurr
Résultat float

balDestRumbleStr public_oe property

Strength to rumble and screenshake the balloon destruction on.
public float balDestRumbleStr
Résultat float

balloonPopNoise public_oe property

Trigger the component on balloon destruction
public AudioSource,UnityEngine balloonPopNoise
Résultat UnityEngine.AudioSource

bumpRumbleDurr public_oe property

Duration of the bump rumble and screenshake.
public float bumpRumbleDurr
Résultat float

bumpRumbleStr public_oe property

Strength of the bump rumble and screenshake.
public float bumpRumbleStr
Résultat float

bumpVelThreshold public_oe property

Threshold for a collision to consider a bump rumble.
public float bumpVelThreshold
Résultat float

colDirThreshold public_oe property

Cone angle for detecting directional collisions.
public float colDirThreshold
Résultat float

destructableParts public_oe property

The parts of this ship that have children colliders and can be destroyed.
public ShipPart[] destructableParts
Résultat ShipPart[]