Brak opisu
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

LODControl.cs 920B

1234567891011121314151617181920212223242526272829303132333435
  1. using UnityEngine;
  2. using UnityEngine.AdaptivePerformance;
  3. using UnityEngine.UI;
  4. public class LODControl : MonoBehaviour
  5. {
  6. public Toggle LODToggle;
  7. AdaptivePerformanceScalerSettingsBase LODSettings;
  8. void Start()
  9. {
  10. var ap = Holder.Instance;
  11. if (ap == null || !ap.Active)
  12. {
  13. Debug.Log("[AP Indexer Visualisation] Adaptive Performance not active");
  14. enabled = false;
  15. return;
  16. }
  17. IAdaptivePerformanceSettings settings = AdaptivePerformanceGeneralSettings.Instance.Manager.activeLoader.GetSettings();
  18. if (settings == null)
  19. return;
  20. LODSettings = settings.scalerSettings.AdaptiveLOD;
  21. LODToggle.SetIsOnWithoutNotify(LODSettings.enabled);
  22. }
  23. public void ToggleAdaptiveLOD()
  24. {
  25. if (LODSettings == null)
  26. return;
  27. LODSettings.enabled = !LODSettings.enabled;
  28. }
  29. }