Pyro / CollisionState

Namespace Playniax.Pyro

Inherits from CollisionBase2D

Script can be found in Assets/Playniax/Framework/Pyro/Scripts (MonoBehaviour)/Collisions 2D/CollisionState.cs

Class CollisionState

Description

Collision properties.

Public fieldsDescription
bool autoPoints = trueDetermines if points are automatically set by multiplying structuralIntegrity by 10 (default value 10 can be changed by setting 'autoPointsMultiplier')
int playerIndex = -1Determines what player is rewarded.

-1 does nothing but anything above -1 adds the points of an object destroyed to the player the index is set to.

For example if playerIndex = 0 the points will be rewarded to player 1. playerIndex = 1 and the points will be rewarded to player 2 etc.

To get the points you can do something like: PlayerData.Get(0).score
OutroSettings outroSettings = new OutroSettings()Outro Settings.
CargoSettings cargoSettings = new CargoSettings()Cargo Settings.
EventSettings eventSettings = new EventSettings()Event Settings.
SpriteRenderer spriteRendererSpriteRenderer to use.
bool generateBoxCollider = trueDetermines if a BoxCollider should be created automatically when a collider is missing.

Class CollisionState.CargoSettings

Description

Cargo is released when an object is destroyed.

Public fieldsDescription
GameObject[] prefab = new GameObject[0]The list of cargo objects.
float scale = 1Determines the scale of cargo objects.

Class CollisionState.EventSettings

Description

Outro Settings determine what effect to play when an object is destroyed.

Class CollisionState.OutroSettings

Description

Outro Settings determine what effect to play when an object is destroyed.

Public fieldsDescription
string emitterId = "Explosion Red"Determines what emitter to call.
float emitterScale = 1Determines to emitter scale.
MessengerSettings messengerSettings = new MessengerSettings()Messenger Settings.
AudioProperties audioSettings = new AudioProperties()Audio Settings.
bool enabled = trueDetermines if outro is used.

Class CollisionState.MessengerSettings

Description

Messenger Settings determine what messenger to use and if text or rewards are to be displayed.

Public fieldsDescription
string messengerId = "Score"Determines what messenger to use.
string textDisplay text.

Displays score points when left blank.
bool enabled = trueDetermines if messages are enabled or not.