C# Class ProjectStorms.ShipPartDestroy

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

Public Properties

Property Type Description
balDestForce float
balDestRumbleDurr float
balDestRumbleStr float
balloonPopNoise UnityEngine.AudioSource
bumpRumbleDurr float
bumpRumbleStr float
bumpVelThreshold float
colDirThreshold float
destructableParts ShipPart[]

Public Methods

Method 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

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

public Awake ( ) : void
return void

BreakPart() public method

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

EvaluatePartCollision() public method

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

IsPartDestroyed() public method

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

IsPartTypeDestroyed() public method

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

OnCollisionEnter() public method

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

OnTriggerEnter() public method

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

RepairAllParts() public method

Repairs all of the destructible parts on the ship.
public RepairAllParts ( ) : void
return void

RepairPart() public method

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

Start() public method

Use this for initialisation.
public Start ( ) : void
return void

Update() public method

Update is called once per frame.
public Update ( ) : void
return void

Property Details

balDestForce public_oe property

Force to explode the balloons with.
public float balDestForce
return float

balDestRumbleDurr public_oe property

How long to rumble and screenshake the balloon destruction for.
public float balDestRumbleDurr
return float

balDestRumbleStr public_oe property

Strength to rumble and screenshake the balloon destruction on.
public float balDestRumbleStr
return float

balloonPopNoise public_oe property

Trigger the component on balloon destruction
public AudioSource,UnityEngine balloonPopNoise
return UnityEngine.AudioSource

bumpRumbleDurr public_oe property

Duration of the bump rumble and screenshake.
public float bumpRumbleDurr
return float

bumpRumbleStr public_oe property

Strength of the bump rumble and screenshake.
public float bumpRumbleStr
return float

bumpVelThreshold public_oe property

Threshold for a collision to consider a bump rumble.
public float bumpVelThreshold
return float

colDirThreshold public_oe property

Cone angle for detecting directional collisions.
public float colDirThreshold
return float

destructableParts public_oe property

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