Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Runtime/Scripts/Fracture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,10 @@ private GameObject CreateFragmentTemplate()
obj.name = "Fragment";
obj.tag = this.tag;

if (fractureOptions.shouldInheritLayer)
{
obj.layer = gameObject.layer;
}
// Update mesh to the new sliced mesh
obj.AddComponent<MeshFilter>();

Expand Down
5 changes: 4 additions & 1 deletion Runtime/Scripts/Options/FractureOptions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ public class FractureOptions

[Tooltip("The material to use for the inside faces")]
public Material insideMaterial;

[Tooltip("Scale factor to apply to texture coordinates")]
public Vector2 textureScale;

[Tooltip("Offset to apply to texture coordinates")]
public Vector2 textureOffset;

[Tooltip("Inherits the layer of the original gameobject")]
public bool shouldInheritLayer;
public FractureOptions()
{
this.fragmentCount = 10;
Expand All @@ -46,5 +48,6 @@ public FractureOptions()
this.insideMaterial = null;
this.textureScale = Vector2.one;
this.textureOffset = Vector2.zero;
this.shouldInheritLayer = true;
}
}