Class ClippingPrimitive
An abstract primitive component to animate and visualize a clipping primitive that can be
used to drive per pixel based clipping.
Inheritance
ClippingPrimitive
Implements
IMaterialInstanceOwner
Assembly: cs.temp.dll.dll
public abstract class ClippingPrimitive : MonoBehaviour, IMaterialInstanceOwner
Fields
Declaration
protected ClippingPrimitive.Side clippingSide
Field Value
Declaration
protected MaterialPropertyBlock materialPropertyBlock
Field Value
Type |
Description |
MaterialPropertyBlock |
|
Declaration
protected List<Renderer> renderers
Field Value
Type |
Description |
List<Renderer> |
|
Properties
Toggles whether the clipping features will apply to shared materials or material instances (default).
Declaration
public bool ApplyToSharedMaterial { get; set; }
Property Value
The renderer(s) that should be affected by the primitive.
Declaration
public ClippingPrimitive.Side ClippingSide { get; set; }
Property Value
Declaration
protected abstract string ClippingSideProperty { get; }
Property Value
Keeping track of any field, property or transformation changes to optimize material property block setting.
Declaration
public bool IsDirty { get; set; }
Property Value
Declaration
protected abstract string Keyword { get; }
Property Value
Toggles whether the primitive will use the Camera OnPreRender event.
Declaration
public bool UseOnPreRender { get; set; }
Property Value
Methods
Adds a renderer to the list of objects this clipping primitive clips.
Declaration
public void AddRenderer(Renderer _renderer)
Parameters
Type |
Name |
Description |
Renderer |
_renderer |
The renderer to add.
|
Declaration
protected virtual void BeginUpdateShaderProperties()
Removes all renderers in the list of objects this clipping primitive clips.
Declaration
public void ClearRenderers()
Declaration
protected virtual void EndUpdateShaderProperties()
Returns a copy of the current list of renderers.
Declaration
public IEnumerable<Renderer> GetRenderersCopy()
Returns
Type |
Description |
IEnumerable<Renderer> |
The current list of renderers.
|
Declaration
protected virtual void Initialize()
Declaration
protected void LateUpdate()
Declaration
protected void OnCameraPreRender(CameraEventRouter router)
Parameters
Declaration
protected void OnDestroy()
Declaration
protected void OnDisable()
Declaration
protected void OnEnable()
Declaration
public void OnMaterialChanged(MaterialInstance materialInstance)
Parameters
Type |
Name |
Description |
MaterialInstance |
materialInstance |
|
Removes a renderer to the list of objects this clipping primitive clips.
Declaration
public void RemoveRenderer(Renderer _renderer)
Parameters
Type |
Name |
Description |
Renderer |
_renderer |
|
Declaration
protected void ToggleClippingFeature(Material material, bool keywordOn)
Parameters
Type |
Name |
Description |
Material |
material |
|
Boolean |
keywordOn |
|
Declaration
protected void ToggleClippingFeature(Material[] materials, bool keywordOn)
Parameters
Type |
Name |
Description |
Material[] |
materials |
|
Boolean |
keywordOn |
|
Declaration
protected void ToggleClippingFeature(bool keywordOn)
Parameters
Type |
Name |
Description |
Boolean |
keywordOn |
|
Declaration
protected virtual void UpdateRenderers()
Declaration
protected abstract void UpdateShaderProperties(MaterialPropertyBlock materialPropertyBlock)
Parameters
Type |
Name |
Description |
MaterialPropertyBlock |
materialPropertyBlock |
|
Implements
IMaterialInstanceOwner