private void OnDestroy()
 {
     SpriteEffects.Explode(GetComponent <SpriteRenderer>().sprite)
     .Into(unitsSquared).Pieces()
     .At(Easily.Clone(transform.position))
     .EachPieceWeighing(pieceMass)
     .FadingOutAfter(unitFadeOutTimeInSeconds)
     //.AndDisableRotationOfPieces()
     .Rotated(transform.rotation)
     .WithForce(force);
 }
Ejemplo n.º 2
0
 /// <summary>
 /// Where in the world to explode at.
 /// </summary>
 /// <param name="position"></param>
 /// <returns></returns>
 public Exploder At(Vector3 position)
 {
     _worldPosition = Easily.Clone(position);
     return(this);
 }