private void Start()
 {
     if (this.animatePostion == null)
     {
         this.animatePostion = base.GetComponent<AnimatePosition>();
     }
 }
Esempio n. 2
0
    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);
        }
    }
Esempio n. 3
0
    public static AnimatePosition Do(GameObject sub, EZAnimation.ANIM_MODE mode, Vector3 dest, EZAnimation.Interpolator interp, float dur, float delay, EZAnimation.CompletionDelegate startDel, EZAnimation.CompletionDelegate del)
    {
        AnimatePosition animatePosition = (AnimatePosition)EZAnimator.instance.GetAnimation(EZAnimation.ANIM_TYPE.Translate);

        animatePosition.Start(sub, mode, dest, interp, dur, delay, startDel, del);
        return(animatePosition);
    }
Esempio n. 4
0
    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);
        }
    }
Esempio n. 5
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();

        AnimatePosition myScript = (AnimatePosition)target;

        if (EditorApplication.isPlaying && GUILayout.Button("Start"))
        {
            myScript.StartAnimation();
        }
    }
Esempio n. 6
0
    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));
    }
Esempio n. 7
0
 //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
     );
 }
Esempio n. 8
0
	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;
		}
	}
    protected override void OnUpdate()
    {
        Entities.ForEach((AnimatePositionAuthoring data) =>
        {
            var entity = GetPrimaryEntity(data);

            var positionAnimation = new AnimatePosition
            {
                From       = data.FromPosition,
                To         = data.ToPosition,
                Frequency  = 1f / data.Phase,
                PhaseShift = data.Offset * data.Phase,
            };

            DstEntityManager.AddComponentData(entity, positionAnimation);
            DstEntityManager.AddComponent <Translation>(entity);
        });
    }
Esempio n. 10
0
    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);
        }
    }
Esempio n. 11
0
 // 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);
 }