FloatingText Class

Summary

A Weaver.PoolableBehaviour`1 which manages a text object in the scene. This base class is a facade to allow implementations such as Weaver.Examples.FloatingTextUnity to use any text system.
Assembly
Weaver.dll
Namespace
Weaver.Examples
Interfaces
Base Types
Derived Types
graph BT Type-->Base0["PoolableBehaviour<FloatingText>"] Base0-->Base1["MonoBehaviour"] Type-.->Interface0["IPoolable"] click Interface0 "/weaver/api/Weaver/IPoolable" Type["FloatingText"] class Type type-node Derived0["FloatingTextUnity"]-->Type click Derived0 "/weaver/api/Weaver.Examples/FloatingTextUnity"

Syntax

public abstract class FloatingText : PoolableBehaviour<FloatingText>, IPoolable

Properties

Name Value Summary
Color Color
The UnityEngine.Color of the text.
LifeTime float
The amount of time (in seconds) which this text will be shown for.
Manager BillboardManager
The Weaver.Examples.BillboardManager that controls the rotation of this text. Usually that means keeping it facing the camera.
Progress float
The Weaver.Examples.FloatingText.Timer rescaled to between 0-1 based on the total Weaver.Examples.FloatingText.LifeTime.
Size float
The height of the text in world-space.
Text string
The text string currently being shown.
Timer float
The amount of time since this text was shown.
Transform Transform
The UnityEngine.Transform of the text.

Methods

Name Value Summary
OnRelease() void
Called by the Weaver.PoolableBehaviour`1.Pool when releasing this component to it. Removes this text from the Weaver.Examples.FloatingText.Manager, asserts that the UnityEngine.Component.gameObject was active and deactivates it (unless overridden).
Reset() void
Called by Unity when this component is first added (in Edit Mode) or the "Reset" function is used.
Show(string, Vector3) void
Calls Weaver.Examples.FloatingText.Show(System.String,UnityEngine.Vector3,Weaver.Examples.BillboardManager) using Weaver.Examples.BillboardManager.GetMain as the `manager`.
Show(string, Vector3, BillboardManager) void
Sets the details of this text and activates its UnityEngine.GameObject.
Update() void
Called once per frame by Unity. Updates the Weaver.Examples.FloatingText.Timer and checks if it has exceeded the Weaver.Examples.FloatingText.LifeTime. If so, this text is returned to its Weaver.ObjectPool`1 if it was created by one, otherwise this text is destroyed.

Extension Methods

Name Value Summary
TryReleaseOrDestroyGameObject<FloatingText>() bool
If the `behaviour` was created by an Weaver.ObjectPool`1 this method releases the `behaviour` to it, disables its UnityEngine.GameObject, and returns true. Otherwise this method destroys the UnityEngine.GameObject and returns false.