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

public class CheckBottomOfModel : MonoBehaviour
{
    public Toggle checkBox1, checkBox2, checkBox3, checkBox4, checkBox5;
    public Renderer modelRen;
    [SerializeField] private RoscanModelUnity model;
    [SerializeField] private Shader shader1, shader2;
    public bool status = false;

    // initialization
    void Start()
    {
        modelRen = GetComponent<Renderer>();
        modelRen.material.shader = shader1;
    }

    /// <summary> Get the value, if the user wants to see bottom of the model</summary>
    public void GetUserChoose()
    {
        if (checkBox1 == null || checkBox2 == null || checkBox3 == null || checkBox4 == null || checkBox5 == null)
            return;

        if (checkBox1.isOn || checkBox2.isOn || checkBox3.isOn || checkBox4.isOn || checkBox5.isOn)
        {
            modelRen.material.shader = shader2;
            status = true;
        }
        else
        {
            modelRen.material.shader = shader1;
            status = false;
        }
    }
}
