Skip to content

Commit e6aa7f4

Browse files
authored
Merge pull request #341 from De-Panther/gamma_error_message
Added error message if color space is not Gamma
2 parents 8b67291 + 118d640 commit e6aa7f4

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

Packages/webxr/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1010
- An option to auto-load WebXRManager on start in WebXRSettings.
1111
- An option to auto-load WebXRInputSystem on start in WebXRSettings.
1212
- Error message when there's no Universal Render Pipeline package in project.
13+
- Error message when Player Settings Color Space not set to Gamma.
1314

1415
## [0.20.0] - 2023-12-18
1516
### Added

Packages/webxr/Editor/WebXRBuildProcessor.cs

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
using System.Linq;
2-
32
using UnityEditor;
43
using UnityEditor.Build;
54
using UnityEditor.Build.Reporting;
5+
using UnityEngine;
66

77
namespace WebXR
88
{
9-
public class WebXRBuildProcessor : IPreprocessBuildWithReport, IPostprocessBuildWithReport
9+
public class WebXRBuildProcessor : AssetPostprocessor, IPreprocessBuildWithReport, IPostprocessBuildWithReport
1010
{
1111
/// <summary>Override of <see cref="IPreprocessBuildWithReport"/> and <see cref="IPostprocessBuildWithReport"/></summary>
1212
public int callbackOrder
@@ -79,13 +79,17 @@ public void OnPostprocessBuild(BuildReport report)
7979
CleanOldSettings();
8080
}
8181

82-
#if !HAS_URP
83-
[InitializeOnLoadMethod]
84-
private static void OnPostprocessAssets()
82+
static void OnPostprocessAllAssets(string[] importedAssets, string[] deletedAssets, string[] movedAssets, string[] movedFromAssetPaths, bool didDomainReload)
8583
{
86-
UnityEngine.Debug.LogError(@"WebXR Export requires Universal Render Pipeline,
84+
#if !HAS_URP
85+
Debug.LogError(@"WebXR Export requires Universal Render Pipeline,
8786
using Built-in Render Pipeline might cause issues.");
88-
}
8987
#endif
88+
if (PlayerSettings.colorSpace != ColorSpace.Gamma)
89+
{
90+
Debug.LogError(@"WebXR Export requires Gamma Color Space,
91+
using Linear Color Space might cause issues.");
92+
}
93+
}
9094
}
9195
}

0 commit comments

Comments
 (0)