public InstallAppDetail ShallowCopy() { InstallAppDetail other = (InstallAppDetail)this.MemberwiseClone(); other.myOriginalDetail = this; return(other); }
public override void ResetData() { StopAllCoroutines(); CancelInvoke(); actionCountDown = null; actionShowTxtEff = null; LeanTween.cancel(imgIconGame.rectTransform); LeanTween.cancel(panelFocus.rectTransform); appDetail = null; txtInfo_Title.text = string.Empty; txtInfo_Description.text = string.Empty; txtReward_CountDown.text = string.Empty; txtInfo_KeyWork.text = string.Empty; txtReward_Quantity.text = string.Empty; txtEffCountDown.text = string.Empty; txtReward_CountDown.rectTransform.rotation = Quaternion.identity; txtReward_CountDown.rectTransform.localScale = Vector3.one; txtReward_CountDown.color = Color.black; Color _c = imgIconGame.color; _c.a = 0f; imgIconGame.color = _c; _c = panelFocus.color; _c.a = 0f; panelFocus.color = _c; checkAppInstallOrNot = false; }
IEnumerator DoActionClearAndCreateNewPanelAppInfo(InstallAppDetail _currentAppDetail) { int _tmpIndexOfCurrentAppDetail = listCurrentAppDetail.IndexOf(_currentAppDetail); mainScrollRect.ClearCells(); yield return(Yielders.EndOfFrame); if (listCurrentAppDetail != null && listCurrentAppDetail.Count > 0) { listCurrentAppDetail.Clear(); } RefreshData(); yield return(null); if (listCurrentAppDetail != null && listCurrentAppDetail.Count > 0) { if (_tmpIndexOfCurrentAppDetail >= listCurrentAppDetail.Count - 1) { _tmpIndexOfCurrentAppDetail = listCurrentAppDetail.Count - 1; } } else { _tmpIndexOfCurrentAppDetail = 0; } mainScrollRect.SrollToCell(_tmpIndexOfCurrentAppDetail, 10000f); }
public bool IsEqual(InstallAppDetail _other) { if (packageName.Equals(_other.packageName)) { return(true); } return(false); }
void GetListAppFromServer(System.Action _onFinished = null) { OneHitAPI.GetListCampagneInstallAndroid((_messageReceiving, _error) => { if (_messageReceiving != null) { short _numberCampagne = _messageReceiving.readShort(); List <InstallAppDetail> _newListInstallApp = new List <InstallAppDetail>(); bool _canAddToList = false; for (int i = 0; i < _numberCampagne; i++) { InstallAppDetail _detail = new InstallAppDetail(_messageReceiving); _canAddToList = true; for (int j = 0; j < DataManager.instance.installAppData.listAppDone.Count; j++) { if (DataManager.instance.installAppData.listAppDone[j].IsEqual(_detail)) { _canAddToList = false; break; } } if (_canAddToList) { _newListInstallApp.Add(_detail); } } DataManager.instance.installAppData.listCurrentAppDetail = _newListInstallApp; // for(int i = 0; i < 1000; i++){ // DataManager.instance.installAppData.listCurrentAppDetail.Add(DataManager.instance.installAppData.listCurrentAppDetail[0]); // } DataManager.instance.installAppData.nextTimeToGetDataFromSever = System.DateTime.Now.AddHours(1); if (currentState == State.Show) { if (_onFinished != null) { _onFinished(); } } } else { #if TEST Debug.LogError("GetListCampagneInstallAndroid is Error: " + _error); #endif } }); }
public void InitData(InstallAppDetail _appDetail) { appDetail = _appDetail; txtInfo_Title.text = appDetail.textTitle; txtInfo_Description.text = appDetail.textDescription; txtInfo_Description.text = appDetail.textDescription.Replace("\\n", "\n"); if (!string.IsNullOrEmpty(appDetail.textkeySearch)) { txtInfo_KeyWork.text = "🔎" + appDetail.textkeySearch; } else { txtInfo_KeyWork.text = string.Empty; } txtReward_Quantity.text = appDetail.reward.quantity.ToString(); if (appDetail.myIcon == null) { StartCoroutine(MyConstant.DownloadIcon(appDetail.linkIcon, (_texture) => { if (_texture != null) { appDetail.myIcon = _texture; } imgIconGame.texture = appDetail.myIcon; LeanTween.alpha(imgIconGame.rectTransform, 1f, 0.2f); if (appDetail.myOriginalDetail != null) { if (_texture != null) { appDetail.myOriginalDetail.myIcon = _texture; } } })); } else { imgIconGame.texture = appDetail.myIcon; Color _c = imgIconGame.color; _c.a = 1f; imgIconGame.color = _c; } txtEffCountDown.text = string.Empty; RefreshData(); }
public void ClearAndCreateNewPanelAppInfo(InstallAppDetail _currentAppDetail) { StartCoroutine(DoActionClearAndCreateNewPanelAppInfo(_currentAppDetail)); }