C# Class Explodable, Unity-2D-Destruction

Inheritance: MonoBehaviour
显示文件 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_oe property

public System.Action> OnFragmentsGenerated
return System.Action>

allowRuntimeFragmentation public_oe property

public bool allowRuntimeFragmentation
return bool

extraPoints public_oe property

public int extraPoints
return int

fragmentLayer public_oe property

public string fragmentLayer
return string

fragments public_oe property

public List fragments
return List

orderInLayer public_oe property

public int orderInLayer
return int

shatterType public_oe property

public ShatterType shatterType
return ShatterType

sortingLayerName public_oe property

public string sortingLayerName
return string

subshatterSteps public_oe property

public int subshatterSteps
return int