Skip to main content

BoulderDefinition

A class in Root.Township, Alta.Impact.

An asset describing a mineable rock: its health, what it drops, how its hits look, and its ore material. Used by Rock.

Constructors​

MemberWhat it is
BoulderDefinition()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

6 private and internal fields
MemberWhat it is
private PooledObjectDefinition destroyedEffectPooled effect a Rock plays (client only) when it breaks.
private AnimationCurve dropCountCurve from a random 0 to 1 roll to how many resources drop. Defaults to 0 to 4.
private int healthHit points of the boulder (0 to 1024).
private ImpactDetectorSettings impactSettingsImpact detector settings for the boulder.
private Material oreMaterialMaterial put on the rock's ore renderers.
private ResourceDropChance[] resourcesDropChancesThe resources the boulder can drop, with their chances.

Properties​

MemberWhat it is
PooledObjectDefinition DestroyedEffect { get; }Pooled effect spawned when the rock is destroyed. Not on headless servers.
AnimationCurve DropCount { get; }Curve sampled at a random value to get how many resources drop.
int Health { get; }How much damage the rock takes before breaking.
ImpactDetectorSettings ImpactSettings { get; }Impact effects and sounds for hits on the rock.
Material OreMaterial { get; }Material put on the rock's ore renderers.
ResourceDropChance[] ResourcesDropChances { get; }Which resources can drop and how likely each is.

Used in​

Members of other types that take, return or hold a BoulderDefinition: