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

public class GetFilesinformations : MonoBehaviour
{
    [SerializeField] private RoscanModelUnity model;
    [SerializeField] private Text text;
    [SerializeField] private Button button;
    [SerializeField] private Button[] changeButton;
    [SerializeField] private Text[] textNames;

    /// <summary> By chose the path hide the button and unhide the text with name of file </summary>
    public void getName ()
    {
        if (model.path == null)
            return;
        text.enabled = true;
        text.text = Path.GetFileName(model.path);
        button.gameObject.SetActive(false);
    }

    /// <summary> By chose the path hide the button and unhide the text with name of file MEASURMENT </summary>
    public void getNameMeas()
    {
        if (model.pathMeas == null)
            return;
        text.enabled = true;
        text.text = Path.GetFileName(model.pathMeas);
        button.gameObject.SetActive(false);
    }

    /// <summary> Reset all the settings </summary>
    public void turnButton()
    {
        foreach(var i in changeButton)
        {
            i.gameObject.SetActive(true);
        }
        foreach(var i in textNames)
        {
            i.enabled = false;
        }
    }

}
