using System.Collections.Generic; using UnityEngine; namespace Golems { public static class OutlineCollection { /// /// Collection of renderers to be drawn with outline process /// public readonly static List RendererBundles = new List(); /// /// The number of objects rendered in OutlineScriptableRenderPass. /// This is reset in OutlineScriptableRenderPass.Execute() and incremented in /// DrawObjectsDefault(). /// ComposeOutlinePass uses this in AddRenderPasses, if it's zero screen copy Blit is avoided. /// /// N.B This is a sketchy place to do this sort of thing, full acknowledged but it's quick, easy and works... /// public static int NumberOfObjectsRendered = 0; /// /// Adds collection of renderers to the Outline Collection /// /// Renderers to be drawn with Outline process public static void AddRenderer(Outline2 rendererBundle) { if (RendererBundles.Contains(rendererBundle)) { return; } RendererBundles.Add(rendererBundle); } public static void RemoveRenderer(Outline2 rendererBundle) { RendererBundles.Remove(rendererBundle); } } }