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.
- Listed in Crafting and making
- Inherits or implements
GlobalSettings<GenericCraftingSettings> - Derived types
GenericCraftingSettings - Attributes
CreateAssetMenu,GlobalSettings
Constructors
| Member | What it is |
|---|---|
GenericCraftingSettings() | Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets. |
Fields
20 private and internal fields
| Member | What it is |
|---|---|
private PooledObjectDefinition androidDestroyedPieceEffect | Pooled effect for a destroyed piece on Android. |
private PooledObjectDefinition androidPieceCompletedAnimation | Pooled piece-completed animation on Android. |
private TransformEvent completedProjectEffect | Effect played at a transform when a crafting project completes. |
private PooledObjectDefinition destroyedPieceEffect | Pooled effect for a destroyed piece. |
private PooledObjectDefinition genericNailDefaultDefinition | Pooled object used for the default generic nail. |
private PooledObjectDefinition genericPieceDefinition | Pooled object used for generic crafting pieces. |
private float maxDistanceToAnimateSquared | Squared distance limit for animating pieces (default 0.25). |
private TransformEvent nailBadHitEffect | Effect for a bad nail hit. |
private TransformEvent nailBaseHitEffect | Effect for a normal nail hit. |
private TransformEvent nailDoneEffect | Effect for a nail driven all the way in. |
private TransformEvent nailGoodHitEffect | Effect for a good nail hit. |
private PositionEvent onPieceCompletedEffect | Effect played at a position when a piece completes. |
private PositionEvent onPieceDestroyEffect | Effect played at a position when a piece is destroyed. |
private PositionEvent onPiecePopEffect | Effect played at a position when a piece pops. |
private PooledObjectDefinition pieceCompletedAnimation | Pooled piece-completed animation. |
private Material pieceMaterialDisabled | Ghost material for a piece that cannot be placed yet. |
private Material pieceMaterialEnabled | Ghost material for a piece that can be placed. |
private Material pieceMaterialHighlight | Highlighted ghost material for a piece. |
private float timeBeforeSound | Seconds left when the time-ending sound plays (default 5). |
private PositionEvent timeEndingSound | Sound played at a position as crafting time runs out. |
Properties
| Member | What 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
| Member | What 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. |