IMayRequireViewDirection.cs 652 B

12345678910111213141516171819
  1. using UnityEditor.Graphing;
  2. using UnityEditor.ShaderGraph.Internal;
  3. namespace UnityEditor.ShaderGraph
  4. {
  5. interface IMayRequireViewDirection
  6. {
  7. NeededCoordinateSpace RequiresViewDirection(ShaderStageCapability stageCapability = ShaderStageCapability.All);
  8. }
  9. static class MayRequireViewDirectionExtensions
  10. {
  11. public static NeededCoordinateSpace RequiresViewDirection(this ISlot slot)
  12. {
  13. var mayRequireViewDirection = slot as IMayRequireViewDirection;
  14. return mayRequireViewDirection != null ? mayRequireViewDirection.RequiresViewDirection() : NeededCoordinateSpace.None;
  15. }
  16. }
  17. }