using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using System.IO; public class TemplateImage : BaseTemPlate { private Image m_Image; protected override void OnEnable() { base.OnEnable(); if (GameManager.Instance.IsRuning && m_Image.sprite == null && Data != null) { DownloadManager.Instance.GetImage(Data, m_Image); } } protected override void OnAwake() { base.OnAwake(); m_Image = CacheTransform.Find("Canvas/Image").GetComponent(); HideCollider(); } public override void SetData(MaterialObjValue value, int updateTime) { base.SetData(value, updateTime); if (!GameManager.Instance.IsRuning) { //DownloadManager.Instance.AddDownloadData(Data); } else { DownloadManager.Instance.GetImage(Data, m_Image); } } public void SetLocaImageData(MaterialObjValue value) { m_Image.sprite = ResMgr.Instance.Load(value.DownloadPath); } public override void HideCollider() { base.HideCollider(); } }