MonoBehaviour.OnWillRenderObject Manual     Reference     Scripting  
Scripting > Runtime Classes > MonoBehaviour

function OnWillRenderObject () : void


OnWillRenderObject is called once for each camera if the object is visible.

The function is called during the culling process just before rendering all culled objects. You might use this to create dependent render textures and you want to update the render texture only if the rendered object will actually be visible. As an example this is used by the water component.

Camera.current will be set to the camera that will render the object.