Skip to main content

ActionItemData

A class in Root.Township, Alta.QuickAccessActions.

Settings for an item summoned from the quick access menu: what to spawn, where, and when it despawns if the player walks away.

Constructors​

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

Fields​

8 private and internal fields
MemberWhat it is
private SummonActionItemQuickAccess actionBacking field for Action, the quick access action that summons this item.
private NetworkPrefab actionItemPrefabBacking field for ActionItemPrefab, the prefab spawned for the action.
private float distanceFromPlayerBacking field for DistanceFromPlayer. Default 1.
private float maxDistanceFromPlayerSquaredBacking field for MaxDistanceFromPlayerSquared, stored squared. Default 9 (3 m).
private PositionEvent onActionItemDisappearEffectsBacking field for OnActionItemDisappearEffects, effects played where the item vanishes.
private PositionEvent onActionItemSpawnEffectsBacking field for OnActionItemSpawnEffects, effects played where the item appears.
private float outOfRangeHapticBacking field for OutOfRangeHaptic. Default 0.2.
private float timeToDespawnBacking field for TimeToDespawn. Default 4.

Properties​

MemberWhat it is
SummonActionItemQuickAccess Action { get; }The quick access action that summons this item.
NetworkPrefab ActionItemPrefab { get; }The prefab spawned.
float DistanceFromPlayer { get; }How far in front of the player it spawns.
float MaxDistanceFromPlayerSquared { get; }Squared distance from the player's head beyond which the despawn timer runs.
PositionEvent OnActionItemDisappearEffects { get; }Event with a position, for effects when the item goes.
PositionEvent OnActionItemSpawnEffects { get; }Event with a position, for effects when the item appears.
float OutOfRangeHaptic { get; }Haptic strength on both hands while the item is out of range.
float TimeToDespawn { get; }Seconds out of range before the item is destroyed. Resets when back in range.

Used in​

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