IRequireVFXContext.cs 564 B

12345678910111213141516171819202122
  1. using UnityEditor.ShaderGraph;
  2. namespace UnityEditor.VFX
  3. {
  4. interface IRequireVFXContext
  5. {
  6. void ConfigureContextData(VFXContext context, VFXContextCompiledData data);
  7. }
  8. static class RequireVFXContextExtensions
  9. {
  10. public static bool TryConfigureContextData(this Target target, VFXContext context, VFXContextCompiledData data)
  11. {
  12. if (!(target is IRequireVFXContext vfxTarget))
  13. return false;
  14. vfxTarget.ConfigureContextData(context, data);
  15. return true;
  16. }
  17. }
  18. }