public void End() { if (this.runningAnims == null) { return; } if (this.runningAnims.Rewind()) { this.forcedStop = true; do { EZLinkedListNode <EZAnimation> current = this.runningAnims.Current; EZAnimation val = current.val; if (val != null) { val.CompletedDelegate = null; EZAnimator.instance.StopAnimation(val, true); } this.runningAnims.Remove(current); this.idleAnims.Add(current); current.val = null; }while (this.runningAnims.MoveNext()); this.forcedStop = false; this.CallEndDelegates(); } }
private void EndAni(EZAnimation obj) { this.m_Label_Label2.Visible = true; this.m_Label_Label3.Visible = true; this.m_LabelBack.Visible = true; FadeSprite.Do(this.m_LabelBack, EZAnimation.ANIM_MODE.FromTo, new Color(1f, 1f, 1f, 0f), new Color(1f, 1f, 1f, 1f), new EZAnimation.Interpolator(EZAnimation.linear), ChapterStart_DLG.m_fTextAniTime, 0f, null, null); CQuestGroup questGroupByQuestUnique = NrTSingleton <NkQuestManager> .Instance.GetQuestGroupByQuestUnique(this.m_strCurrentQuestUnique); if (questGroupByQuestUnique == null) { return; } string empty = string.Empty; string textFromInterface = NrTSingleton <NrTextMgr> .Instance.GetTextFromInterface("75"); NrTSingleton <CTextParser> .Instance.ReplaceParam(ref empty, new object[] { textFromInterface, "count", questGroupByQuestUnique.GetPage() }); this.m_Label_Label2.Text = empty; this.m_Label_Label2.SetLocation((GUICamera.width - this.m_Label_Label2.width) / 2f, this.m_LabelBack.GetLocationY() + 20f); FadeText.Do(this.m_Label_Label2.spriteText, EZAnimation.ANIM_MODE.FromTo, new Color(1f, 1f, 1f, 0f), new Color(1f, 1f, 1f, 1f), new EZAnimation.Interpolator(EZAnimation.linear), ChapterStart_DLG.m_fTextAniTime, 0f, null, null); string groupTitle = questGroupByQuestUnique.GetGroupTitle(); this.m_Label_Label3.Text = groupTitle; this.m_Label_Label3.SetLocation((GUICamera.width - this.m_Label_Label3.width) / 2f, this.m_LabelBack.GetLocationY() + 63f); FadeText.Do(this.m_Label_Label3.spriteText, EZAnimation.ANIM_MODE.FromTo, new Color(1f, 1f, 1f, 0f), new Color(1f, 1f, 1f, 1f), new EZAnimation.Interpolator(EZAnimation.linear), ChapterStart_DLG.m_fTextAniTime, 0f, null, null); TsAudioManager.Instance.AudioContainer.RequestAudioClip("UI_SFX", "QUEST", "ACT", new PostProcPerItem(NrAudioClipDownloaded.OnEventAudioClipDownloadedImmedatePlay)); this.m_fStartTime = Time.realtimeSinceStartup; }
public void EZAnimationStart(EZAnimation anim) { // if (anim.GetType() == typeof(AnimatePosition)) // {} // else if (anim.GetType() == typeof(AnimateScale)) // {} }
public override bool Start(GameObject sub, AnimParams parms) { if (sub == null) { return(false); } if (sub.renderer == null) { return(false); } if (sub.renderer.material == null) { return(false); } this.pingPong = parms.pingPong; this.restartOnRepeat = parms.restartOnRepeat; this.repeatDelay = parms.repeatDelay; if (parms.mode == EZAnimation.ANIM_MODE.FromTo) { this.Start(sub.renderer.material, parms.mode, parms.color, parms.color2, EZAnimation.GetInterpolator(parms.easing), parms.duration, parms.delay, null, new EZAnimation.CompletionDelegate(parms.transition.OnAnimEnd)); } else { this.Start(sub.renderer.material, parms.mode, sub.renderer.material.color, parms.color, EZAnimation.GetInterpolator(parms.easing), parms.duration, parms.delay, null, new EZAnimation.CompletionDelegate(parms.transition.OnAnimEnd)); } return(true); }
protected void FinishCancelDrag(EZAnimation anim) { if (this == null) { return; } this.host.transform.localPosition = this.dragOrigin; }
// Finishes off the CancelDrag animation. protected void FinishCancelDrag(EZAnimation anim) { // See if the object has been destroyed: if (host == null) { return; } host.transform.localPosition = dragOrigin; isCanceling = false; OnEZDragDrop_Internal(new EZDragDropParams(EZDragDropEvent.CancelDone, host, default(POINTER_INFO))); }
public override void Apply(float blend, EB.Director.Serialization.KeyFrame from, EB.Director.Serialization.KeyFrame to) { if (_parent.IsPaused || DirectorInformation.Paused) { return; } if (_target.GetComponent <Camera>() == null) { _target = _target.GetComponentInChildren <Camera>().gameObject; } if (DirectorInformation.LerpToNextCamera && Application.isPlaying) { _parent.PlayTime = 0f; timeToLerp = DirectorInformation.LerpTime; if (timer < timeToLerp) { timer += Time.deltaTime; float easeInOutValue = EZAnimation.sinusInOut(timer, 0.0f, 1.0f, timeToLerp); var v = Mathf.Lerp(DirectorInformation.LastFOV, from.FloatValue, easeInOutValue); _target.GetComponent <Camera>().fieldOfView = v; DirectorInformation.LastFOV = v; if (timer > timeToLerp) { _target.GetComponent <Camera>().fieldOfView = from.FloatValue; } } return; } if (_target != null && _target.GetComponent <Camera>() != null && !DirectorInformation.LerpToNextCamera) { var v1 = from.FloatValue; var v2 = to.FloatValue; var v = Mathf.Lerp(v1, v2, blend); if (v == 0) { v = 45f; } _target.GetComponent <Camera>().fieldOfView = v; DirectorInformation.LastFOV = v; } }
protected override void DoAnim() { if (this.subTrans == null) { base._stop(); return; } this.factor = this.timeElapsed / this.interval; this.temp.x = this.start.x + EZAnimation.punch(this.magnitude.x, this.factor); this.temp.y = this.start.y + EZAnimation.punch(this.magnitude.y, this.factor); this.temp.z = this.start.z + EZAnimation.punch(this.magnitude.z, this.factor); this.subTrans.localRotation = Quaternion.Euler(this.temp); }
public void EZAnimationEnd(EZAnimation anim) { _mAnimEndCounter++; if (_mAnimEndCounter == _mGameObjectList.Count * 2) { foreach (GameObject go in _mGameObjectList) { go.SetActiveRecursively(false); } _mGameObjectList.Clear(); _mEndDelegate(this); return; } }
protected override void DoAnim() { if (this.subTrans == null) { base._stop(); return; } float num = EZAnimation.punch(this.magnitude.x, this.factor); float num2 = EZAnimation.punch(this.magnitude.x, this.factor); float num3 = EZAnimation.punch(this.magnitude.x, this.factor); this.factor = this.timeElapsed / this.interval; this.temp.x = this.start.x + num; this.temp.y = this.start.y + num2; this.temp.z = this.start.z + num3; this.subTrans.localScale = this.temp; this.temp2.x = this.startPosition.x - this.startWidth * 0.5f * num; this.temp2.y = this.startPosition.y + this.startHeight * 0.5f * num2; this.temp2.z = this.startPosition.z; this.subTrans.localPosition = this.temp2; }
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); } }
public override bool Start(GameObject sub, AnimParams parms) { if (sub == null) { return(false); } this.subject = (AudioSource)sub.GetComponent(typeof(AudioSource)); if (this.subject == null) { return(false); } this.pingPong = parms.pingPong; this.restartOnRepeat = parms.restartOnRepeat; this.repeatDelay = parms.repeatDelay; if (parms.mode == EZAnimation.ANIM_MODE.FromTo) { this.Start(this.subject, parms.mode, parms.floatVal, parms.floatVal2, EZAnimation.GetInterpolator(parms.easing), parms.duration, parms.delay, null, new EZAnimation.CompletionDelegate(parms.transition.OnAnimEnd)); } else { this.Start(this.subject, parms.mode, this.subject.pitch, parms.floatVal, EZAnimation.GetInterpolator(parms.easing), parms.duration, parms.delay, null, new EZAnimation.CompletionDelegate(parms.transition.OnAnimEnd)); } return(true); }
public void OnAnimEnd(EZAnimation anim) { EZLinkedListNode <EZAnimation> eZLinkedListNode = (EZLinkedListNode <EZAnimation>)anim.Data; if (eZLinkedListNode == null) { return; } if (this.runningAnims == null) { return; } eZLinkedListNode.val = null; this.runningAnims.Remove(eZLinkedListNode); this.idleAnims.Add(eZLinkedListNode); if (this.onEndDelegates == null || this.forcedStop) { return; } EZLinkedListNode <EZAnimation> current = this.runningAnims.Current; if (this.runningAnims.Rewind()) { while (this.runningAnims.Current.val.Duration <= 0f) { if (!this.runningAnims.MoveNext()) { goto IL_A1; } } return; } IL_A1: this.runningAnims.Current = current; this.CallEndDelegates(); }
public override bool Start(GameObject sub, AnimParams parms) { if (sub == null) { return(false); } this.sprite = (SpriteRoot)sub.GetComponent(typeof(SpriteRoot)); if (this.sprite == null) { return(false); } this.pingPong = parms.pingPong; this.restartOnRepeat = parms.restartOnRepeat; this.repeatDelay = parms.repeatDelay; if (parms.mode == EZAnimation.ANIM_MODE.FromTo) { this.Start(this.sprite, parms.mode, parms.color, parms.color2, EZAnimation.GetInterpolator(parms.easing), parms.duration, parms.delay, null, new EZAnimation.CompletionDelegate(parms.transition.OnAnimEnd)); } else { this.Start(this.sprite, parms.mode, this.sprite.color, parms.color, EZAnimation.GetInterpolator(parms.easing), parms.duration, parms.delay, null, new EZAnimation.CompletionDelegate(parms.transition.OnAnimEnd)); } return(true); }
// Called when a position easing animation ends. protected void OnPosEasingDone(EZAnimation anim) { itemEasers.Remove(anim); // If that was the last one, see if we need to // unlock input: if (itemEasers.Count == 0 && blockInputWhileEasing) UIManager.instance.UnlockInput(); }
// Allows us to use an EZAnimation for our scroll position easing protected float ScrollPosInterpolator(float time, float start, float delta, float duration) { Vector2 startDelta = (Vector2)scrollPosAnim.Data; ScrollListTo_Internal(EZAnimation.GetInterpolator(positionEasing)(time, startDelta.x, startDelta.y, duration)); // We're done: if (time >= duration) scrollPosAnim = null; return start; }
// Updates the extents of the content area by // the specified amount. // change: The amount the content extents have changed (+/-) protected void UpdateContentExtents(float change) { float oldAmtOfPlay = amtOfPlay; float addlSpacing = (spacingAtEnds ? (itemSpacingActual * 2f) : 0) + extraEndSpacingActual * 2f; contentExtents += change; if (orientation == ORIENTATION.HORIZONTAL) { // Adjust the scroll position: amtOfPlay = ((contentExtents + addlSpacing) - viewableAreaActual.x); scrollMax = (viewableAreaActual.x / ((contentExtents + addlSpacing) - viewableAreaActual.x)) * overscrollAllowance; } else { // Adjust the scroll position: amtOfPlay = ((contentExtents + addlSpacing) - viewableAreaActual.y); scrollMax = (viewableAreaActual.y / ((contentExtents + addlSpacing) - viewableAreaActual.y)) * overscrollAllowance; } float newPos = ((oldAmtOfPlay * scrollPos) / amtOfPlay); // See if we need to ease into position: if (doPosEasing && newPos > 1f) { scrollPosAnim = AnimatePosition.Do(gameObject, EZAnimation.ANIM_MODE.By, Vector3.zero, ScrollPosInterpolator, positionEaseDuration, positionEaseDelay, null, OnPosEasingDone); scrollPosAnim.Data = new Vector2(newPos, 1f - newPos); // (Start, Delta) itemEasers.Add(scrollPosAnim); } else ScrollListTo_Internal(Mathf.Clamp01(newPos)); doPosEasing = false; }
public override void OnInput(ref POINTER_INFO ptr) { if (this.deleted) { return; } if (!this.m_controlIsEnabled || base.IsHidden()) { base.OnInput(ref ptr); return; } if (this.inputDelegate != null) { this.inputDelegate(ref ptr); } if (!this.m_controlIsEnabled || base.IsHidden()) { base.OnInput(ref ptr); return; } switch (ptr.evt) { case POINTER_INFO.INPUT_EVENT.PRESS: case POINTER_INFO.INPUT_EVENT.DRAG: if (!this.IsListButton) { this.SetControlState(UIButton.CONTROL_STATE.ACTIVE); } if (this.AvtiveColorText != string.Empty && this.BaseString != string.Empty && this.AvtiveColorText != base.ColorText) { base.ColorText = this.AvtiveColorText; this.Text = this.BaseString; } if (ptr.evt == POINTER_INFO.INPUT_EVENT.PRESS) { if (this.mouseDownDelegate != null) { this.mouseDownDelegate(this); } if (this.bEffectAni && !this.bStartAni) { Vector3 one = Vector3.one; if (0f > base.transform.localScale.x) { one.x *= -1f; } if (0f > base.transform.localScale.y) { one.y *= -1f; } if (0f > base.transform.localScale.z) { one.z *= -1f; } AnimateScale.Do(base.gameObject, EZAnimation.ANIM_MODE.FromTo, this.width, this.height, base.transform.localScale, new Vector3(0.85f * one.x, 0.85f * one.y, 0.85f * one.z), EZAnimation.GetInterpolator(EZAnimation.EASING_TYPE.BackOut), 0.2f, 0f, new EZAnimation.CompletionDelegate(base.EffectAniStartDelegate), new EZAnimation.CompletionDelegate(base.EffectAniCompletionDelegate)); } } break; case POINTER_INFO.INPUT_EVENT.DOUBLE_PRESS: if (!this.IsListButton) { this.SetControlState(UIButton.CONTROL_STATE.ACTIVE); } if (this.doubleClickDelegate != null) { this.doubleClickDelegate(this); } break; case POINTER_INFO.INPUT_EVENT.RIGHT_PRESS: if (!this.IsListButton) { this.SetControlState(UIButton.CONTROL_STATE.ACTIVE); } if (this.rightMouseDelegate != null) { this.rightMouseDelegate(this); } break; case POINTER_INFO.INPUT_EVENT.RELEASE: case POINTER_INFO.INPUT_EVENT.TAP: case POINTER_INFO.INPUT_EVENT.LONG_TAP: if (!this.IsListButton) { this.SetControlState(UIButton.CONTROL_STATE.NORMAL); } break; case POINTER_INFO.INPUT_EVENT.RIGHT_RELEASE: case POINTER_INFO.INPUT_EVENT.RIGHT_TAP: if (ptr.type != POINTER_INFO.POINTER_TYPE.TOUCHPAD && ptr.hitInfo.collider == base.collider) { if (!this.IsListButton) { this.SetControlState(UIButton.CONTROL_STATE.OVER); } } else if (!this.IsListButton) { this.SetControlState(UIButton.CONTROL_STATE.NORMAL); } break; case POINTER_INFO.INPUT_EVENT.MOVE: if (this.m_ctrlState != UIButton.CONTROL_STATE.OVER) { if (!this.IsListButton) { this.SetControlState(UIButton.CONTROL_STATE.OVER); } if (this.OverColorText != string.Empty && this.OverColorText != base.ColorText) { this.NormalColorText = base.ColorText; base.ColorText = this.OverColorText; this.Text = this.BaseString; } if (this.soundOnOver != null) { this.soundOnOver.PlayOneShot(this.soundOnOver.clip); } if (this.mouseOverDelegate != null) { this.mouseOverDelegate(this); } } break; case POINTER_INFO.INPUT_EVENT.MOVE_OFF: case POINTER_INFO.INPUT_EVENT.RELEASE_OFF: if (this.m_ctrlState != UIButton.CONTROL_STATE.NORMAL && this.mouseOutDelegate != null) { this.mouseOutDelegate(this); } if (!this.IsListButton) { this.SetControlState(UIButton.CONTROL_STATE.NORMAL); } if (this.NormalColorText != string.Empty && this.BaseString != string.Empty && this.NormalColorText != base.ColorText) { base.ColorText = this.NormalColorText; this.Text = this.BaseString; } break; } base.OnInput(ref ptr); if (this.repeat) { if (this.m_ctrlState == UIButton.CONTROL_STATE.ACTIVE) { goto IL_4A2; } } else if (ptr.evt == this.whenToInvoke) { goto IL_4A2; } return; IL_4A2: if (ptr.evt == this.whenToInvoke && this.soundOnClick != null) { this.soundOnClick.PlayOneShot(this.soundOnClick.clip); } if (this.scriptWithMethodToInvoke != null) { this.scriptWithMethodToInvoke.Invoke(this.methodToInvoke, this.delay); } if (this.changeDelegate != null) { this.changeDelegate(this); if (this.bUseDefaultSound) { MsgHandler.Handle("ButtonSound", new object[0]); } } }
private void test(Transform target, Color fromValue, Color toValue, EZAnimation.EASING_TYPE currentEasing, float duration) { SpriteText targetText = target.GetComponent<SpriteText>(); if(targetText != null) { //Fade FadeText.Do(targetText,EZAnimation.ANIM_MODE.FromTo, fromValue, toValue, EZAnimation.GetInterpolator(currentEasing), duration, 0.1f, null, null); } else { SpriteRoot targetSprite = (SpriteRoot)target.GetComponent<SpriteRoot>(); if(targetSprite != null) FadeSprite.Do(targetSprite,EZAnimation.ANIM_MODE.FromTo, fromValue, toValue, EZAnimation.GetInterpolator(currentEasing), duration, 0.1f, null, null); } foreach(Transform child in target) { test(child, fromValue, toValue, currentEasing, duration); } }
// 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); }
/// <summary> /// Scrolls the list to the specified item in the specified /// number of seconds. /// </summary> /// <param name="item">The item to scroll to.</param> /// <param name="scrollTime">The number of seconds the scroll should last.</param> /// <param name="easing">The type of easing to be used for the scroll.</param> public void ScrollToItem(IUIListObject item, float scrollTime, EZAnimation.EASING_TYPE easing) { snappedItem = item; if (newItems.Count != 0) { if (itemsInserted) RepositionItems(); else PositionNewItems(); itemsInserted = false; newItems.Clear(); } if (orientation == ORIENTATION.HORIZONTAL) { if(direction == DIRECTION.TtoB_LtoR) autoScrollPos = Mathf.Clamp01(item.transform.localPosition.x / amtOfPlay); else autoScrollPos = Mathf.Clamp01(-item.transform.localPosition.x / amtOfPlay); } else { if(direction == DIRECTION.TtoB_LtoR) autoScrollPos = Mathf.Clamp01(-item.transform.localPosition.y / amtOfPlay); else autoScrollPos = Mathf.Clamp01(item.transform.localPosition.y / amtOfPlay); } autoScrollInterpolator = EZAnimation.GetInterpolator(easing); autoScrollStart = scrollPos; autoScrollDelta = autoScrollPos - scrollPos; autoScrollDuration = scrollTime; autoScrollTime = 0; autoScrolling = true; // Do some state cleanup: scrollDelta = 0; isScrolling = false; if (itemSnappedDel != null) itemSnappedDel(snappedItem); }
public override void Apply(float blend, EB.Director.Serialization.KeyFrame from, EB.Director.Serialization.KeyFrame to) { //EB.Debug.Log("CHECKING: " + _parent.name + " FOR PAUSED"); if (_parent.IsPaused || DirectorInformation.Paused) { return; } //Debug.Log("INSIDE THE DIRECTOR"); if (_playerCar == null) { // ignore cameras Transform playerLocator = GameObject.Find("LOCATOR_PLAYER").transform; int childCount = playerLocator.childCount; for (int i = 0; i < childCount; ++i) { Transform child = playerLocator.GetChild(i); if (child.GetComponent <Camera>() == null) { _playerCar = child.gameObject; break; } } } //EB.Debug.Log("PLAYER CAR EXISTS"); // Set parent to local to world in correct location --- THIS ONLY HAPPENS ONCE if (_target.name == "Director Camera" && frame == 0) { // Only happen if it's the first frame and we're sure this director is supposed to be local to world if (_track.space == SpaceType.LocalToWorld) { if (!DirectorInformation.LocalToWorldDirectors.Contains(_parent)) { DirectorInformation.LocalToWorldDirectors.Add(_parent); } // Find the player car and locator GameObject localToWorldLocator = GameObject.Find("localToWorldLocator"); // If the locator doesn't exist, create it if (localToWorldLocator == null) { localToWorldLocator = new GameObject("localToWorldLocator"); } // Set the position & rotation of the locator to that of the player car localToWorldLocator.transform.position = _playerCar.transform.position; localToWorldLocator.transform.eulerAngles = _playerCar.transform.eulerAngles; // If the camera isn't already a child of the locator, make it so if (_target.transform.parent != localToWorldLocator.transform) { localToWorldLocator.transform.position = _target.transform.parent.position; localToWorldLocator.transform.eulerAngles = _target.transform.parent.eulerAngles; _target.transform.parent = localToWorldLocator.transform; } // Zero out the camera under it's new parent, the locator _target.transform.localPosition = Vector3.zero; _target.transform.localEulerAngles = Vector3.zero; // Act in local space relative to the locator parent _track.space = SpaceType.Local; //EB.Debug.Log("SET L2W CAMERA: " + _parent.name); } // If this director is *not* supposed to be local to world, make sure the camera is a child of the car! else if (_target.transform.parent != null) { if (_target.transform.parent.name == "localToWorldLocator") { //EB.Debug.Log("RESET PLAYERCAR CAMERA: " + _parent.name); _target.transform.parent = _playerCar.transform; DirectorInformation.LastPosition = _target.transform.localPosition; DirectorInformation.LastRotation = _target.transform.localRotation; } } } frame++; //Debug.Log("MOVING FORWARD"); if (DirectorInformation.LerpToNextCamera && Application.isPlaying) { _parent.PlayTime = 0f; timeToLerp = DirectorInformation.LerpTime; if (timer < timeToLerp) { //EB.Debug.Log("LERPING CAMERA: " + _parent.name + " --- TIMER: " + timer + " --- Parent: " + _target.transform.parent.name); timer += Time.deltaTime * ((Time.timeScale != 0) ? 1.0f / Time.timeScale : 0.0f); DirectorInformation.LerpProgress = timer; float easeInOutValue = EZAnimation.sinusInOut(timer, 0.0f, 1.0f, timeToLerp); var v = new QuatPos(); v.pos = Vector3.Lerp(DirectorInformation.LastPosition, from.QuatPosValue.pos, easeInOutValue); v.quat = Quaternion.Lerp(DirectorInformation.LastRotation, from.QuatPosValue.quat, easeInOutValue); v.Apply(_target.transform, _track.space); DirectorInformation.LastPosition = v.pos; DirectorInformation.LastRotation = v.quat; _currentQuatPos.pos = _playerCar.transform.TransformPoint(v.pos); _currentQuatPos.quat = v.quat; if (timer > timeToLerp) { //EB.Debug.Log("LERPED CAMERA: " + _parent.name); _target.transform.localPosition = from.QuatPosValue.pos; _target.transform.localRotation = from.QuatPosValue.quat; DirectorInformation.LerpTime = 1.0f; DirectorInformation.LerpToNextCamera = false; timer = 0f; } } return; } //Debug.Log("NOT LERPING"); // Apply transform tween to target if (_target != null && !DirectorInformation.LerpToNextCamera) { //EB.Debug.Log("BLENDING CAMERA: " + _parent.name + " --- BLEND: " + blend + " --- Parent: " + _target.transform.parent.name); var v1 = from.QuatPosValue; var v2 = to.QuatPosValue; var v = QuatPos.Lerp(v1, v2, blend); v.Apply(_target.transform, _track.space); if (_playerCar != null) { _currentQuatPos.pos = _playerCar.transform.TransformPoint(v.pos); _currentQuatPos.quat = v.quat; DirectorInformation.LastPosition = v.pos; DirectorInformation.LastRotation = v.quat; } } }
protected void StartDelegate(EZAnimation anim) { }
private void test(EZAnimation ainm) { }
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); } }
void BeginAnim(EZAnimation anim) { IsShaking = true; if (OnStartShake != null) OnStartShake(); }
private void DoAlphaAnimationRecursive(Transform target, Color fromValue, Color toValue, EZAnimation.EASING_TYPE currentEasing, float duration) { SpriteText targetText = target.GetComponent<SpriteText>(); if(targetText != null) { //Fade fromValue = new Color(targetText.color.r, targetText.color.g, targetText.color.b, fromValue.a); toValue = new Color(targetText.color.r, targetText.color.g, targetText.color.b, toValue.a); FadeTextAlpha.Do(targetText,EZAnimation.ANIM_MODE.FromTo, fromValue, toValue, EZAnimation.GetInterpolator(currentEasing), duration, 0.1f, null, null); } else { SpriteRoot targetSprite = (SpriteRoot)target.GetComponent<SpriteRoot>(); if(targetSprite != null) FadeSpriteAlpha.Do(targetSprite,EZAnimation.ANIM_MODE.FromTo, fromValue, toValue, EZAnimation.GetInterpolator(currentEasing), duration, 0.1f, null, null); } foreach(Transform child in target) { DoAlphaAnimationRecursive(child, fromValue, toValue, currentEasing, duration); } }
// Finishes off the CancelDrag animation. protected void FinishCancelDrag(EZAnimation anim) { // See if the object has been destroyed: if (host == null) return; host.transform.localPosition = dragOrigin; isCanceling = false; OnEZDragDrop_Internal(new EZDragDropParams(EZDragDropEvent.CancelDone, host, default(POINTER_INFO))); }
//destroy the effect font public void DestroyEffectObj(EZAnimation obj) { GameObject.Destroy(_gobjCrit); }
public static float Blend(EB.Director.BlendMode mode, float t) { switch (mode) { case BlendMode.Cut: { t = 0.0f; // do the cut } break; case BlendMode.EaseIn: { t = EZAnimation.sinusOut(t, 0, 1, 1); } break; case BlendMode.EaseOut: { t = EZAnimation.sinusIn(t, 0, 1, 1); } break; case BlendMode.CubicIn: { t = EZAnimation.cubicIn(t, 0, 1, 1); } break; case BlendMode.CubicOut: { t = EZAnimation.cubicOut(t, 0, 1, 1); } break; case BlendMode.EaseOutIn: { t = EZAnimation.sinusInOut(t, 0, 1, 1); } break; case BlendMode.EaseInOut: { t = EZAnimation.sinusOutIn(t, 0, 1, 1); } break; case BlendMode.CubicInOut: { t = EZAnimation.cubicInOut(t, 0, 1, 1); } break; case BlendMode.CubicOutIn: { t = EZAnimation.cubicOutIn(t, 0, 1, 1); } break; default: // linear break; } return(t); }
/// <summary> /// Scrolls the list to the specified item in the specified /// number of seconds. /// </summary> /// <param name="index">The index of the item to scroll to.</param> /// <param name="scrollTime">The number of seconds the scroll should last.</param> /// <param name="easing">The type of easing to be used for the scroll.</param> public void ScrollToItem(int index, float scrollTime, EZAnimation.EASING_TYPE easing) { if(index < 0 || index >= items.Count) return; ScrollToItem(items[index], scrollTime, easing); }
// Finishes off the CancelDrag animation. protected void FinishCancelDrag(EZAnimation anim) { host.transform.localPosition = dragOrigin; isCanceling = false; OnEZDragDrop_Internal(new EZDragDropParams(EZDragDropEvent.CancelDone, host, default(POINTER_INFO))); }
protected void EndDelegate(EZAnimation anim) { //ButtonArrow.transform.localScale = new Vector3(-ButtonArrow.transform.localScale.x,1,1); //mIsHuaDongIng = false; }
void EndAnim(EZAnimation anim) { IsShaking = false; if (OnEndShake != null) OnEndShake(); }