Class FlexalonClippable
- Namespace
- Flexalon
- Assembly
- Flexalon.dll
Clips the renderers on this object and its children to a FlexalonViewport. The renderers' shaders must include FlexalonViewport.hlsl and call FlexalonClipToViewport.
[ExecuteAlways]
[DisallowMultipleComponent]
[AddComponentMenu("Flexalon/Flexalon Clippable")]
public class FlexalonClippable : MonoBehaviour
- Inheritance
-
objectObjectComponentBehaviourMonoBehaviourFlexalonClippable
Remarks
The renderer list is collected when the component is enabled and is not serialized. A child with its own FlexalonClippable is skipped, along with its children. In the editor, outside play mode, the list is refreshed automatically when the hierarchy changes. In play mode, objects added directly under this object, such as virtualizer or cloner items, are collected before the next frame renders. Call RefreshRenderers() after adding or removing renderers deeper in the hierarchy. Activating and deactivating objects does not require a refresh.
Properties
ActiveViewport
The enabled viewport currently clipping these renderers, or null if there is none.
public FlexalonViewport ActiveViewport { get; }
Property Value
Renderers
The renderers clipped by this component.
public IReadOnlyList<Renderer> Renderers { get; }
Property Value
- IReadOnlyList<Renderer>
Viewport
The viewport that clips these renderers. When null, the nearest enabled viewport on this object or a parent is used, or the viewport set on a parent clippable, so items created under content that names its viewport are clipped too.
public FlexalonViewport Viewport { get; set; }
Property Value
Methods
RefreshRenderers()
Collects the renderers on this object and its children again, skipping children that have their own FlexalonClippable. Call this in play mode after adding or removing renderers below the direct children of this object.
public void RefreshRenderers()