IMayRequirePosition.cs 607 B

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