using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class ImageColor : MonoBehaviour
{
    [SerializeField] private GameObject Panel1;
    [SerializeField] private Button button;
    private ColorBlock ButtonColor;

    /// <summary> On the start of the game find the status of Surface panel and then change the color of the Surface button </summary>
    private void Start()
    {
        if (Panel1 != null)
        {
            ButtonColor = button.colors;
            bool isActive = Panel1.activeSelf;
            if (isActive)
            {
                ButtonColor.normalColor = new Color32(22, 196, 207, 255);
            }
            else
            {
                ButtonColor.normalColor = new Color32(255, 255, 255, 255);
            }
            button.colors = ButtonColor;      
        }
    }
}
