C# Class Explodable, Unity-2D-Destruction

Inheritance: MonoBehaviour
Show file Open project: mjholtzem/Unity-2D-Destruction Class Usage Examples

Public Properties

Property Type Description
OnFragmentsGenerated System.Action>
allowRuntimeFragmentation bool
extraPoints int
fragmentLayer string
fragments List
orderInLayer int
shatterType ShatterType
sortingLayerName string
subshatterSteps int

Public Methods

Method Description
OnDrawGizmos ( ) : void
deleteFragments ( ) : void
explode ( ) : void

Creates fragments if necessary and destroys original gameobject

fragmentInEditor ( ) : void

Creates fragments and then disables them

Private Methods

Method Description
generateFragments ( ) : void

Turns Gameobject into multiple fragments

rotateAroundPivot ( Vector2 point, Vector2 pivot, Quaternion angle ) : Vector2
setPolygonsForDrawing ( ) : void

Method Details

OnDrawGizmos() public method

public OnDrawGizmos ( ) : void
return void

deleteFragments() public method

public deleteFragments ( ) : void
return void

explode() public method

Creates fragments if necessary and destroys original gameobject
public explode ( ) : void
return void

fragmentInEditor() public method

Creates fragments and then disables them
public fragmentInEditor ( ) : void
return void

Property Details

OnFragmentsGenerated public property

public System.Action> OnFragmentsGenerated
return System.Action>

allowRuntimeFragmentation public property

public bool allowRuntimeFragmentation
return bool

extraPoints public property

public int extraPoints
return int

fragmentLayer public property

public string fragmentLayer
return string

fragments public property

public List fragments
return List

orderInLayer public property

public int orderInLayer
return int

shatterType public property

public ShatterType shatterType
return ShatterType

sortingLayerName public property

public string sortingLayerName
return string

subshatterSteps public property

public int subshatterSteps
return int