using System.Collections.Generic;
using UnityEngine.Scripting.APIUpdating;
namespace UnityEngine.Rendering.Universal
{
///
/// Class for 2D shadow caster groups.
///
[MovedFrom("UnityEngine.Experimental.Rendering.Universal")]
public abstract class ShadowCasterGroup2D : MonoBehaviour
{
[SerializeField] internal int m_ShadowGroup = 0;
List m_ShadowCasters;
internal virtual void CacheValues()
{
if (m_ShadowCasters != null)
{
for (int i = 0; i < m_ShadowCasters.Count; i++)
m_ShadowCasters[i].CacheValues();
}
}
///
/// Returns a list of registered 2D shadow casters.
///
/// A list of 2D shadow casters that have been registered..
public List GetShadowCasters()
{
return m_ShadowCasters;
}
///
/// Returns the shadow group.
///
/// The shadow group used.
public int GetShadowGroup()
{
return m_ShadowGroup;
}
///
/// Registers a 2D shadow caster.
///
/// The 2D shadow to register.
public void RegisterShadowCaster2D(ShadowCaster2D shadowCaster2D)
{
if (m_ShadowCasters == null)
m_ShadowCasters = new List();
m_ShadowCasters.Add(shadowCaster2D);
}
///
/// Unregisters a 2D shadow caster.
///
/// The 2D shadow to unregister.
public void UnregisterShadowCaster2D(ShadowCaster2D shadowCaster2D)
{
if (m_ShadowCasters != null)
m_ShadowCasters.Remove(shadowCaster2D);
}
}
}