feat: adaptive scaling for UI

Changing the canvas size does not affect the effect size or position.
This feature provides a constant-looking output and makes it easier to adjust effects.
BREAKING CHANGE: If you update to v4, you may be required to adjust your UIParticle.scale.
This commit is contained in:
mob-sakai
2022-06-09 01:47:48 +09:00
parent c6644a2132
commit aa0d56f9fa
2 changed files with 10 additions and 1 deletions

View File

@@ -212,6 +212,10 @@ namespace Coffee.UIExtensions
public void UpdateRenderers()
{
var newScale = Vector3.one;
//if (uiScaling)
{
newScale = transform.parent.lossyScale.Inverse();
}
if (transform.localScale != newScale)
{
transform.localScale = newScale;