Table of Contents

Class ClientBoundaryWarning

Namespace
FishMMO.Client
Assembly
FishMMO.Client.dll

Shows the scene boundary as a glass barrier that breaks where the local player pushes into it, so the edge of the playable area is never a surprise. Driven from Client.Update.

public sealed class ClientBoundaryWarning
Inheritance
ClientBoundaryWarning
Inherited Members

Remarks

The same boxes the server enforces. The scene server checks SceneBoundaryDetails.ContainsPoint: axis-aligned boxes, inside any one of them is inside. This reads the scene's SceneBoundary components — what that cache is built from — and measures the same boxes, so the glass stands exactly where the server will stop the player. A face shared with a neighbouring box is not an edge, and shows nothing.

One break, set entirely by distance. Each frame the shader is told where on the face the player's chest is, how hard they are pressing (from how close they are), and how much of the invisible force a metre or two short of the boundary is on. The fracture pattern itself is fixed to the face, so walking closer breaks it further, backing off eases it back, and walking along the wall carries the break through the pattern. Nothing is timed, so nothing restarts. The look is FishMMO/Boundary Glass; see RequestSceneTextures(bool) for what its refraction costs and when.

Every face, the ceiling included. A flier meets the top of the box the same way a walker meets a side, and sees the same glass overhead.

Whose glass it is. Initialize() follows the local player's character as it starts and stops; Initialize(Transform) follows one transform for as long as its owner keeps it, which is how the world test bed shows the glass round its walker, with no player and no client. Either way the owner calls Tick() once a frame and Shutdown() when done, which takes the panes down and gives the camera back.

Presentation only: it never moves the player or blocks anything. Client-only by assembly: FishMMO.Client is not compiled into the server.

Fields

Enabled

Players can switch it off; it is on by default.

public static bool Enabled

Field Value

bool

ForceEngageDistance

Where the invisible force starts to push back, in metres short of the boundary: shards begin to break loose here.

public const float ForceEngageDistance = 2

Field Value

float

ForceFullDistance

Where the force is fully on and the glass has given way, in metres short of the boundary.

public const float ForceFullDistance = 1

Field Value

float

ImpactHeight

How high above the player's feet they press into a wall: chest height.

public const float ImpactHeight = 1.2

Field Value

float

MaterialAddress

The tuned material: its address in the client's static addressables, and its path for the editor. Its values are the glass's look; the shader's own defaults are only the fallback if it cannot be loaded.

public const string MaterialAddress = "Boundary Glass"

Field Value

string

MaterialEditorPath

public const string MaterialEditorPath = "Assets/Prefabs/Client/Materials/Boundary/Boundary Glass.mat"

Field Value

string

PressureRadiusFar

public const float PressureRadiusFar = 0.7

Field Value

float

PressureRadiusNear

How wide the pressure reaches across the face, in metres, from first contact to full press.

public const float PressureRadiusNear = 1.3

Field Value

float

ShaderName

The shader the panes are drawn with; its material lives in the client addressables so builds include it.

public const string ShaderName = "FishMMO/Boundary Glass"

Field Value

string

WarningDistance

How close to a face the glass starts to show, in metres.

public const float WarningDistance = 12

Field Value

float

Remarks

The break is the size of a body pressing into it, which says nothing to anyone further off than this.

Methods

Initialize()

Shows the glass round the local player's character, whenever there is one.

public void Initialize()

Initialize(Transform)

Shows the glass round subject (its pivot at the feet, as a character's is), measured against the boundaries of the scene it is in.

public void Initialize(Transform subject)

Parameters

subject Transform

Shutdown()

public void Shutdown()

Tick()

public void Tick()