暂无描述
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

ScalerProfileChanger.cs 839B

1234567891011121314151617181920212223242526
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using UnityEngine.AdaptivePerformance;
  5. public class ScalerProfileChanger : MonoBehaviour
  6. {
  7. public ScalerProfileListItem Representation;
  8. public RectTransform Content;
  9. void Start()
  10. {
  11. IAdaptivePerformanceSettings settings = AdaptivePerformanceGeneralSettings.Instance.Manager.activeLoader?.GetSettings();
  12. if (settings == null)
  13. return;
  14. var scalerProfiles = settings.GetAvailableScalerProfiles();
  15. foreach (var scalerProfile in scalerProfiles)
  16. {
  17. Debug.Log($"[Scaler Profile Sample] Scaler Profile: {scalerProfile} added.");
  18. var spawnedListItem = Instantiate(Representation, Content);
  19. spawnedListItem.ScalerProfileName.text = scalerProfile;
  20. }
  21. }
  22. }