Example #1
0
        //         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();
        }
Example #2
0
        public CommandBufferGroupItem GetCommandBufferItem(OutlineModes mode)
        {
            int idx = (int)mode;

            if (buffers[idx] == null)
            {
                buffers[idx] = new CommandBufferGroupItem(mode, cam);
            }

            return(buffers[idx]);
        }