using Assets.Scripts; using UnityEngine; using UnityEngine.EventSystems; using UnityEngine.UI; class GameRoomDownloadTask : MonoBehaviour { public GameObject btn; public Slider slider; public GameObject icon; private GameObject modal; public GameObject done; public GameObject doneTxt; public int RoomId { get; set; } private void Start() { UIManager.AddEvent(btn, EventTriggerType.PointerClick, (e) => { modal.SetActive(true); transform.parent.parent.parent.parent.gameObject.SetActive(false); //TODO: }); } public void Init(int roomId,GameObject parent) { RoomId = roomId; modal = parent; } public void UpdateProcess(float process) { slider.value = process; if (process >= 100) { done.SetActive(true); doneTxt.SetActive(true); icon.SetActive(false); slider.gameObject.SetActive(false); } } public void Dispose() { gameObject.SetActive(false); } }