@@ -498,26 +498,19 @@ internal static bool TryGetVolumeParameterSource<T>(
498498 /// <summary>
499499 /// Shows a platform-specific performance warning help box for a given feature.
500500 /// </summary>
501- /// <param name="targetPlatform">The build target platform to check and display</param>
502501 /// <param name="featureName">The name of the feature (e.g., "Ray Tracing", "Film Grain")</param>
503502 /// <param name="recommendation">Optional recommendation text. If null, uses default "is not recommended for this platform"</param>
504- internal static void ShowPlatformPerformanceWarning ( BuildTarget targetPlatform , string featureName , string recommendation = null )
503+ internal static void ShowFeatureOptimisationWarning ( string featureName , string recommendation = null )
505504 {
506- if ( EditorUserBuildSettings . activeBuildTarget != targetPlatform )
507- return ;
508-
509- var activeBuildTargetGroup = BuildPipeline . GetBuildTargetGroup ( targetPlatform ) ;
510- var namedBuildTarget = NamedBuildTarget . FromBuildTargetGroup ( activeBuildTargetGroup ) ;
511-
512- string message = $ "{ featureName } is enabled for { namedBuildTarget . TargetName } . ";
505+ string message = $ "{ featureName } is enabled for the active platform.\n ";
513506
514507 if ( ! string . IsNullOrEmpty ( recommendation ) )
515508 {
516509 message += recommendation ;
517510 }
518511 else
519512 {
520- message += " \n This may significantly impact performance and is not recommended for this platform." ;
513+ message += HDRenderPipelineUI . Styles . featureNotRecommendedWarning ;
521514 }
522515
523516 EditorGUILayout . HelpBox ( message , MessageType . Warning , wide : true ) ;
@@ -526,26 +519,19 @@ internal static void ShowPlatformPerformanceWarning(BuildTarget targetPlatform,
526519 /// <summary>
527520 /// Shows a platform-specific performance warning help box for a given feature.
528521 /// </summary>
529- /// <param name="targetPlatform">The build target platform to check and display</param>
530522 /// <param name="featureName">The name of the feature (e.g., "Ray Tracing", "Film Grain")</param>
531523 /// <param name="recommendation">Optional recommendation text. If null, uses default "is not recommended for this platform"</param>
532- internal static void ShowPlatformPerformanceWarning ( BuildTarget targetPlatform , string featureName , string sourceAssetName , Action onButtonClicked , string recommendation = null )
524+ internal static void ShowFeatureOptimisationWarning ( string featureName , string sourceAssetName , Action onButtonClicked , string recommendation = null )
533525 {
534- if ( EditorUserBuildSettings . activeBuildTarget != targetPlatform )
535- return ;
536-
537- var activeBuildTargetGroup = BuildPipeline . GetBuildTargetGroup ( targetPlatform ) ;
538- var namedBuildTarget = NamedBuildTarget . FromBuildTargetGroup ( activeBuildTargetGroup ) ;
539-
540- string message = $ "{ featureName } is enabled in { sourceAssetName } for { namedBuildTarget . TargetName } . ";
526+ string message = $ "{ featureName } is enabled in { sourceAssetName } for the active platform.\n ";
541527
542528 if ( ! string . IsNullOrEmpty ( recommendation ) )
543529 {
544530 message += recommendation ;
545531 }
546532 else
547533 {
548- message += " \n This may significantly impact performance and is not recommended for this platform." ;
534+ message += HDRenderPipelineUI . Styles . featureNotRecommendedWarning ;
549535 }
550536
551537 CoreEditorUtils . DrawFixMeBox (
@@ -555,54 +541,32 @@ internal static void ShowPlatformPerformanceWarning(BuildTarget targetPlatform,
555541 onButtonClicked ) ;
556542 }
557543
558- /// <summary>
559- /// Shows a platform-specific performance warning help box for a given setting within a feature.
560- /// </summary>
561- /// <param name="targetPlatform">The build target platform to check and display</param>
562- /// <param name="settingName">The name of the setting responsible for the performance warning in the feature.</param>
563- /// <param name="settingValue">The current value of the setting.</param>
564- /// <param name="recommendation">Optional recommendation text. If null, uses default "is not recommended for this platform"</param>
565- internal static void ShowPlatformParameterPerformanceWarning ( BuildTarget targetPlatform , string settingName , string settingValue , string recommendation = null )
544+ internal static void ShowFeatureParameterOptimisationWarning ( string settingName , string settingValue , string recommendation = null )
566545 {
567- if ( EditorUserBuildSettings . activeBuildTarget != targetPlatform )
568- return ;
569-
570- var activeBuildTargetGroup = BuildPipeline . GetBuildTargetGroup ( targetPlatform ) ;
571- var namedBuildTarget = NamedBuildTarget . FromBuildTargetGroup ( activeBuildTargetGroup ) . TargetName ;
546+ EditorGUILayout . HelpBox ( CreateParameterWarningMessage ( settingName , settingValue , null , recommendation ) , MessageType . Warning , wide : true ) ;
547+ }
572548
573- string message = $ "{ settingName } : { settingValue } is used for { namedBuildTarget } .";
549+ internal static void ShowFeatureParameterOptimisationWarning ( string settingName , string settingValue , string sourceAssetName , Action onButtonClicked , string recommendation = null )
550+ {
551+ CoreEditorUtils . DrawFixMeBox (
552+ CreateParameterWarningMessage ( settingName , settingValue , sourceAssetName , recommendation ) ,
553+ MessageType . Warning ,
554+ "Open" ,
555+ onButtonClicked ) ;
556+ }
574557
575- if ( ! string . IsNullOrEmpty ( recommendation ) )
558+ internal static string CreateParameterWarningMessage ( string settingName , string settingValue , string sourceAssetName = null , string recommendation = null )
559+ {
560+ string message = $ "{ settingName } : { settingValue } ";
561+ if ( sourceAssetName != null )
576562 {
577- message += ' \n ' + recommendation ;
563+ message += $ "is set in { sourceAssetName } ." ;
578564 }
579565 else
580566 {
581- message += " \n This may significantly impact performance and is not recommended for this platform.";
567+ message += $ " is used for the active platform.";
582568 }
583569
584- EditorGUILayout . HelpBox ( message , MessageType . Warning , wide : true ) ;
585- }
586-
587- /// <summary>
588- /// Shows a platform-specific performance warning help box for a given setting within a feature.
589- /// </summary>
590- /// <param name="targetPlatform">The build target platform to check and display</param>
591- /// <param name="settingName">The name of the setting responsible for the performance warning in the feature.</param>
592- /// <param name="settingValue">The current value of the setting.</param>
593- /// <param name="sourceAssetName">The name of the asset responsible for producing this warning.</param>
594- /// <param name="onButtonClicked">Action to perform when the helpbox button is clicked.</param>
595- /// <param name="recommendation">Optional recommendation text. If null, uses default "is not recommended for this platform"</param>
596- internal static void ShowPlatformParameterPerformanceWarning ( BuildTarget targetPlatform , string settingName , string settingValue , string sourceAssetName , Action onButtonClicked , string recommendation = null )
597- {
598- if ( EditorUserBuildSettings . activeBuildTarget != targetPlatform )
599- return ;
600-
601- var activeBuildTargetGroup = BuildPipeline . GetBuildTargetGroup ( targetPlatform ) ;
602- var namedBuildTarget = NamedBuildTarget . FromBuildTargetGroup ( activeBuildTargetGroup ) . TargetName ;
603-
604- string message = $ "{ settingName } : { settingValue } is set in { sourceAssetName } for { namedBuildTarget } . ";
605-
606570 if ( ! string . IsNullOrEmpty ( recommendation ) )
607571 {
608572 message += '\n ' + recommendation ;
@@ -612,11 +576,7 @@ internal static void ShowPlatformParameterPerformanceWarning(BuildTarget targetP
612576 message += $ "\n This may impact performance and is not recommended for this platform.";
613577 }
614578
615- CoreEditorUtils . DrawFixMeBox (
616- message ,
617- MessageType . Warning ,
618- "Open" ,
619- onButtonClicked ) ;
579+ return message ;
620580 }
621581
622582 internal static bool IsInTestSuiteOrBatchMode ( )
0 commit comments