Skip to main content

ShowNames

A class in Root.Township, Alta.QuickAccessActions.

Client: the quick access action that shows name boards above nearby players and player proxies. Names hide after a few seconds unless the player names toggle setting is on.

Constructors​

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

Fields​

9 private and internal fields
MemberWhat it is
private Dictionary<NetworkEntity, ShowNames.NameBoardHandler> activeNamesName board handlers by player entity.
private float delayToActivateNameDelay before a newly in-range player's name appears.
private Timeline.IEntry entryTimeline entry that hides the names.
private float fadeAfterSeconds names stay before hiding.
private bool isActiveBacking field for IsActive.
private bool isInstantSet during the first update so names shown at activation skip the delay.
private float maxDistanceToShowNamesSquaredSquared distance within which names show.
private NameBoardsSettings nameBoardSettingsGlobal name board settings, fetched on activation.
private IUnityUpdateMethod updateHandle for the registered update.

Properties​

MemberWhat it is
override bool IsActive { get; }Whether names are showing.
override bool IsValid { get; }False while the local player is downed.

Methods​

MemberWhat it is
void DeathRun()Shows names without a timer while the local player is dead; they hide when the player entity goes.
override void Run(Controller controller)Toggles names on or off from the quick access menu.
5 private and internal methods
MemberWhat it is
private void Activate(bool isUsingTimer)Shows names now and keeps them updated, and starts the hide timer if asked and the toggle setting is off.
private void ClearPlayer(NetworkEntity entity, bool isUnload)Removes the name board for one player.
private void Deactivate()Removes every name board and stops updating.
private void DeactivateNames(NetworkEntity entity, bool isUnload)Hides names when the local player's entity is destroyed.
private void Update()Adds, moves or removes name boards by each player's distance and whether they show their name.

Used in​

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