Table of Contents

Class BlockerComponent

Namespace
GridForge.Blockers

Unity component that allows selection of a blocker type in the Inspector.

[DisallowMultipleComponent]
public class BlockerComponent : MonoBehaviour
Inheritance
Object
Component
Behaviour
MonoBehaviour
BlockerComponent
Inherited Members
MonoBehaviour.IsInvoking()
MonoBehaviour.CancelInvoke()
MonoBehaviour.StopCoroutine(Coroutine)
MonoBehaviour.StopAllCoroutines()
MonoBehaviour.destroyCancellationToken
MonoBehaviour.useGUILayout
MonoBehaviour.didStart
MonoBehaviour.didAwake
MonoBehaviour.runInEditMode
Behaviour.enabled
Behaviour.isActiveAndEnabled
Component.GetComponent<T>()
Component.TryGetComponent<T>(out T)
Component.GetComponentInChildren<T>()
Component.GetComponentsInChildren<T>()
Component.GetComponentInParent<T>()
Component.GetComponentsInParent<T>()
Component.GetComponents<T>()
Component.GetComponentIndex()
Component.CompareTag(TagHandle)
Component.transform
Component.transformHandle
Component.gameObject
Component.tag
Object.GetEntityId()
Object.MemberwiseClone()
Object.GetInstanceID()
Object.GetHashCode()
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion)
Object.Instantiate(Object, Vector3, Quaternion, Transform)
Object.Instantiate(Object)
Object.Instantiate(Object, Scene)
Object.Instantiate<T>(T, InstantiateParameters)
Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
Object.Instantiate(Object, Transform)
Object.Instantiate<T>(T)
Object.Instantiate<T>(T, Vector3, Quaternion)
Object.Instantiate<T>(T, Vector3, Quaternion, Transform)
Object.Instantiate<T>(T, Transform)
Object.Destroy(Object)
Object.DestroyImmediate(Object)
Object.DontDestroyOnLoad(Object)
Object.DestroyObject(Object)
Object.FindObjectsOfType<T>()
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindObjectOfType<T>()
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Object.FindObjectsByType<T>()
Object.FindObjectsByType<T>(FindObjectsInactive)
Object.ToString()
Object.name
Object.hideFlags

Properties

BlockAreaSource

Gets the source used to calculate blocker bounds.

public BlockAreaSource BlockAreaSource { get; }

Property Value

BlockAreaSource

BlockBox

Gets the currently resolved blocker bounds.

public FixedBoundBox BlockBox { get; }

Property Value

FixedBoundBox

CacheCoveredVoxels

Gets whether covered voxels are cached by the blocker.

public bool CacheCoveredVoxels { get; }

Property Value

bool

IncludeChildrenInBlockArea

Gets whether child colliders or renderers contribute bounds.

public bool IncludeChildrenInBlockArea { get; }

Property Value

bool

IsActive

Gets whether the blocker marks covered voxels as active.

public bool IsActive { get; }

Property Value

bool

IsSet

Gets whether this component has applied its blockage.

public bool IsSet { get; }

Property Value

bool

ManualBlockBox

Gets the explicitly authored fixed-point bounds.

public FixedBoundBox ManualBlockBox { get; }

Property Value

FixedBoundBox

World

Gets the resolved runtime world.

public GridWorld World { get; }

Property Value

GridWorld

Methods

CalculateBlockBox(out BlockAreaSource, out string)

Calculates the blocker bounds and reports any fallback to transform bounds.

public FixedBoundBox CalculateBlockBox(out BlockAreaSource resolvedSource, out string fallbackReason)

Parameters

resolvedSource BlockAreaSource

Receives the source that produced the bounds.

fallbackReason string

Receives the reason the configured source could not be used.

Returns

FixedBoundBox

The calculated fixed-point bounds.

ConfigureBoundsBlocker(bool, bool)

Configures the blocker state used when applying coverage.

public void ConfigureBoundsBlocker(bool isActive = true, bool cacheCoveredVoxels = false)

Parameters

isActive bool

Whether covered voxels are marked active.

cacheCoveredVoxels bool

Whether the blocker caches its covered voxels.

ConfigureManualFixedBoundBox(FixedBoundBox)

Uses explicit fixed-point bounds for blockage.

public void ConfigureManualFixedBoundBox(FixedBoundBox blockBox)

Parameters

blockBox FixedBoundBox

The bounds to apply.

TryApplyBlockage()

Tries to apply this blocker's configured coverage to its resolved world.

public bool TryApplyBlockage()

Returns

bool

true when blockage is applied or was already applied.

TryCountPreviewCoverage(GridWorld, out int, out int)

Counts the grids and voxels covered without applying blockage.

public bool TryCountPreviewCoverage(GridWorld world, out int gridCount, out int voxelCount)

Parameters

world GridWorld

The active world to query.

gridCount int

Receives the number of covered grids.

voxelCount int

Receives the number of covered voxels.

Returns

bool

true when an active world was queried.