private IEnumerator DoShowBtnRoot(float t, GameResData heroResData) { yield return(new WaitForSeconds(t)); btn_root.SetActive(true); CommonFadeInAnimation fadeIn = btn_root.AddComponent <CommonFadeInAnimation>(); fadeIn.set(0.25f, 0); // if (heroResData != null) // { // bool hasShowHeroDisplayView = ShowHeroDisplayView(heroResData); // if (!hasShowHeroDisplayView) // { // Observers.Facade.Instance.SendNotification(string.Format("{0}::{1}", PREFAB_PATH, "OnViewStay")); // } // } // else // { // Observers.Facade.Instance.SendNotification(string.Format("{0}::{1}", PREFAB_PATH, "OnViewStay")); // } if (heroResData != null && ShowHeroDisplayView(heroResData)) { } else { Observers.Facade.Instance.SendNotification(string.Format("{0}::{1}", PREFAB_PATH, "OnViewStay")); } }
public void StartAction() { float y = Mathf.Abs(moveYOverflow * 2) + Mathf.Abs(moveY); LeanTween.scale(_tran as RectTransform, _localScale, time).setOnComplete(ScaleActionComplete);; LeanTween.moveLocalX(_go, _localPosition.x, time); //_perMoveYTime*(Mathf.Abs(moveY)+Mathf.Abs(moveYOverflow) LeanTween.moveLocalY(_go, _localPosition.y + moveYOverflow, time / 2).setOnComplete(MoveYReset); LeanTween.rotateAroundLocal(_tran as RectTransform, Vector3.forward, rotateZ, time); CommonFadeInAnimation fadeIn = _go.GetComponent <CommonFadeInAnimation>(); if (fadeIn == null) { fadeIn = _go.AddComponent <CommonFadeInAnimation>(); } fadeIn.set(fadeInTime, 0); }
private IEnumerator RefreshCoroutine() { GameResData data; string tips = "error"; tipTextPrefab.SetActive(false); int i = 0; while (true) { if (i >= _dataList.Count) { _isLast = true; yield return(null); continue; } data = _dataList[i]; if (data.type == BaseResType.Hero) { HeroData heroData = HeroData.GetHeroDataByID(data.id); if (heroData != null) { tips = string.Format(Localization.Get("ui.reward_view.gain_hero"), data.star, Localization.Get(heroData.name), data.count); } else { Debugger.LogError("奖励的英雄不存在 id:" + data.id); } } else if (data.type == BaseResType.Equipment) { EquipmentData equipData = EquipmentData.GetEquipmentDataByID(data.id); if (equipData != null) { tips = string.Format(Localization.Get("ui.reward_view.gain_equip"), Localization.Get(equipData.name), data.count); } else { Debugger.LogError("奖励的装备不存在 id:" + data.id); } } else if (data.type == BaseResType.Item) { ItemData itemData = ItemData.GetItemDataByID(data.id); if (itemData != null) { tips = string.Format(Localization.Get("ui.reward_view.gain_item"), Localization.Get(itemData.name), data.count); } else { Debugger.LogError("奖励的道具不存在 id:" + data.id); } } else { ItemData itemData = ItemData.GetBasicResItemByType(data.type); if (itemData != null) { tips = string.Format(Localization.Get("ui.reward_view.gain_base_res"), Localization.Get(itemData.name), data.count); } else { Debugger.LogError("奖励的基础资源不存在 id:" + data.id); } } for (int j = 0, count = _tipList.Count; j < count; j++) { GameObject go = _tipList[j]; if (go != null) { CommonMoveByAnimation.Get(go).Init(0.15f, 0, new Vector3(0, 30, 0)); } } GameObject tipObj = Instantiate <GameObject>(tipTextPrefab); tipObj.SetActive(true); tipObj.transform.SetParent(tipRoot, false); tipObj.transform.localPosition = Vector3.zero; tipObj.GetComponent <Text>().text = tips; CommonFadeInAnimation.Get(tipObj).set(0.3f, 0); //CommonMoveByAnimation.Get(tipObj).Init(2,0,new Vector3(0,100,0)); StartCoroutine(FadeOutCoroutine(2f, tipObj)); _totalDelay += _delay; _tipList.Add(tipObj); yield return(new WaitForSeconds(_delay)); i++; } }