Skip to content

Commit

Permalink
Merge pull request #341 from De-Panther/gamma_error_message
Browse files Browse the repository at this point in the history
Added error message if color space is not Gamma
  • Loading branch information
De-Panther authored Jan 16, 2024
2 parents 8b67291 + 118d640 commit e6aa7f4
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 7 deletions.
1 change: 1 addition & 0 deletions Packages/webxr/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- An option to auto-load WebXRManager on start in WebXRSettings.
- An option to auto-load WebXRInputSystem on start in WebXRSettings.
- Error message when there's no Universal Render Pipeline package in project.
- Error message when Player Settings Color Space not set to Gamma.

## [0.20.0] - 2023-12-18
### Added
Expand Down
18 changes: 11 additions & 7 deletions Packages/webxr/Editor/WebXRBuildProcessor.cs
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
using System.Linq;

using UnityEditor;
using UnityEditor.Build;
using UnityEditor.Build.Reporting;
using UnityEngine;

namespace WebXR
{
public class WebXRBuildProcessor : IPreprocessBuildWithReport, IPostprocessBuildWithReport
public class WebXRBuildProcessor : AssetPostprocessor, IPreprocessBuildWithReport, IPostprocessBuildWithReport
{
/// <summary>Override of <see cref="IPreprocessBuildWithReport"/> and <see cref="IPostprocessBuildWithReport"/></summary>
public int callbackOrder
Expand Down Expand Up @@ -79,13 +79,17 @@ public void OnPostprocessBuild(BuildReport report)
CleanOldSettings();
}

#if !HAS_URP
[InitializeOnLoadMethod]
private static void OnPostprocessAssets()
static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths, bool didDomainReload)
{
UnityEngine.Debug.LogError(@"WebXR Export requires Universal Render Pipeline,
#if !HAS_URP
Debug.LogError(@"WebXR Export requires Universal Render Pipeline,
using Built-in Render Pipeline might cause issues.");
}
#endif
if (PlayerSettings.colorSpace != ColorSpace.Gamma)
{
Debug.LogError(@"WebXR Export requires Gamma Color Space,
using Linear Color Space might cause issues.");
}
}
}
}

0 comments on commit e6aa7f4

Please sign in to comment.