Skip to main content

GenericCraftingSettings

A class in Root.Township, Alta.Crafting.

Global settings for generic crafting (building from ghost pieces and nailing them): piece and nail prefabs, ghost materials and effects. All members are static shortcuts to GenericCraftingSettings.Instance.

Constructors​

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

Fields​

20 private and internal fields
MemberWhat it is
private PooledObjectDefinition androidDestroyedPieceEffectPooled effect for a destroyed piece on Android.
private PooledObjectDefinition androidPieceCompletedAnimationPooled piece-completed animation on Android.
private TransformEvent completedProjectEffectEffect played at a transform when a crafting project completes.
private PooledObjectDefinition destroyedPieceEffectPooled effect for a destroyed piece.
private PooledObjectDefinition genericNailDefaultDefinitionPooled object used for the default generic nail.
private PooledObjectDefinition genericPieceDefinitionPooled object used for generic crafting pieces.
private float maxDistanceToAnimateSquaredSquared distance limit for animating pieces (default 0.25).
private TransformEvent nailBadHitEffectEffect for a bad nail hit.
private TransformEvent nailBaseHitEffectEffect for a normal nail hit.
private TransformEvent nailDoneEffectEffect for a nail driven all the way in.
private TransformEvent nailGoodHitEffectEffect for a good nail hit.
private PositionEvent onPieceCompletedEffectEffect played at a position when a piece completes.
private PositionEvent onPieceDestroyEffectEffect played at a position when a piece is destroyed.
private PositionEvent onPiecePopEffectEffect played at a position when a piece pops.
private PooledObjectDefinition pieceCompletedAnimationPooled piece-completed animation.
private Material pieceMaterialDisabledGhost material for a piece that cannot be placed yet.
private Material pieceMaterialEnabledGhost material for a piece that can be placed.
private Material pieceMaterialHighlightHighlighted ghost material for a piece.
private float timeBeforeSoundSeconds left when the time-ending sound plays (default 5).
private PositionEvent timeEndingSoundSound played at a position as crafting time runs out.

Properties​

MemberWhat it is
static TransformEvent CompletedProjectEffect { get; }Effect played when a whole crafting project is completed.
static PooledObjectDefinition DestroyedPieceEffect { get; }Pooled effect for a destroyed piece.
static PooledObjectDefinition GenericNailDefaultDefinition { get; }Pooled nail prefab used when a piece's nail settings don't name one.
static PooledObjectDefinition GenericPieceDefinition { get; }Pooled prefab for a generic crafting piece.
static float MaxDistanceToAnimateSquared { get; }Squared distance within which pieces animate.
static PositionEvent OnPieceCompletedEffect { get; }Effect played at a position when a piece is completed.
static PositionEvent OnPieceDestroyEffect { get; }Effect played at a position when a piece is destroyed.
static PositionEvent OnPiecePopEffect { get; }Effect played at a position when a piece pops.
static PooledObjectDefinition PieceCompletedAnimation { get; }Pooled animation for a completed piece.
static Material PieceMaterialDisabled { get; }Ghost material for a piece that can't be placed yet.
static Material PieceMaterialEnabled { get; }Ghost material for a piece that can be placed.
static Material PieceMaterialHighlight { get; }Highlighted ghost material for a piece.
static float TimeBeforeSound { get; }Seconds left when the time running out sound plays, 5 by default.

Methods​

MemberWhat it is
static void GetNailEffect(Transform transform, NailHitquality hitquality)Plays the nail effect for a hit quality (base, good, bad or done) at a transform.
static Material GetPieceMaterial(bool isEnabled)The ghost material for an enabled or a disabled piece.
static void PlayTimeEndingSound(Vector3 position)Plays the time running out sound at a position.