1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465 |
- 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<Image>();
- }
- 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<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();
- }
- }
|