public void CancelDrag() { if (this == null || !this.isDragging) { return; } EZDragDropParams eZDragDropParams = new EZDragDropParams(EZDragDropEvent.Cancelled, this.host, default(POINTER_INFO)); if (this.dropTarget != null) { this.dropTarget.SendMessage("OnEZDragDrop", eZDragDropParams, SendMessageOptions.DontRequireReceiver); } if (this.dragDropDelegate != null) { this.dragDropDelegate(eZDragDropParams); } this.dropTarget = null; this.dropHandled = false; this.isDragging = false; AnimatePosition.Do(this.host.gameObject, EZAnimation.ANIM_MODE.To, this.dragOriginOffset, EZAnimation.GetInterpolator(this.host.CancelDragEasing), this.host.CancelDragDuration, 0f, null, new EZAnimation.CompletionDelegate(this.FinishCancelDrag)); if (UIManager.Exists()) { NrTSingleton <UIManager> .Instance.Detarget(this.host); } }
public void PlayAttackNumber(EffectType type, string animationName, string animationStr, int val) { delay = AttackNumAnimPosDelayTime; duration = AttackNumAnimPosDurationTime; val = Mathf.Abs(val); int length = val.ToString().Length + 1; // Scale 0.5f float scaleFactor = 1.0f; if (type == EffectType.NUMBER_GREEN || type == EffectType.NUMBER_GRAY) { scaleFactor = 0.5f; } float singleWidth = numberPreb.width; singleWidth *= scaleFactor; float width = length * singleWidth; if (!animationName.Equals("GreenPlus")) { PackedSprite number = GameObject.Instantiate(numberPreb) as PackedSprite; number.width *= scaleFactor; number.height *= scaleFactor; number.transform.parent = _gobjCrit.transform; number.transform.localPosition = new Vector3(-width / 2, 0, 0); number.transform.localScale = Vector3.one; number.SetAnchor(SpriteRoot.ANCHOR_METHOD.MIDDLE_LEFT); number.PlayAnim(animationName); FadeSpriteAlpha.Do(number, EZAnimation.ANIM_MODE.To, Color.clear, EZAnimation.linear, AnimAlphaDurationTime, AnimAlphaDelayTime, null, DestroyEffectObj); AnimatePosition.Do(_gobjCrit.gameObject, EZAnimation.ANIM_MODE.To, _gobjCrit.transform.localPosition + new Vector3(0, AttackNumRiseUpHeight, 0), EZAnimation.linear, duration, delay, null, DestroyEffectObj); } for (int i = 0; i < length - 1; i++) { int currNum = val / (int)Mathf.Pow(10, length - 2 - i) % 10; PackedSprite number2 = GameObject.Instantiate(numberPreb) as PackedSprite; number2.width *= scaleFactor; number2.height *= scaleFactor; number2.transform.parent = _gobjCrit.transform; number2.transform.localPosition = new Vector3(-width / 2 + singleWidth * (i + 1), 0, 0); number2.transform.localScale = Vector3.one; number2.SetAnchor(SpriteRoot.ANCHOR_METHOD.MIDDLE_LEFT); number2.PlayAnim(animationStr + currNum); FadeSpriteAlpha.Do(number2, EZAnimation.ANIM_MODE.To, Color.clear, EZAnimation.linear, AnimAlphaDurationTime, AnimAlphaDelayTime, null, null); AnimatePosition.Do(_gobjCrit.gameObject, EZAnimation.ANIM_MODE.To, _gobjCrit.transform.localPosition + new Vector3(0, AttackNumRiseUpHeight, 0), EZAnimation.linear, duration, delay, null, DestroyEffectObj); } }
public void SetInfo(string strQuestUnique) { this.m_strCurrentQuestUnique = strQuestUnique; Vector3 localPosition = this.m_UpImage.gameObject.transform.localPosition; Vector3 localPosition2 = this.m_UpImage.gameObject.transform.localPosition; localPosition2.y -= this.m_UpImage.height; AnimatePosition.Do(this.m_UpImage.gameObject, EZAnimation.ANIM_MODE.FromTo, localPosition, localPosition2, new EZAnimation.Interpolator(EZAnimation.linear), ChapterStart_DLG.m_fBoxAniTime, 0f, null, null); localPosition = this.m_DownImage.gameObject.transform.localPosition; localPosition2 = this.m_DownImage.gameObject.transform.localPosition; localPosition2.y += this.m_DownImage.height; AnimatePosition.Do(this.m_DownImage.gameObject, EZAnimation.ANIM_MODE.FromTo, localPosition, localPosition2, new EZAnimation.Interpolator(EZAnimation.linear), ChapterStart_DLG.m_fBoxAniTime, 0f, null, new EZAnimation.CompletionDelegate(this.EndAni)); }
//translate animation public void DoPositionAnimation(GameObject gameObject, Vector3 desPosition) { AnimatePosition.Do ( gameObject, EZAnimation.ANIM_MODE.To, desPosition, EZAnimation.backIn, 0.1f, 0, null, // no starting delegate null // no ending delegate ); }
void OnHuaDongBtn(GameObject obj) { if(!mIsHuaDongIng) { if(mHuaDongSign) { AnimatePosition.Do(mParentObj, EZAnimation.ANIM_MODE.To, new Vector3(386, mParentObj.transform.localPosition.y, mParentObj.transform.localPosition.z), EZAnimation.quinticIn, 0.6f, 0, StartDelegate, EndDelegate); } else { AnimatePosition.Do(mParentObj, EZAnimation.ANIM_MODE.To, new Vector3(576, mParentObj.transform.localPosition.y, mParentObj.transform.localPosition.z), EZAnimation.quarticOut, 0.6f, 0, StartDelegate, EndDelegate); } mHuaDongSign = !mHuaDongSign; mIsHuaDongIng = true; } }
IEnumerator DoCoroutineAffector() { _mGameObjectList[0].SetActiveRecursively(true); yield return(new WaitForSeconds(0.3f)); _mGameObjectList[1].SetActiveRecursively(true); yield return(new WaitForSeconds(0.3f)); _mGameObjectList[2].SetActiveRecursively(true); _mGameObjectList[3].SetActiveRecursively(true); yield return(new WaitForSeconds(0.3f)); foreach (GameObject go in _mGameObjectList) { AnimatePosition.Do(go, EZAnimation.ANIM_MODE.To, _mDestPosition, EZAnimation.GetInterpolator(EZAnimation.EASING_TYPE.Linear), 1.0f, 0, EZAnimationStart, EZAnimationEnd); AnimateScale.Do(go, EZAnimation.ANIM_MODE.To, _mScale, EZAnimation.GetInterpolator(EZAnimation.EASING_TYPE.Linear), 1.0f, 0, EZAnimationStart, EZAnimationEnd); } }
// Performs the default cancel drag animation. public void DoDefaultCancelDrag() { AnimatePosition.Do(host.gameObject, EZAnimation.ANIM_MODE.To, dragOriginOffset, EZAnimation.GetInterpolator(host.CancelDragEasing), host.CancelDragDuration, 0, null, FinishCancelDrag); }