// public void BeginUpdate() // { } public void UpdateMode(OutlineModes mode, HashSet <OutlineTarget> targets) { CommandBufferGroupItem commandBuffer = GetCommandBufferItem(mode); commandBuffer.BeginUpdate(); foreach (OutlineTarget ot in targets) { Renderer[] otRenderers = null; if (ot.AffectChildren) { otRenderers = ot.gameObject.GetComponentsInChildren <Renderer>(); } else { otRenderers = ot.GetComponents <Renderer>(); } if (ot.ExcludeParticleSystems) { otRenderers = PurgeParticleSystemRenderers(otRenderers); } commandBuffer.AddRenderingSteps(otRenderers, ot.OutlineColor, ot.Thickness, drawSilhouettesShader); } commandBuffer.EndUpdate(); }
public CommandBufferGroupItem GetCommandBufferItem(OutlineModes mode) { int idx = (int)mode; if (buffers[idx] == null) { buffers[idx] = new CommandBufferGroupItem(mode, cam); } return(buffers[idx]); }