You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

31 lines
1.0 KiB

  1. // Amplify Shader Editor - Visual Shader Editing Tool
  2. // Copyright (c) Amplify Creations, Lda <info@amplify.pt>
  3. using System;
  4. namespace AmplifyShaderEditor
  5. {
  6. [Serializable]
  7. public class TemplateAdditionalPragmasHelper : TemplateAdditionalParentHelper
  8. {
  9. public TemplateAdditionalPragmasHelper() : base( "Additional Pragmas" )
  10. {
  11. m_helpBoxMessage = "Please add your pragmas without the #pragma keywords";
  12. }
  13. public override void AddToDataCollector( ref MasterNodeDataCollector dataCollector, TemplateIncludePragmaContainter nativesContainer )
  14. {
  15. for( int i = 0; i < m_additionalItems.Count; i++ )
  16. {
  17. if( !string.IsNullOrEmpty( m_additionalItems[ i ] ) && !nativesContainer.HasPragma( m_additionalItems[ i ] ))
  18. dataCollector.AddToPragmas( -1, m_additionalItems[ i ] );
  19. }
  20. for( int i = 0; i < m_outsideItems.Count; i++ )
  21. {
  22. if( !string.IsNullOrEmpty( m_outsideItems[ i ] ) && !nativesContainer.HasPragma( m_outsideItems[ i ] ) )
  23. dataCollector.AddToPragmas( -1, m_outsideItems[ i ] );
  24. }
  25. }
  26. }
  27. }