protected override bool ResolveDependencies()
 {
     this.cameraEventHandler = CameraEventHandler.GetCameraEventHandler(this.rendererContextIndex);
     this.lightEventHandler  = LightEventHandler.GetLightEventHandler(this.rendererContextIndex);
     return(this.cameraEventHandler != null &&
            (this.lightEventHandler != null || !this.DrawInLight));
 }
    protected override void Unload()
    {
        base.Unload();
        if (this.commandBuffer != null)
        {
            if (this.cameraEventHandler != null && this.cameraEventHandler.CameraComponent)
            {
                this.RemoveCommandBuffer();
            }

            this.commandBuffer.Clear();
            this.commandBuffer.Release();
            this.commandBuffer = null;
        }
        // Here a tricks : a reference to a component that has been destroyed act as null on a comparaison.
        if (this.cameraEventHandler != null)
        {
            this.cameraEventHandler.OnPreCullEvents -= this.OnPreCullEvent;
        }

        this.cameraEventHandler = null;
        this.lightEventHandler  = null;
    }