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

public class ExportingController : MonoBehaviour {
    [SerializeField]
    private DeformationManager _deformationManager;
    [SerializeField]
    private Text _pathText;

    private string _exportPath;

    private void Start()
    {
        _exportPath = Path.Combine(Path.GetFullPath(Application.dataPath), "Exports");
        _pathText.text = "Export path: " + _exportPath;
    }

    public void Export()
    {
        
        ObjExporter.ExportToObj(_exportPath,
            _deformationManager.OriginalName,
            _deformationManager.ObjectToDeform.GetComponent<MeshFilter>(),
            1 / _deformationManager.ImportScale, // this allows to export file in its original size
            _deformationManager.Texture);
    }
}
