Skip to main content

EventOrb

A class in Root.Township, ATT.MainMenu.Scripts.

A menu orb that runs a set action when the player lets go of it in a valid place. Wraps an ActionOrb.

Constructors​

MemberWhat it is
EventOrb()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

6 private and internal fields
MemberWhat it is
private ActionOrb actionOrbThe ActionOrb the player grabs and releases.
private bool isInteractionOnServerWhen true, clients may pick the orb up without a release action because the server handles it.
private static readonly Logger loggerNLog logger for this class.
private Action onReleaseActionAction run when the orb is released. Set with SetReleaseAction.
private PlayerCharacter playerCharacterPlayer character field. Not used in this class's code.
private Transform selectionOrbPositionTransform the action orb is set to return to.

Properties​

MemberWhat it is
ActionOrb ActionOrb { get; }The orb pickup and its target.

Methods​

MemberWhat it is
void ClearReleaseAction()Removes the release action and force drops the orb.
void SetReleaseAction(Action action)Sets what runs when the orb is let go.
protected virtual void Awake()Hooks the orb's let go and grab filter, and sets its home position.
protected virtual void ValidatePickupInteraction(Interactor interactor, Interactable interactable, ref bool result)Blocks grabbing when no release action is set, except on a client when isInteractionOnServer is set.
2 private and internal methods
MemberWhat it is
private bool HasInteractionException()True on a client when isInteractionOnServer is set, so the orb can be grabbed without a local release action.
private void OnValidLetGo()Runs the release action when the orb is let go in a valid way, or logs an error if none is set.

Used in​

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