A class in Root.Township, the global namespace.
Client: registers a sphere with the culling group and raises events when it comes into or goes out of the camera's view. Not used on headless servers.
Constructors
| Member | What it is |
|---|
SphereVisibilityCheck() | Unity makes components itself; use AddComponent or spawn a prefab instead of new. |
Fields
5 private and internal fields
| Member | What it is |
|---|
private UnityEvent becameInvisible | Inspector event raised when the sphere leaves view. |
private UnityEvent becameVisible | Inspector event raised when the sphere comes into view. |
private int cullingIndex | Index of the registered sphere in CullingGroupHandler. |
private Vector3 visibilityCenter | Offset of the sphere from the object. |
private float visibilityRadius | Radius of the sphere. |
Events
| Member | What it is |
|---|
event Action BecameInvisible | Raised when the sphere leaves view. |
event Action BecameVisible | Raised when the sphere comes into view. |
Methods
4 private and internal methods
| Member | What it is |
|---|
private void OnDestroy() | Removes the sphere from the culling group. |
private void OnDrawGizmosSelected() | Draws the sphere in blue. |
private void Start() | Registers the sphere at its start position. It does not follow the object if it moves. |
private void UpdateVisibility(CullingGroupEvent sphere) | Culling callback that raises the inspector and code events. |