Skip to main content

ClientOnly

A class in Root.Township, Alta.Networking.

Turns a list of behaviours off on a dedicated server and on everywhere else (clients and local test), so client-only scripts never run server side.

Constructors​

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

Fields​

1 private and internal field
MemberWhat it is
private Behaviour[] behavioursThe behaviours switched on or off.

Methods​

2 private and internal methods
MemberWhat it is
private void Awake()Disables the listed behaviours on a non-local-test server and enables them otherwise.
private void IBuildRendererPostBake.PostBake()Build step: drops null entries from behaviours.