From d93cacc70d066291bba179f8e750c7118d7024e8 Mon Sep 17 00:00:00 2001 From: mob-sakai <12690315+mob-sakai@users.noreply.github.com> Date: Wed, 24 Jun 2026 12:16:46 +0900 Subject: [PATCH] fix: rename `UIParticleProjectSettings.enableLinearToGamma` to `autoColorCorrection` --- README.md | 18 ++++++++++++++++-- Runtime/UIParticleProjectSettings.cs | 11 +++++++---- Runtime/UIParticleRenderer.cs | 2 +- 3 files changed, 24 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 5e7db7f..e670f52 100644 --- a/README.md +++ b/README.md @@ -195,6 +195,10 @@ and z-position. 2. Adjust the ParticleSystem as you like. ![particle1](https://user-images.githubusercontent.com/12690315/95007359-ca385200-0649-11eb-8383-627c9750bda8.png) +> [!Tips] +> Adding a `UIParticle` to the parent is the recommended setup rather than attaching it directly to the `ParticleSystem`. +> When using `ParticleSystem.emission.rateOverDistance`, it is recommended to move the transform of `UIParticle` rather than the `ParticleSystem`. +
### Usage with Your Existing ParticleSystem Prefab @@ -260,9 +264,19 @@ uiParticle.Stop(); ### Project Settings -![](https://github.com/user-attachments/assets/befc7f34-fb47-4006-831a-eba79fda11ca) +You can adjust the project-wide settings for `UI Particle`. (`Edit > Project Settings > UI > UI Particle`) -- Click `Edit > Project Settings` to open the Project Settings window and then select `UI > UI Particle` category. +![](https://github.com/mob-sakai/mob-sakai/releases/download/docs/1782270746550.png) + +#### Settings + +- **Enable Linear To Gamma**: Automatically correct the color space of the mesh. + +#### Editor + +- **Hide Generated Component**: Automatically hide the generated `UIParticleRenderer` component and `UIParticle BakingCamera`. + +- **Preview On Select**: When selecting UIParticle, a temporary ParticleSystem is generated for preview.

diff --git a/Runtime/UIParticleProjectSettings.cs b/Runtime/UIParticleProjectSettings.cs index 3bd96c2..3b61337 100644 --- a/Runtime/UIParticleProjectSettings.cs +++ b/Runtime/UIParticleProjectSettings.cs @@ -2,6 +2,7 @@ using Coffee.UIParticleInternal; using UnityEditor; using UnityEngine; +using UnityEngine.Serialization; namespace Coffee.UIExtensions { @@ -9,12 +10,14 @@ namespace Coffee.UIExtensions { [Header("Setting")] [SerializeField] - internal bool m_EnableLinearToGamma = true; + [Tooltip("Automatically correct the color space of the mesh.")] + [FormerlySerializedAs("m_EnableLinearToGamma")] + private bool m_AutoColorCorrection = true; - public static bool enableLinearToGamma + public static bool autoColorCorrection { - get => instance.m_EnableLinearToGamma; - set => instance.m_EnableLinearToGamma = value; + get => instance.m_AutoColorCorrection; + set => instance.m_AutoColorCorrection = value; } diff --git a/Runtime/UIParticleRenderer.cs b/Runtime/UIParticleRenderer.cs index f6c0162..a26c562 100644 --- a/Runtime/UIParticleRenderer.cs +++ b/Runtime/UIParticleRenderer.cs @@ -444,7 +444,7 @@ namespace Coffee.UIExtensions _lastBounds = bounds; // Convert linear color to gamma color. - if (UIParticleProjectSettings.enableLinearToGamma && canvas.ShouldGammaToLinearInMesh()) + if (UIParticleProjectSettings.autoColorCorrection && canvas.ShouldGammaToLinearInMesh()) { workerMesh.LinearToGamma(); }