feat: add project settings for UIParticle
parent
acebfb27f6
commit
72f5f9441b
|
@ -0,0 +1,28 @@
|
||||||
|
#pragma warning disable CS0414
|
||||||
|
using Coffee.UIParticleInternal;
|
||||||
|
using UnityEditor;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Coffee.UIExtensions
|
||||||
|
{
|
||||||
|
public class UIParticleProjectSettings : PreloadedProjectSettings<UIParticleProjectSettings>
|
||||||
|
{
|
||||||
|
[Header("Setting")]
|
||||||
|
[SerializeField]
|
||||||
|
internal bool m_EnableLinearToGamma = true;
|
||||||
|
|
||||||
|
public static bool enableLinearToGamma
|
||||||
|
{
|
||||||
|
get => instance.m_EnableLinearToGamma;
|
||||||
|
set => instance.m_EnableLinearToGamma = value;
|
||||||
|
}
|
||||||
|
|
||||||
|
#if UNITY_EDITOR
|
||||||
|
[SettingsProvider]
|
||||||
|
private static SettingsProvider CreateSettingsProvider()
|
||||||
|
{
|
||||||
|
return new PreloadedProjectSettingsProvider("Project/UI/UI Particle");
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,11 @@
|
||||||
|
fileFormatVersion: 2
|
||||||
|
guid: f22a23b9d98e440478697f4adf30e61c
|
||||||
|
MonoImporter:
|
||||||
|
externalObjects: {}
|
||||||
|
serializedVersion: 2
|
||||||
|
defaultReferences: []
|
||||||
|
executionOrder: 0
|
||||||
|
icon: {instanceID: 0}
|
||||||
|
userData:
|
||||||
|
assetBundleName:
|
||||||
|
assetBundleVariant:
|
|
@ -418,7 +418,7 @@ namespace Coffee.UIExtensions
|
||||||
_lastBounds = bounds;
|
_lastBounds = bounds;
|
||||||
|
|
||||||
// Convert linear color to gamma color.
|
// Convert linear color to gamma color.
|
||||||
if (canvas.ShouldGammaToLinearInMesh())
|
if (UIParticleProjectSettings.enableLinearToGamma && canvas.ShouldGammaToLinearInMesh())
|
||||||
{
|
{
|
||||||
workerMesh.LinearToGamma();
|
workerMesh.LinearToGamma();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue