private Text _txtDesc; //解包或者下载描述 #endregion #region Methods private void Awake() { MessageArray = new string[] { NotifyName.UnpackOrDownload, NotifyName.UnpackTotolCount, NotifyName.UnpackUpdate, NotifyName.DownloadTotolBytes, NotifyName.DownloadUpdate, NotifyName.DownloadSpeed, }; RemoveMessage(this, MessageArray); RegisterMessage(this, MessageArray); if (null != _downloadAndUnpackDesc) { return; } _downloadText = Resources.Load <TextAsset>(DownloadDesc); _downloadAndUnpackDesc = JsonMapper.ToObject <DownloadAndUnpackDesc>(_downloadText.text); _downloadingNotifyQueue = new Queue <object>(); _progressNotifyQueue = new Queue <object>(); _slider = transform.Find("Slider").GetComponent <Slider>(); _txtDesc = transform.Find("TxtDesc").GetComponent <Text>(); }
/// <summary> /// 析构函数 /// </summary> private void OnDestroy() { if (null != _downloadText) { Resources.UnloadAsset(_downloadText); _downloadText = null; } _downloadAndUnpackDesc = null; }