using System.Collections; using System.Collections.Generic; using UnityEngine; using UnityEngine.UI; using System.IO; public class TemplateImage : BaseTemPlate { private Image m_Image; public Image M_Image { get { if(m_Image ==null) { m_Image = CacheTransform.Find("Canvas/Image").GetComponent(); } return m_Image; } set { } } 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(); } }