Skip to main content

CullingController

A class in Root.Township, the global namespace.

Client: on the local player, switches between the game's portal-based culling camera and Unity's occlusion culling when PortalBasedCullingCamera.IsCulling changes.

Constructors​

MemberWhat it is
CullingController()Unity makes components itself; use AddComponent or spawn a prefab instead of new.

Fields​

2 private and internal fields
MemberWhat it is
private PlayerController controllerThe local PlayerController, whose camera's occlusion culling is toggled.
private PortalBasedCullingCamera cullingCameraThe PortalBasedCullingCamera enabled or disabled.

Methods​

3 private and internal methods
MemberWhat it is
private void CullingChanged()Enables the portal culling camera when culling is on and, except on Android, turns Unity occlusion culling off to match.
private void IInitializeAsLocalPlayer.InitializeAsLocalPlayer(PlayerController controller)Stores the player controller, subscribes to PortalBasedCullingCamera.CullingChanged and applies the current state.
private void OnDestroy()Unsubscribes from PortalBasedCullingCamera.CullingChanged.