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
| Member | What it is |
|---|
EventOrb() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
6 private and internal fields
| Member | What it is |
|---|
private ActionOrb actionOrb | The ActionOrb the player grabs and releases. |
private bool isInteractionOnServer | When true, clients may pick the orb up without a release action because the server handles it. |
private static readonly Logger logger | NLog logger for this class. |
private Action onReleaseAction | Action run when the orb is released. Set with SetReleaseAction. |
private PlayerCharacter playerCharacter | Player character field. Not used in this class's code. |
private Transform selectionOrbPosition | Transform the action orb is set to return to. |
Properties
Methods
| Member | What 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
| Member | What 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: