Singularity/Assets/Scripts/DownloadFilePrefab.cs
2024-05-06 11:45:45 -07:00

32 lines
696 B
C#

using TMPro;
using UnityEngine;
public class DownloadFilePrefab : MonoBehaviour
{
[SerializeField] public TextMeshProUGUI Title;
[SerializeField] public TextMeshProUGUI Info;
private string URL;
private string FileName;
private DownloadMod DM;
public void FillMe(string title, string info, string url, DownloadMod dm, string fileName = "") {
Title.text = title;
Info.text = $"Download ({info})";
if (info == "X") {
Info.text = "Premium Access";
Title.text = $"Download from {title}";
}
URL = url;
DM = dm;
FileName = fileName;
}
public void Download() {
string Temp = Title.text;
if (FileName != "") {
Temp = FileName;
}
DM.DownloadFile(URL, Temp);
}
}