private void AddCorner() | Editor button: adds a new corner child halfway between the first and last corners. |
private async void CheckPlayer(bool hasPlayer) | Handler for a covered chunk gaining or losing the local player; rechecks at most once a frame. |
private void ClampCorners() | Flattens every corner to local height 0. |
private float DistaceToBorderY(Vector3 point) | Distance from the point to the top of the area bounds. |
private float DistanceToBorderXZ(Vector3 point) | Horizontal distance from the point to the nearest border edge. |
private void DrawGizmoQuadForLine(Vector3 from, Vector3 to, Color color) | Empty in this build. |
private void DrawGizmos(Color color) | Editor: flattens the corners and refreshes the bounds for gizmo drawing. |
private Vector3[] GetVerticesPositions() | The corner positions at the object's height, refreshed if any corner moved. |
private bool IsLocalPlayerWithinArea() | True if any chunk overlapping the area has the local player. |
private bool NeedToUpdatePositions() | True if a corner was added, removed or moved. |
private void OnDisable() | Unhooks the local player and chunk events. |
private void OnDrawGizmos() | Editor gizmo, faint. |
private void OnDrawGizmosSelected() | Editor gizmo when selected. |
private void OnEnable() | Client: sets up now, or once the local player exists. |
private void OnLocalPlayerSet(PlayerController player) | Sets up once the local player is created. |
private void SetAmbienceValue(float outsideToInsideRatio) | Blends ambient colour between the two sets by the ratio and crossfades their ambience audio. |
private void Setup() | Works out the bounds, finds the chunks overlapping them and listens for the local player in them. |
private void UpdateBounds() | Fits the bounds around the corners, extending boundsHeight above the object. |
private void UpdatePlayerInsideZone() | Starts the per-frame position check when the player is in a covered chunk, otherwise resets to outside. |
private void UpdatePlayerPosition() | Per frame: works out how far inside the border the player is and sets the blend. |
private void UpdatePositions() | Copies the corner positions, flattened to the object's height. |