Hyper Light Studios
v1.0.1Unity 2021.3+Last updated: Feb 2026

API Reference

28. API Reference

PileGenGenerator (MonoBehaviour)

// Main component — attach to a GameObject
public PileProfile profile;          // Pile profile asset
public ShapePreset quickPreset;      // Quick single-shape mode (no profile needed)
public int seed;                     // Random seed
public int countOverride;            // 0 = use profile default
public float countMultiplier;        // Scale piece count (0.1–10)
public float scaleMultiplier;        // Scale piece sizes (0.1–5)
public bool scaleCountWithRadius;    // Reduce count proportionally with radius
public float radiusOverride;         // Override radius (-1 = use profile)
public Vector2 rectSizeOverride;     // Override rect footprint size
public float maxHeight;              // Maximum pile height
public bool livePreview;             // Auto-regenerate on changes (editor only)
public bool autoSettle;              // Auto-generate AND settle on any change
public bool allowRuntimeGeneration;  // Allow generation during play mode
public bool usePlacementOverrides;   // Use per-generator placement rules
public PlacementRules placementOverrides; // Per-generator placement settings
public BakeOptions bakeOptions;      // Bake settings

// Methods
public void Generate();             // Generate the pile
public void Clear();                // Remove all pieces
public void Settle();               // Run physics settling
public void Bake();                 // Bake with current options
public void RandomizeSeed();        // Random seed + regenerate
public void RebuildColliders();     // Strip and reapply colliders per shape settings

// Properties
public float Radius { get; }        // Effective radius
public Vector2 RectSize { get; }    // Effective rectangle size
public PlacementRules EffectivePlacementRules { get; }

PileProfile (ScriptableObject)

public string pileName;                   // Display name
public bool usePolyArtShading;            // Shading mode toggle
public Material materialOverride;         // Standard fallback
public Shading.LowPolyStyle defaultStyle; // Biome fallback
public ShapeRule[] shapeRules;            // Shape definitions
public List<LayerRule> layers;            // Layer list
public PlacementRules placementRules;
public AnimationCurve densityCurve;
public AnimationCurve heightCurve;
public AnimationCurve scaleCurve;

public int LayerCount { get; }
public int TotalObjectCount { get; }
public LayerRule GetLayer(int index);

ShapeRule (Serializable)

public PrimitiveType basePrimitive;       // Cube, Sphere, Extrude, Rock, etc.
public Vector3 sizeMin;                   // Minimum dimensions
public Vector3 sizeMax;                   // Maximum dimensions
public bool uniformScale;                 // Scale XYZ together
public float pivotYOffset;                // Vertical pivot shift
public DeformationSettings deformation;   // Vertex noise, bevel, chip, etc.
public List<ShapeModifier> modifiers;     // Scatter, Array, etc.
public bool flatBias;                     // Stay mostly upright
public bool stackable;                    // Can stack on others
public Material material;                 // Standard override
public Shading.LowPolyStyle biome;        // Biome override
public float weight;                      // Selection probability weight
public ColliderMode colliderMode;         // None, Box, ConvexMesh, ConcaveMesh
public float arcDegrees;                  // Arc angle for cylindrical shapes

LayerRule (Serializable)

public string layerName;
public int count;                    // Pieces in this layer
public Vector2 scaleMultiplier;      // Min/max scale range
public float rotationVariance;       // Random rotation amount
public float verticalJitter;         // Random Y offset
public float surfaceAlignment;       // Align to ground normal
public int[] allowedShapeIndices;    // Which shapes (empty = all)

PileGen v1.0.0 — Made by HyperLightStudios