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 TemplateAdditionalDefinesHelper : TemplateAdditionalParentHelper
  8. {
  9. public TemplateAdditionalDefinesHelper() : base( "Additional Defines" )
  10. {
  11. m_helpBoxMessage = "Please add your defines without the #define 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.HasDefine( m_additionalItems[ i ] ) )
  18. dataCollector.AddToDefines( -1, m_additionalItems[ i ] );
  19. }
  20. for( int i = 0; i < m_outsideItems.Count; i++ )
  21. {
  22. if( !string.IsNullOrEmpty( m_outsideItems[ i ] ) && !nativesContainer.HasDefine( m_outsideItems[ i ] ) )
  23. dataCollector.AddToDefines( -1, m_outsideItems[ i ] );
  24. }
  25. }
  26. }
  27. }