Renvix Assets

Scripting API

Everything you can set in the Inspector can also be set from code, and every component exposes its state. This section gives an overview and covers the parts that are not tied to one component. The members of each component are listed on its page in Components.

The full source code is included and documented with XML comments, so your IDE shows a description for every public type and member.

PageWhat it covers
Vision SystemThe update loop, the order of events in a frame, team queries, quality, plane conversions
Low-level APIComputing visibility yourself, without components: solver, queries, obstacles, the awareness model

Assemblies and namespaces

AssemblyNamespaceContents
Renvix.VisionFog.CoreRenvix.VisionFog.CoreThe visibility solver and point queries. Pure math, Burst-compatible
Renvix.VisionFog.RuntimeRenvix.VisionFogVision Source, Vision Target, Vision Perception, Detection Profile, Vision Occluder, VisionSystem, VisionQuality, VisionPlane
Renvix.VisionFog.PresentationFog Of War, Fog Hider, Vision Cone Renderer
Renvix.VisionFog.OccludersReading obstacles from 2D and 3D physics
Renvix.VisionFog.URPRenvix.VisionFog.URPThe renderer feature

The assemblies are referenced automatically by scripts in the default Assembly-CSharp. If your scripts are in their own assembly definition, add Renvix.VisionFog.Runtime to its references, plus Renvix.VisionFog.Core for the low-level API and Unity.Mathematics and Unity.Collections if you use plane coordinates or native arrays.

Main types

TypeNamespacePage
VisionSourceRenvix.VisionFogVision Source
VisionOccluderRenvix.VisionFogVision Occluder
VisionTargetRenvix.VisionFogVision Target
VisionPerception, AwarenessLevelRenvix.VisionFogVision Perception
DetectionProfileRenvix.VisionFogDetection Profile
VisionConeRendererRenvix.VisionFog.PresentationVision Cone Renderer
FogOfWarRenvix.VisionFog.PresentationFog Of War
FogHiderRenvix.VisionFog.PresentationFog Hider
VisionSystem, VisionQuality, VisionPlaneRenvix.VisionFogVision System

Common tasks

TaskCode
Can this source see a point?source.CanSee(point)
Does any source of a team see a point?VisionSystem.IsVisibleToTeam(team, point)
What does a guard know about the player?perception.TryGetTracked(playerTarget, out var tracked)
React when a guard detects someoneperception.BecameAlerted += (observer, target) => ...
Make the player harder to noticeplayerTarget.Visibility = 0.5f
Change the view at runtimesource.FieldOfView = 45f; source.Radius = 12f;
Glass that shattersoccluder.SeeThrough = 1f
Is an enemy visible to the player?enemyHider.IsVisible
Reset or reveal the mapfog.ResetExplored(), fog.RevealAll()
Fog textures for a minimapfog.VisibleTexture, fog.ExploredTexture, see Minimap
Lower the quality on weak devicesVisionQuality.Level = VisionQualityLevel.Low
Get a result right after teleportingsource.ForceUpdate()