Class BlockerComponent
Unity component that allows selection of a blocker type in the Inspector.
[DisallowMultipleComponent]
public class BlockerComponent : MonoBehaviour
- Inheritance
-
ObjectComponentBehaviourMonoBehaviourBlockerComponent
- 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
BlockAreaSource
Gets the source used to calculate blocker bounds.
public BlockAreaSource BlockAreaSource { get; }
Property Value
BlockBox
Gets the currently resolved blocker bounds.
public FixedBoundBox BlockBox { 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
ManualBlockBox
Gets the explicitly authored fixed-point bounds.
public FixedBoundBox ManualBlockBox { get; }
Property Value
World
Gets the resolved runtime world.
public GridWorld World { get; }
Property Value
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
resolvedSourceBlockAreaSourceReceives the source that produced the bounds.
fallbackReasonstringReceives 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
isActiveboolWhether covered voxels are marked active.
cacheCoveredVoxelsboolWhether the blocker caches its covered voxels.
ConfigureManualFixedBoundBox(FixedBoundBox)
Uses explicit fixed-point bounds for blockage.
public void ConfigureManualFixedBoundBox(FixedBoundBox blockBox)
Parameters
blockBoxFixedBoundBoxThe bounds to apply.
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.