private void CreateHightGoodsEffect() { GoodsEffectParam effectParam = goodsEffctParamList[0]; goodsEffctParamList.RemoveAt(0); Vector3 effectPos = effectParam.EffectPos; string effectId = effectParam.EffectId; EffectMgr.Instance.CreateUIEffect(EffectId.UI_PropBurst, effectPos); EffectMgr.Instance.CreateUIEffect(effectId, effectPos); }
private void ShowIconEffect(GameObject iconObj, int index) { iconObj.gameObject.SetActive(true); //高级物品需要播放特效 int colorLevel = GetHighGoodsColorLevel(index); if (IsHighGoods(colorLevel)) { GoodsEffectParam param = new GoodsEffectParam(); param.EffectColor = GetHighGoodsColor(colorLevel); param.EffectPos = iconObj.transform.position; param.EffectId = GetHighGoodsEffectId(colorLevel); goodsEffctParamList.Add(param); vp_Timer.In(iconEffectDuration, CreateHightGoodsEffect, 1, 0); } Vector3 toPos = iconObj.transform.localPosition; Vector3 fromPos = petAnimationObj.transform.localPosition; fromPos.x -= 38f; //位置处理 TweenPosition tweenPosition = iconObj.GetComponent <TweenPosition>(); if (null != tweenPosition) { GameObject.Destroy(tweenPosition); } tweenPosition = iconObj.AddComponent <TweenPosition>(); tweenPosition.from = fromPos; tweenPosition.to = toPos; tweenPosition.style = UITweener.Style.Once; tweenPosition.method = UITweener.Method.QuintEaseInOut; tweenPosition.duration = iconEffectDuration; //缩放处理 TweenScale tweenScale = iconObj.GetComponent <TweenScale>(); if (null != tweenScale) { GameObject.Destroy(tweenScale); } tweenScale = iconObj.AddComponent <TweenScale>(); tweenScale.from = Vector3.zero; tweenScale.to = Vector3.one; tweenScale.style = UITweener.Style.Once; tweenScale.method = UITweener.Method.QuintEaseInOut; tweenScale.duration = iconEffectDuration; }