private void OnDestroy() { this.m_BannerImage = null; this.m_AllLoadImageInfo = null; Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.BannerImage_HoldStart, new CUIEventManager.OnUIEventHandler(this.OnHoldStart_Item)); Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.BannerImage_HoldEnd, new CUIEventManager.OnUIEventHandler(this.OnHoldEnd_Item)); Singleton <CUIEventManager> .GetInstance().RemoveUIEventListener(enUIEventID.BannerImage_ClickItem, new CUIEventManager.OnUIEventHandler(this.BannerImage_OnClickItem)); }
public bool InitSys() { this.m_BannerImage = MonoSingleton <BannerImageSys> .GetInstance().GetCurBannerImage(); if (this.m_BannerImage == null) { return(false); } long num = (long)CRoleInfo.GetCurrentUTCTime(); int num2 = 0; ListView <BannerImageSys.BannerImageInfo> listView = new ListView <BannerImageSys.BannerImageInfo>(); for (int i = 0; i < this.m_BannerImage.ImageListCount; i++) { BannerImageSys.BannerImageInfo bannerImageInfo = this.m_BannerImage.m_ImageInfoList[i]; if (bannerImageInfo != null && bannerImageInfo.imgLoadSucc && this.checkImageType((BannerImageSys.BannerType)bannerImageInfo.resImgInfo.dwBannerType) && bannerImageInfo.resImgInfo.dwLocation == (uint)this.m_DisplayPosition && (ulong)bannerImageInfo.resImgInfo.dwStartTime < (ulong)num && (ulong)bannerImageInfo.resImgInfo.dwEndTime >= (ulong)num) { listView.Add(bannerImageInfo); num2++; } } if (num2 > 0) { if (listView != null) { this.m_AllLoadImageInfo = new BannerImageSys.BannerImageInfo[listView.get_Count()]; for (int j = 0; j < listView.get_Count(); j++) { this.m_AllLoadImageInfo[j] = listView.get_Item(j); } } Array.Sort <BannerImageSys.BannerImageInfo>(this.m_AllLoadImageInfo, new Comparison <BannerImageSys.BannerImageInfo>(BannerImageSys.ComparebyShowIdx)); Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.BannerImage_HoldStart, new CUIEventManager.OnUIEventHandler(this.OnHoldStart_Item)); Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.BannerImage_HoldEnd, new CUIEventManager.OnUIEventHandler(this.OnHoldEnd_Item)); Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.BannerImage_ClickItem, new CUIEventManager.OnUIEventHandler(this.BannerImage_OnClickItem)); CUIStepListScript uIListScript = this.m_UIListScript; uIListScript.SetDontUpdate(true); uIListScript.SetElementAmount(num2); this.m_PickIdxList = new int[num2]; this.InitPickObjElement(num2); this.EnablePickObj(0); this.LoadBannerImage(); this.m_bUpdateStart = true; this.m_fBeginTime = Time.time; return(true); } Debug.Log("not valide bannerImage"); return(false); }
public bool InitSys() { this.m_BannerImage = MonoSingleton <BannerImageSys> .GetInstance().GetCurBannerImage(); if (this.m_BannerImage != null) { long currentUTCTime = CRoleInfo.GetCurrentUTCTime(); int amount = 0; ListView <BannerImageSys.BannerImageInfo> view = new ListView <BannerImageSys.BannerImageInfo>(); for (int i = 0; i < this.m_BannerImage.ImageListCount; i++) { BannerImageSys.BannerImageInfo item = this.m_BannerImage.m_ImageInfoList[i]; if ((((item != null) && item.imgLoadSucc) && (this.checkImageType((BannerImageSys.BannerType)item.resImgInfo.dwBannerType) && (((BannerImageSys.BannerPosition)item.resImgInfo.dwLocation) == this.m_DisplayPosition))) && ((item.resImgInfo.dwStartTime < currentUTCTime) && (item.resImgInfo.dwEndTime >= currentUTCTime))) { view.Add(item); amount++; } } if (amount > 0) { if (view != null) { this.m_AllLoadImageInfo = new BannerImageSys.BannerImageInfo[view.Count]; for (int j = 0; j < view.Count; j++) { this.m_AllLoadImageInfo[j] = view[j]; } } Array.Sort <BannerImageSys.BannerImageInfo>(this.m_AllLoadImageInfo, new Comparison <BannerImageSys.BannerImageInfo>(BannerImageSys.ComparebyShowIdx)); Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.BannerImage_HoldStart, new CUIEventManager.OnUIEventHandler(this.OnHoldStart_Item)); Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.BannerImage_HoldEnd, new CUIEventManager.OnUIEventHandler(this.OnHoldEnd_Item)); Singleton <CUIEventManager> .GetInstance().AddUIEventListener(enUIEventID.BannerImage_ClickItem, new CUIEventManager.OnUIEventHandler(this.BannerImage_OnClickItem)); CUIStepListScript uIListScript = this.m_UIListScript; uIListScript.SetDontUpdate(true); uIListScript.SetElementAmount(amount); this.m_PickIdxList = new int[amount]; this.InitPickObjElement(amount); this.EnablePickObj(0); this.LoadBannerImage(); this.m_bUpdateStart = true; this.m_fBeginTime = Time.time; return(true); } Debug.Log("not valide bannerImage"); } return(false); }
public void ClearSeverData() { this.m_BannerImage = null; this.m_CDNUrlMgr.Clear(); }