IMayRequireScreenPosition.cs 559 B

123456789101112131415161718
  1. using UnityEditor.Graphing;
  2. namespace UnityEditor.ShaderGraph
  3. {
  4. interface IMayRequireScreenPosition
  5. {
  6. bool RequiresScreenPosition(ShaderStageCapability stageCapability = ShaderStageCapability.All);
  7. }
  8. static class MayRequireScreenPositionExtensions
  9. {
  10. public static bool RequiresScreenPosition(this ISlot slot)
  11. {
  12. var mayRequireScreenPosition = slot as IMayRequireScreenPosition;
  13. return mayRequireScreenPosition != null && mayRequireScreenPosition.RequiresScreenPosition();
  14. }
  15. }
  16. }