Table of Contents

Class TargetOutline

Namespace
FishMMO.Client
Assembly
FishMMO.Client.dll

The one outlined object on screen: what the player is aiming at, when it is something they can interact with and the "Highlight Interactables" gameplay option is on.

public static class TargetOutline
Inheritance
TargetOutline
Inherited Members

Remarks

No component on the object. The outline is not something an object carries; it is a property of the player's aim. This holds one target and the list of its renderers, gathered when the target changes, and TargetOutlineFeature (a URP renderer feature on every renderer) draws them. Nothing is added to, or allocated per, interactable object, and with no target the feature adds no pass at all.

Who drives it. UITKTarget's hover handling: it already resolves what the pointer rests on through InteractableResolver, the same rule the interact key uses, so the highlighted object is always the one the key would act on.

What it draws. The UnityEngine.MeshRenderers and UnityEngine.SkinnedMeshRenderers under the target, as gathered by Show(Transform); something that swaps its meshes while outlined calls Refresh(). Objects drawn by the GPU-driven systems (terrain, scatter, batched procedural props) have no renderer and cannot be outlined this way. Only the visible parts are outlined: the ring follows what can be seen, not what is behind a wall.

Fields

DefaultColor

The default outline colour: warm lamplight gold, readable on stone, grass and snow alike.

public static readonly Color DefaultColor

Field Value

Color

DefaultWidth

The default outline width, in pixels.

public const float DefaultWidth = 2

Field Value

float

MaxWidth

The widest outline, in pixels.

public const float MaxWidth = 10

Field Value

float

Properties

Color

The outline colour (alpha unused). Drawn exactly as chosen, after tonemapping.

public static Color Color { get; set; }

Property Value

Color

HasTarget

Whether anything is outlined.

public static bool HasTarget { get; }

Property Value

bool

Renderers

The renderers the outline draws, as gathered by Show(Transform) or Refresh().

public static IReadOnlyList<Renderer> Renderers { get; }

Property Value

IReadOnlyList<Renderer>

Target

The outlined object, or null. A destroyed target reads as null.

public static Transform Target { get; }

Property Value

Transform

Width

The outline width in pixels, 0 to MaxWidth. 0 draws nothing.

public static float Width { get; set; }

Property Value

float

Methods

Clear()

Outlines nothing.

public static void Clear()

Hide(Transform)

Stops outlining oldTarget if it is the outlined object. Null (a target that was destroyed) clears an outline whose own target has been destroyed.

public static void Hide(Transform oldTarget)

Parameters

oldTarget Transform

Refresh()

Gathers the target's mesh and skinned-mesh renderers again, after it swapped its meshes.

public static void Refresh()

Show(Transform)

Outlines newTarget in place of whatever was outlined. Null clears.

public static void Show(Transform newTarget)

Parameters

newTarget Transform