Skip to main content

PlayerMessageDisplay

A class in Root.Township, the global namespace.

Client text shown in front of the player's view, such as login errors. Messages queue and fade in and out.

Constructors​

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

Fields​

8 private and internal fields
MemberWhat it is
private TextRenderer androidOnScreenTextAndroid text renderer; not used by this code.
private static Logger loggerNLog logger; logs each message shown.
private AltaCoroutine messageDisplayCoroutineThe running queue coroutine.
private List<DisplayMessage> messageQueueMessages waiting; the first is the one shown. Capped at about 1000.
private Text onScreenTextUI text that shows the message.
private PlayerController playerControllerThe owning player controller.
private Vector3 positionFromHeadOffset from the head; not used by this code.
private Quaternion rotationFromHeadRotation from the head; not used by this code.

Properties​

1 private and internal property
MemberWhat it is
private int IBuildRendererBakeable.SortingOrder { get; }Always 0.

Methods​

MemberWhat it is
void Bake(bool isSaving)Empty build step.
void Display(string message, float duration = 2, DisplayMessageType type = 2)Shows a message. By default it replaces the current one; it can also queue or go next.
void Display(DisplayMessage message, DisplayMessageType type = 2)Shows a message. By default it replaces the current one; it can also queue or go next.
6 private and internal methods
MemberWhat it is
private void IBuildRendererBakeable.Clean()Empty.
private IEnumerator DisplayMessageQueue() (iterator)Coroutine: shows each queued message with its fade in, duration and fade out, then hides the text.
private IEnumerator DisplayTextDelayedCoroutine(float time, string message, float textFadeOutDuration = 5) (iterator)Coroutine: after a delay, shows text and fades it out. Nothing in this code starts it.
private void OnDestroy()Unhooks the login failure event.
private void OnLoginAttemptFailed(string message)Shows the failed login message in red.
private void Start()Hooks LoginManager.LoginAttemptFailed.

Used in​

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