설명 없음
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.

ImageHelper.cs 944B

123456789101112131415161718192021222324252627282930313233343536373839
  1. using System;
  2. using UnityEngine;
  3. using UnityEngine.UIElements;
  4. namespace UnityEditor.Purchasing
  5. {
  6. static class ImageHelper
  7. {
  8. internal static void AddRequiredTexture(Image image, Texture2D texture)
  9. {
  10. if (image == null)
  11. {
  12. return;
  13. }
  14. if (texture != null)
  15. {
  16. image.image = texture;
  17. }
  18. else
  19. {
  20. image.parent?.Remove(image);
  21. }
  22. }
  23. internal static Texture2D MakeTexture(string assetFilename)
  24. {
  25. Texture2D texture = null;
  26. if (!string.IsNullOrEmpty(assetFilename))
  27. {
  28. var assetPath = $"{SettingsUIConstants.packageImageRoot}/{assetFilename}";
  29. texture = (Texture2D)AssetDatabase.LoadAssetAtPath(assetPath, typeof(Texture2D));
  30. }
  31. return texture;
  32. }
  33. }
  34. }