2023-03-28 13:16:30 -04:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
using TMPro;
|
|
|
|
using UnityEngine.UI;
|
|
|
|
using UnityEngine.Networking;
|
|
|
|
|
2023-05-13 23:01:48 -04:00
|
|
|
public class ModPrefab : MonoBehaviour
|
2023-03-28 13:16:30 -04:00
|
|
|
{
|
|
|
|
[SerializeField] public RawImage Screenshot;
|
|
|
|
[SerializeField] public TextMeshProUGUI Title;
|
|
|
|
[SerializeField] public TextMeshProUGUI Date;
|
|
|
|
[SerializeField] public TextMeshProUGUI Author;
|
|
|
|
[SerializeField] public TextMeshProUGUI Description;
|
|
|
|
[SerializeField] public string ModID;
|
2023-05-18 21:28:45 -04:00
|
|
|
[SerializeField] public GameObject GO;
|
|
|
|
[SerializeField] public RPGCreationKit.ButtonSounds BS;
|
2023-03-28 13:16:30 -04:00
|
|
|
|
|
|
|
public void LoadSS(string imagePath) {
|
|
|
|
StartCoroutine(LoadCurrentImageX(imagePath));
|
|
|
|
}
|
|
|
|
|
|
|
|
IEnumerator LoadCurrentImageX(string imagePath) {
|
|
|
|
UnityWebRequest WWW = UnityWebRequestTexture.GetTexture(imagePath);
|
|
|
|
yield return WWW.SendWebRequest();
|
|
|
|
if (WWW.result != UnityWebRequest.Result.ConnectionError) {
|
|
|
|
Screenshot.texture = DownloadHandlerTexture.GetContent(WWW);
|
|
|
|
Screenshot.SetNativeSize();
|
|
|
|
Screenshot.SizeToParent();
|
|
|
|
}
|
|
|
|
WWW.Dispose();
|
|
|
|
}
|
2023-05-18 21:28:45 -04:00
|
|
|
|
|
|
|
public void Selected() {
|
|
|
|
ModPanal MP = GO.GetComponent<ModPanal>();
|
|
|
|
MP.ActivateMod(ModID);
|
|
|
|
}
|
2023-03-28 13:16:30 -04:00
|
|
|
}
|