1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- 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<Image>();
- 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<Sprite>(value.DownloadPath);
- }
- public override void HideCollider()
- {
- base.HideCollider();
- }
- }
|