Class BlockerComponent2d
Unity component that allows selection of a blocker type in the Inspector.
[DisallowMultipleComponent]
public class BlockerComponent2d : MonoBehaviour
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourBlockerComponent2d
- Inherited Members
-
MonoBehaviour.IsInvoking()MonoBehaviour.CancelInvoke()MonoBehaviour.StopCoroutine(Coroutine)MonoBehaviour.StopAllCoroutines()MonoBehaviour.destroyCancellationTokenMonoBehaviour.useGUILayoutMonoBehaviour.didStartMonoBehaviour.didAwakeMonoBehaviour.runInEditModeBehaviour.enabledBehaviour.isActiveAndEnabledComponent.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.transformComponent.transformHandleComponent.gameObjectComponent.tagObject.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.nameObject.hideFlags
Properties
BlockArea
Gets the currently resolved XZ blocker area.
public FixedBoundArea BlockArea { get; }
Property Value
BlockAreaSource
Gets the source used to calculate blocker bounds.
public BlockAreaSource BlockAreaSource { get; }
Property Value
CacheCoveredVoxels
Gets whether covered voxels are cached by the blocker.
public bool CacheCoveredVoxels { get; }
Property Value
IncludeChildrenInBlockArea
Gets whether child colliders or renderers contribute bounds.
public bool IncludeChildrenInBlockArea { get; }
Property Value
IsActive
Gets whether the blocker marks covered voxels as active.
public bool IsActive { get; }
Property Value
IsSet
Gets whether this component has applied its blockage.
public bool IsSet { get; }
Property Value
LayerY
Gets the world Y layer affected by the blocker.
public Fixed64 LayerY { get; }
Property Value
ManualXzBlockAreaMax
Gets the explicitly authored maximum XZ coordinates.
public Vector2d ManualXzBlockAreaMax { get; }
Property Value
ManualXzBlockAreaMin
Gets the explicitly authored minimum XZ coordinates.
public Vector2d ManualXzBlockAreaMin { get; }
Property Value
World
Gets the resolved runtime world.
public GridWorld World { get; }
Property Value
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
resolvedSourceBlockAreaSourceReceives the source that produced the area.
fallbackReasonstringReceives 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
isActiveboolWhether covered voxels are marked active.
cacheCoveredVoxelsboolWhether 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
minVector2dThe minimum XZ coordinates.
maxVector2dThe maximum XZ coordinates.
layerYFixed64The world Y layer to affect.
TryApplyBlockage()
Tries to apply this blocker's configured coverage to its resolved world.
public bool TryApplyBlockage()
Returns
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
worldGridWorldThe active world to query.
gridCountintReceives the number of covered grids.
voxelCountintReceives the number of covered voxels.