First Commit
This commit is contained in:
43
Assets/Scripts/RenderPasses/Outline/OutlineCollection.cs
Normal file
43
Assets/Scripts/RenderPasses/Outline/OutlineCollection.cs
Normal file
@@ -0,0 +1,43 @@
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
|
||||
namespace Golems
|
||||
{
|
||||
public static class OutlineCollection
|
||||
{
|
||||
/// <summary>
|
||||
/// Collection of renderers to be drawn with outline process
|
||||
/// </summary>
|
||||
public readonly static List<Outline2> RendererBundles = new List<Outline2>();
|
||||
|
||||
/// <summary>
|
||||
/// 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...
|
||||
/// </summary>
|
||||
public static int NumberOfObjectsRendered = 0;
|
||||
|
||||
/// <summary>
|
||||
/// Adds collection of renderers to the Outline Collection
|
||||
/// </summary>
|
||||
/// <param name="rendererBundle">Renderers to be drawn with Outline process</param>
|
||||
public static void AddRenderer(Outline2 rendererBundle)
|
||||
{
|
||||
if (RendererBundles.Contains(rendererBundle))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
RendererBundles.Add(rendererBundle);
|
||||
}
|
||||
|
||||
public static void RemoveRenderer(Outline2 rendererBundle)
|
||||
{
|
||||
RendererBundles.Remove(rendererBundle);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user