Table of Contents

Class BlockerComponent2d

Namespace
GridForge.Blockers

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

[DisallowMultipleComponent]
public class BlockerComponent2d : MonoBehaviour
Inheritance
Object
Component
Behaviour
MonoBehaviour
BlockerComponent2d
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

BlockArea

Gets the currently resolved XZ blocker area.

public FixedBoundArea BlockArea { get; }

Property Value

FixedBoundArea

BlockAreaSource

Gets the source used to calculate blocker bounds.

public BlockAreaSource BlockAreaSource { get; }

Property Value

BlockAreaSource

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

LayerY

Gets the world Y layer affected by the blocker.

public Fixed64 LayerY { get; }

Property Value

Fixed64

ManualXzBlockAreaMax

Gets the explicitly authored maximum XZ coordinates.

public Vector2d ManualXzBlockAreaMax { get; }

Property Value

Vector2d

ManualXzBlockAreaMin

Gets the explicitly authored minimum XZ coordinates.

public Vector2d ManualXzBlockAreaMin { get; }

Property Value

Vector2d

World

Gets the resolved runtime world.

public GridWorld World { get; }

Property Value

GridWorld

Methods

CalculateXzBlockArea(out BlockAreaSource, out string)

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

public FixedBoundArea CalculateXzBlockArea(out BlockAreaSource resolvedSource, out string fallbackReason)

Parameters

resolvedSource BlockAreaSource

Receives the source that produced the area.

fallbackReason string

Receives the reason the configured source could not be used.

Returns

FixedBoundArea

The calculated fixed-point XZ area.

ConfigureAreaBlocker(bool, bool)

Configures the blocker state used when applying coverage.

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

Parameters

isActive bool

Whether covered voxels are marked active.

cacheCoveredVoxels bool

Whether the blocker caches its covered voxels.

ConfigureManualXzArea(Vector2d, Vector2d, Fixed64)

Uses an explicit fixed-point XZ area and layer for blockage.

public void ConfigureManualXzArea(Vector2d min, Vector2d max, Fixed64 layerY = default)

Parameters

min Vector2d

The minimum XZ coordinates.

max Vector2d

The maximum XZ coordinates.

layerY Fixed64

The world Y layer to affect.

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.