RenderManager.cs 817 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. public class RenderManager
  5. {
  6. /// <summary>
  7. /// 细节等级,值目前在0-3之间
  8. /// </summary>
  9. static int s_LOD = 3;
  10. static int MaxLOD = 3;
  11. static int MinLOD = 0;
  12. public static int LOD
  13. {
  14. get { return RenderManager.s_LOD; }
  15. set {
  16. s_LOD = value;
  17. if (s_LOD > MaxLOD)
  18. {
  19. s_LOD = MaxLOD;
  20. }
  21. if (s_LOD < MinLOD)
  22. {
  23. s_LOD = MinLOD;
  24. }
  25. Shader.globalMaximumLOD = s_LOD * 100;
  26. GlobalEvent.DispatchEvent(RenderEventEnum.UpdateLOD);
  27. }
  28. }
  29. public static void Init()
  30. {
  31. }
  32. }
  33. public enum RenderEventEnum
  34. {
  35. UpdateLOD
  36. }