ShadowCasterGroup2D.cs 906 B

12345678910111213141516171819202122232425262728293031
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. namespace UnityEngine.Experimental.Rendering.Universal
  5. {
  6. public abstract class ShadowCasterGroup2D : MonoBehaviour
  7. {
  8. [SerializeField] internal int m_ShadowGroup = 0;
  9. List<ShadowCaster2D> m_ShadowCasters;
  10. public List<ShadowCaster2D> GetShadowCasters() { return m_ShadowCasters; }
  11. public int GetShadowGroup() { return m_ShadowGroup; }
  12. public void RegisterShadowCaster2D(ShadowCaster2D shadowCaster2D)
  13. {
  14. if (m_ShadowCasters == null)
  15. m_ShadowCasters = new List<ShadowCaster2D>();
  16. m_ShadowCasters.Add(shadowCaster2D);
  17. }
  18. public void UnregisterShadowCaster2D(ShadowCaster2D shadowCaster2D)
  19. {
  20. if (m_ShadowCasters != null)
  21. m_ShadowCasters.Remove(shadowCaster2D);
  22. }
  23. }
  24. }