From 50a4701c3784ddcb14f837ad39d3fbc897a5646c Mon Sep 17 00:00:00 2001 From: Lncvrt Date: Tue, 26 Aug 2025 17:39:45 -0700 Subject: [PATCH] Fix background color when using marketplace icon --- Assets/Scripts/GamePlayer.cs | 40 +++++++++++++++--------------------- 1 file changed, 17 insertions(+), 23 deletions(-) diff --git a/Assets/Scripts/GamePlayer.cs b/Assets/Scripts/GamePlayer.cs index 7f62c75..d42bd03 100644 --- a/Assets/Scripts/GamePlayer.cs +++ b/Assets/Scripts/GamePlayer.cs @@ -50,35 +50,29 @@ public class GamePlayer : MonoBehaviour void Start() { + var backgroundColor = BazookaManager.Instance.GetColorSettingBackground(); + Camera.main.backgroundColor = new Color( + int.Parse(backgroundColor[0].ToString()) / 255f, + int.Parse(backgroundColor[1].ToString()) / 255f, + int.Parse(backgroundColor[2].ToString()) / 255f + ); + var customIconData = BazookaManager.Instance.GetCustomBirdIconData(); SpriteRenderer component = bird.GetComponent(); if (customIconData.Selected == null) { - var backgroundColor = BazookaManager.Instance.GetColorSettingBackground(); var birdColor = BazookaManager.Instance.GetColorSettingIcon(); var overlayColor = BazookaManager.Instance.GetColorSettingOverlay(); - try - { - Camera.main.backgroundColor = new Color( - int.Parse(backgroundColor[0].ToString()) / 255f, - int.Parse(backgroundColor[1].ToString()) / 255f, - int.Parse(backgroundColor[2].ToString()) / 255f - ); - bird.GetComponent().color = new Color( - int.Parse(birdColor[0].ToString()) / 255f, - int.Parse(birdColor[1].ToString()) / 255f, - int.Parse(birdColor[2].ToString()) / 255f - ); - bird.transform.GetChild(0).GetComponent().color = new Color( - int.Parse(overlayColor[0].ToString()) / 255f, - int.Parse(overlayColor[1].ToString()) / 255f, - int.Parse(overlayColor[2].ToString()) / 255f - ); - } - catch - { - Debug.LogError("Invalid BackgroundColor format"); - } + bird.GetComponent().color = new Color( + int.Parse(birdColor[0].ToString()) / 255f, + int.Parse(birdColor[1].ToString()) / 255f, + int.Parse(birdColor[2].ToString()) / 255f + ); + bird.transform.GetChild(0).GetComponent().color = new Color( + int.Parse(overlayColor[0].ToString()) / 255f, + int.Parse(overlayColor[1].ToString()) / 255f, + int.Parse(overlayColor[2].ToString()) / 255f + ); int num = BazookaManager.Instance.GetBirdIcon(); int num2 = BazookaManager.Instance.GetBirdOverlay();