VFXExpressionSampleTextureCubeArray.cs 1.1 KB

123456789101112131415161718192021222324252627
  1. using System;
  2. using System.Linq;
  3. using System.Runtime.CompilerServices;
  4. using UnityEngine;
  5. using UnityEngine.VFX;
  6. namespace UnityEditor.VFX
  7. {
  8. class VFXExpressionSampleTextureCubeArray : VFXExpression
  9. {
  10. public VFXExpressionSampleTextureCubeArray() : this(VFXTextureCubeValue.Default, VFXValue<Vector3>.Default, VFXValue<float>.Default, VFXValue<float>.Default)
  11. {
  12. }
  13. public VFXExpressionSampleTextureCubeArray(VFXExpression texture, VFXExpression uv, VFXExpression slice, VFXExpression mipLevel)
  14. : base(Flags.InvalidOnCPU, new VFXExpression[4] { texture, uv, slice, mipLevel })
  15. { }
  16. sealed public override VFXExpressionOperation operation { get { return VFXExpressionOperation.None; } }
  17. sealed public override VFXValueType valueType { get { return VFXValueType.Float4; } }
  18. public sealed override string GetCodeString(string[] parents)
  19. {
  20. return string.Format("SampleTexture(VFX_SAMPLER({0}),{1},{2},{3})", parents[0], parents[1], parents[2], parents[3]);
  21. }
  22. }
  23. }