Layers.cs 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. namespace BansheeEngine
  6. {
  7. /// <summary>
  8. /// Contains a list of layers that can be used for controlling which <see cref="Renderable"/> is output to which
  9. /// camera. A maximum of 64 layers are supported.
  10. /// </summary>
  11. public static class Layers // Note: Placeholder class, need functionality to edit and persist layer names
  12. {
  13. private static string[] names;
  14. private static UInt64[] values;
  15. /// <summary>
  16. /// Returns the names of all available layers.
  17. /// </summary>
  18. public static string[] Names
  19. {
  20. get
  21. {
  22. if (names == null)
  23. {
  24. names = new string[64];
  25. for (int i = 0; i < names.Length; i++)
  26. names[i] = "Layer_" + i;
  27. }
  28. return names;
  29. }
  30. }
  31. /// <summary>
  32. /// Returns the values of all available layers.
  33. /// </summary>
  34. public static UInt64[] Values
  35. {
  36. get
  37. {
  38. if (values == null)
  39. {
  40. values = new UInt64[64];
  41. for (int i = 0; i < values.Length; i++)
  42. values[i] = 1UL << i;
  43. }
  44. return values;
  45. }
  46. }
  47. }
  48. }