public class ShatteredObjectGenerator
Inherits MonoBehaviour
Behaviour to procedurally generate shards/pieces of an object
Fields
public string Name
[SkipSerialisation]
No description provided
public float PartMass
[SkipSerialisation]
The mass of each part
public Sprite Sprite
[SkipSerialisation]
The sprite that the parts should be based on
public int PartCount
[SkipSerialisation]
The amount of parts to generate
public float PartSizeRatio
[SkipSerialisation]
The completeness of each piece. Set to 0, the pieces will be invisible.
Set to 1, all the pieces combined will form the original shape.
Set to 0.5, half the shape is missing when even all pieces are combined.
public int PartsLayer
[SkipSerialisation]
[NaughtyAttributes.Layer]
What layer to put the object on
public PhysicalProperties PartsPhysicalProperties
[SkipSerialisation]
The PhysicalProperties
to assign to each part
public float RandomForceIntensity
[SkipSerialisation]
Amount of random force added to each part
public float RandomTorqueIntensity
[SkipSerialisation]
Amount of random rotation added to each part
public float GenerateSoftJointsChance
[SkipSerialisation]
Whether or not to generate soft joints between bodies
public bool GenerateOnStart
No description provided
public Rigidbody2D ConnectTo
No description provided
public float ConnectToRange
No description provided
public Vector2 SoftJointStrengthRange
No description provided
public float Brightness
[SkipSerialisation]
[System.NonSerialized]
No description provided
Methods
public void Start()
No description provided
public int Generate(Transform toReplace, Rigidbody2D source = null, GameObject[] creationBuffer = null)
No description provided