QuestMarker
A class in Root.Township, Features.Gameplay.Progression.QuestMarkers.
A floating quest marker that shows while all its game conditions are met and scales, rises and turns to face the player by distance. Client only; updated by QuestMarkerDataUpdater.
- Listed in ATT, Features and other game namespaces
- Inherits or implements
MonoBehaviour
Constructors
| Member | What it is |
|---|---|
QuestMarker() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
15 private and internal fields
| Member | What it is |
|---|---|
private AnimationCurve distanceHeightCurveSquared | Curve from squared flat distance to marker height. |
private AnimationCurve distanceScalingCurveSquared | Curve from squared flat distance to marker scale. |
private float distanceSqr | Last squared flat distance to the player. |
private float height | Current eased height. |
private float heightTarget | Height the marker eases toward. |
private float interpolationSpeed | How fast scale and height ease toward their targets. |
private Vector3 lookDirection | Flat direction from the marker to the player's head. |
private Vector3 markerLocalPosition | Cached local position of the marker transform. |
private Vector3 markerPosition | Cached world position of the marker transform. |
private Transform markerTransform | The marker object that is shown, scaled and raised. |
private RateLimiter rateLimiter | Limits how often target scale and height are recalculated. |
private float scale | Current eased scale. |
private float scaleTarget | Scale the marker eases toward. |
private int targetTicksPerSecond | Target recalculations per second (0 for unlimited). |
private Object[] visibilityConditions | IGameCondition objects that must all be met for the marker to show. |
Methods
12 private and internal methods
| Member | What it is |
|---|---|
private void AllConditionsMet(bool areAllConditionsMet) | Shows or hides the marker object. |
private bool AreAllConditionsMet() | True if every visibility condition is met. |
private void ConditionChanged() | Rechecks the conditions when one changes. |
private void ListenForConditionChanges() | Subscribes to every condition's change callback. |
private void OnDestroy() | Unregisters from QuestMarkerDataUpdater and stops listening to conditions. |
private void OnDrawGizmosSelected() | Editor: draws the height range and the near and far distance spheres. |
private void Start() | Client: registers with QuestMarkerDataUpdater, listens to conditions and sets initial visibility. Skipped on a headless server. |
private void StopListeningForCompletionChanges() | Unsubscribes from every condition's change callback. |
private void UpdateLookPosition(Vector3 newPlayerHeadPosition) | Sets the flat direction from the marker to the player's head. |
private void UpdateMarkerHeight() | Eases the marker's local height toward the target. |
private void UpdateMarkerScale() | Eases the marker's scale toward the target. |
private void UpdateMarkerYRotationToLookAtPlayer() | Turns this object on the Y axis to face the player. |
Used in
Members of other types that take, return or hold a QuestMarker: