TextureArraySettings.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System.Collections.Generic;
  2. using UnityEngine;
  3. namespace MTE
  4. {
  5. /// <summary>
  6. /// Specifies textures and other required parameters when creating <see cref="Texture2DArray"/>.
  7. /// </summary>
  8. #if UNITY_EDITOR
  9. [CreateAssetMenu(fileName = "NewTextureArraySettings.asset",
  10. menuName = "Mesh Terrain Editor/TextureArraySettings")]
  11. [UnityEngine.Scripting.APIUpdating.MovedFrom("PBRTextureArraySettings")]
  12. #endif
  13. public class TextureArraySettings : ScriptableObject
  14. {
  15. [HideInInspector]
  16. public TextureArrayMode textureMode = TextureArrayMode.PBR;
  17. [HideInInspector]
  18. public string TextureArrayName = "NewTexture2DArray";
  19. [HideInInspector]
  20. public TextureFormat TextureFormat = TextureFormat.RGBA32;
  21. [HideInInspector]
  22. public int TextureSize = 512;
  23. [HideInInspector]
  24. public List<TextureLayer> Layers = new List<TextureLayer>(12);
  25. public const string ColorArrayPostfix = "_Color";
  26. public const string NormalArrayPostfix = "_Normal";
  27. public const string AlbedoArrayPostfix = "_Albedo";
  28. public const string RoughnessNormalAOArrayPostfix = "_RoughnessNormalAO";
  29. public const int MinLayerNumber = 2;
  30. public const int MaxLayerNumber = 12;
  31. }
  32. public enum TextureArrayMode
  33. {
  34. Color,
  35. ColorAndNormal,
  36. PBR,
  37. }
  38. }