Skip to main content

PickupDockVisualSettings

A class in Root.Township, Alta.Inventory.

ScriptableObject with how dock bubbles look: materials by distance, colours for whether a held item fits, and hover and fade settings. Client side, used by DockVisual.

Constructors​

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

Fields​

23 private and internal fields
MemberWhat it is
private readonly int _ColorShader property ID for the colour.
private readonly int _EdgePowerShader property ID for the edge power.
private readonly int _GlossinessShader property ID for smoothness.
private readonly int _MaximumAlphaShader property ID for the maximum alpha.
private AnimationCurve alphaMultiplierHeadDistanceCurve from head distance to alpha multiplier.
private Material androidMaterialBacking field for AndroidMaterial.
private Color badColorColour blended in when a held item can't go in the dock.
private Material closeMaterialMaterial used within maximumEvaluationDistance of the head.
private Color defaultColorBacking field for DefaultColor.
private static Dictionary<PickupDockVisualSettings, Material> defaultSharedMaterialsOne shared far material per settings asset, created on first use.
private float dockedAlphaMultiplierAlpha and smoothness multiplier when the dock already holds something.
private Material farMaterialTemplate for the shared material used beyond the evaluation distance.
private Color goodColorColour blended in when a held item fits the dock.
private float hoverEdgePowerEdge power while the dock is hovered.
private float hoverPulseSpeedBacking field for HoverPulseSpeed.
private float hoverScaleBacking field for HoverScale.
private float lerpSpeedHow fast the shader values ease towards their targets.
private float maximumAlphaHighest bubble alpha (default 0.7).
private float maximumEvaluationDistanceHead distance within which bubbles are fully evaluated (default 10).
private float maximumSmoothnessHighest bubble smoothness (default 0.8).
private float normalEdgePowerEdge power when not hovered.
private MaterialPropertyBlock propertyBlockReused property block for the near-player shader values.
private AnimationCurve weightHandDistanceCurve from hand-to-dock distance to how much that hand's item affects the colour.

Properties​

MemberWhat it is
Material AndroidMaterial { get; }Material used for dock bubbles on Android.
Color DefaultColor { get; }Bubble colour when nothing relevant is held.
float HoverPulseSpeed { get; }Speed of the pulse while a dock is hovered.
float HoverScale { get; }Scale of the bubble while hovered (default 1.2).

Methods​

MemberWhat it is
void Evaluate(DockVisual dockVisual, Renderer renderer, Vector3 headPosition)Switches the bubble between the close and far material by head distance and, when close, updates its colour and alpha.
void EvaluateAndroid(DockVisual dockVisual, Vector3 headPosition)Android version: just turns the bubble on near the head and off far away.
1 private and internal method
MemberWhat it is
private void EvaluateNearPlayer(PickupDock dock, Renderer renderer)Tints the bubble good or bad by whether the local player's held items fit, fades it by head distance and eases the shader values.

Used in​

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