Пример #1
0
 public void Start(GameObject sub, EZAnimation.ANIM_MODE mode, Vector3 dest, EZAnimation.Interpolator interp, float dur, float delay, EZAnimation.CompletionDelegate startDel, EZAnimation.CompletionDelegate del)
 {
     if (sub == null)
     {
         return;
     }
     this.Start(sub, mode, sub.transform.localEulerAngles, dest, interp, dur, delay, startDel, del);
 }
Пример #2
0
	float localUnitsPerPixel;					// The number of local space units per pixel.



	protected virtual void Awake()
	{
		if (m_awake)
			return;
		m_awake = true;

		if (direction == DIRECTION.BtoT_RtoL)
			scrollPos = 1f; // We start at the bottom in this case

		autoScrollInterpolator = EZAnimation.GetInterpolator(snapEasing);

		lowPassFilterFactor = inertiaLerpInterval / lowPassKernelWidthInSeconds;
	}
    public static FadeSprite Do(SpriteRoot sprt, EZAnimation.ANIM_MODE mode, Color dest, EZAnimation.Interpolator interp, float dur, float delay, EZAnimation.CompletionDelegate startDel, EZAnimation.CompletionDelegate del)
    {
        FadeSprite fadeSprite = (FadeSprite)EZAnimator.instance.GetAnimation(EZAnimation.ANIM_TYPE.FadeSprite);

        fadeSprite.Start(sprt, mode, dest, interp, dur, delay, startDel, del);
        return(fadeSprite);
    }
 public void Start(SpriteRoot sprt, EZAnimation.ANIM_MODE mode, Color begin, Color dest, EZAnimation.Interpolator interp, float dur, float delay, EZAnimation.CompletionDelegate startDel, EZAnimation.CompletionDelegate del)
 {
     this.sprite = sprt;
     this.start  = begin;
     this.m_mode = mode;
     if (mode == EZAnimation.ANIM_MODE.By)
     {
         this.delta = dest;
     }
     else
     {
         this.delta = new Color(dest.r - this.start.r, dest.g - this.start.g, dest.b - this.start.b, dest.a - this.start.a);
     }
     this.end               = this.start + this.delta;
     this.interpolator      = interp;
     this.duration          = dur;
     this.m_wait            = delay;
     this.completedDelegate = del;
     this.startDelegate     = startDel;
     base.StartCommon();
     if (mode == EZAnimation.ANIM_MODE.FromTo && delay == 0f)
     {
         this.sprite.SetColor(this.start);
     }
     EZAnimator.instance.AddAnimation(this);
 }
 public void Start(SpriteRoot sprt, EZAnimation.ANIM_MODE mode, Color dest, EZAnimation.Interpolator interp, float dur, float delay, EZAnimation.CompletionDelegate startDel, EZAnimation.CompletionDelegate del)
 {
     this.Start(sprt, mode, sprt.color, dest, interp, dur, delay, startDel, del);
 }
Пример #6
0
    public static FadeMaterial Do(Material material, EZAnimation.ANIM_MODE mode, Color dest, EZAnimation.Interpolator interp, float dur, float delay, EZAnimation.CompletionDelegate startDel, EZAnimation.CompletionDelegate del)
    {
        FadeMaterial fadeMaterial = (FadeMaterial)EZAnimator.instance.GetAnimation(EZAnimation.ANIM_TYPE.FadeMaterial);

        fadeMaterial.Start(material, mode, dest, interp, dur, delay, startDel, del);
        return(fadeMaterial);
    }
Пример #7
0
 public void Start(Material material, EZAnimation.ANIM_MODE mode, Color dest, EZAnimation.Interpolator interp, float dur, float delay, EZAnimation.CompletionDelegate startDel, EZAnimation.CompletionDelegate del)
 {
     this.Start(material, mode, material.color, dest, interp, dur, delay, startDel, del);
 }
    public static FadeAudio Do(AudioSource audio, EZAnimation.ANIM_MODE mode, float begin, float dest, EZAnimation.Interpolator interp, float dur, float delay, EZAnimation.CompletionDelegate startDel, EZAnimation.CompletionDelegate del)
    {
        FadeAudio fadeAudio = (FadeAudio)EZAnimator.instance.GetAnimation(EZAnimation.ANIM_TYPE.FadeAudio);

        fadeAudio.Start(audio, mode, begin, dest, interp, dur, delay, startDel, del);
        return(fadeAudio);
    }
Пример #9
0
    public static AnimateScale Do(GameObject sub, EZAnimation.ANIM_MODE mode, bool increase, Vector3 begin, Vector3 dest, Vector3 beginPos, Vector3 destPos, EZAnimation.Interpolator interp, float dur, float delay, EZAnimation.CompletionDelegate startDel, EZAnimation.CompletionDelegate del)
    {
        AnimateScale animateScale = (AnimateScale)EZAnimator.instance.GetAnimation(EZAnimation.ANIM_TYPE.Scale);

        animateScale.Start(sub, mode, increase, begin, dest, beginPos, destPos, interp, dur, delay, startDel, del);
        return(animateScale);
    }
Пример #10
0
    public static AnimateRotation Do(GameObject sub, EZAnimation.ANIM_MODE mode, Vector3 dest, EZAnimation.Interpolator interp, float dur, float delay, EZAnimation.CompletionDelegate startDel, EZAnimation.CompletionDelegate del)
    {
        AnimateRotation animateRotation = (AnimateRotation)EZAnimator.instance.GetAnimation(EZAnimation.ANIM_TYPE.Rotate);

        animateRotation.Start(sub, mode, dest, interp, dur, delay, startDel, del);
        return(animateRotation);
    }
Пример #11
0
 public void Start(GameObject sub, EZAnimation.ANIM_MODE mode, Vector3 begin, Vector3 dest, EZAnimation.Interpolator interp, float dur, float delay, EZAnimation.CompletionDelegate startDel, EZAnimation.CompletionDelegate del)
 {
     this.subject  = sub;
     this.subTrans = this.subject.transform;
     this.start    = begin;
     this.m_mode   = mode;
     if (mode == EZAnimation.ANIM_MODE.By)
     {
         this.delta = dest;
     }
     else
     {
         this.delta = new Vector3(dest.x - this.start.x, dest.y - this.start.y, dest.z - this.start.z);
     }
     this.end               = this.start + this.delta;
     this.interpolator      = interp;
     this.duration          = dur;
     this.m_wait            = delay;
     this.completedDelegate = del;
     this.startDelegate     = startDel;
     base.StartCommon();
     if (mode == EZAnimation.ANIM_MODE.FromTo && delay == 0f)
     {
         this.subTrans.localEulerAngles = this.start;
     }
     EZAnimator.instance.AddAnimation(this);
 }
    public static TuneAudio Do(AudioSource audio, EZAnimation.ANIM_MODE mode, float dest, EZAnimation.Interpolator interp, float dur, float delay, EZAnimation.CompletionDelegate startDel, EZAnimation.CompletionDelegate del)
    {
        TuneAudio tuneAudio = (TuneAudio)EZAnimator.instance.GetAnimation(EZAnimation.ANIM_TYPE.TuneAudio);

        tuneAudio.Start(audio, mode, dest, interp, dur, delay, startDel, del);
        return(tuneAudio);
    }
 public void Start(AudioSource sub, EZAnimation.ANIM_MODE mode, float begin, float dest, EZAnimation.Interpolator interp, float dur, float delay, EZAnimation.CompletionDelegate startDel, EZAnimation.CompletionDelegate del)
 {
     this.subject = sub;
     this.start   = begin;
     this.m_mode  = mode;
     if (mode == EZAnimation.ANIM_MODE.By)
     {
         this.delta = dest;
     }
     else
     {
         this.delta = dest - this.start;
     }
     this.end               = this.start + this.delta;
     this.interpolator      = interp;
     this.duration          = dur;
     this.m_wait            = delay;
     this.completedDelegate = del;
     this.startDelegate     = startDel;
     base.StartCommon();
     EZAnimator.instance.Stop(this.subject, this.type, mode == EZAnimation.ANIM_MODE.By);
     if (mode == EZAnimation.ANIM_MODE.FromTo && delay == 0f)
     {
         this.subject.pitch = this.start;
     }
     EZAnimator.instance.AddAnimation(this);
 }
 public void Start(AudioSource audio, EZAnimation.ANIM_MODE mode, float dest, EZAnimation.Interpolator interp, float dur, float delay, EZAnimation.CompletionDelegate startDel, EZAnimation.CompletionDelegate del)
 {
     this.Start(audio, mode, audio.pitch, dest, interp, dur, delay, startDel, del);
 }
Пример #15
0
	float localUnitsPerPixel;					// The number of local space units per pixel.



	protected void Awake()
	{
		if (m_awake)
			return;
		m_awake = true;

		// Create our mover object:
		mover = new GameObject();
		mover.name = "Mover";
		mover.transform.parent = transform;
		mover.transform.localPosition = Vector3.zero;
		mover.transform.localRotation = Quaternion.identity;
		mover.transform.localScale = Vector3.one;

		if (direction == DIRECTION.BtoT_RtoL)
			scrollPos = 1f; // We start at the bottom in this case

		autoScrollInterpolator = EZAnimation.GetInterpolator(snapEasing);

		lowPassFilterFactor = inertiaLerpInterval / lowPassKernelWidthInSeconds;
	}
Пример #16
0
 public void Start(GameObject sub, EZAnimation.ANIM_MODE mode, bool increase, Vector3 begin, Vector3 dest, Vector3 beginPos, Vector3 destPos, EZAnimation.Interpolator interp, float dur, float delay, EZAnimation.CompletionDelegate startDel, EZAnimation.CompletionDelegate del)
 {
     this.movePos  = true;
     this.subject  = sub;
     this.subTrans = this.subject.transform;
     this.start    = begin;
     this.m_mode   = mode;
     if (mode == EZAnimation.ANIM_MODE.By)
     {
         this.delta    = Vector3.Scale(this.start, dest) - this.start;
         this.deltaPos = Vector3.Scale(this.start, dest) - this.start;
         this.startPos = beginPos;
         this.deltaPos = destPos - this.startPos;
     }
     else
     {
         this.delta = dest - this.start;
         if (increase)
         {
             this.startPos = Vector3.zero;
         }
         else
         {
             this.startPos = this.subject.transform.localPosition;
         }
         this.deltaPos = destPos - beginPos;
     }
     this.end               = this.start + this.delta;
     this.interpolator      = interp;
     this.duration          = dur;
     this.m_wait            = delay;
     this.completedDelegate = del;
     this.startDelegate     = startDel;
     base.StartCommon();
     if (mode == EZAnimation.ANIM_MODE.FromTo && delay == 0f)
     {
         this.subTrans.localScale = this.start;
     }
     EZAnimator.instance.AddAnimation(this);
 }
Пример #17
0
	/// <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 static FadeText Do(SpriteText txt, EZAnimation.ANIM_MODE mode, Color dest, EZAnimation.Interpolator interp, float dur, float delay, EZAnimation.CompletionDelegate startDel, EZAnimation.CompletionDelegate del)
    {
        FadeText fadeText = (FadeText)EZAnimator.instance.GetAnimation(EZAnimation.ANIM_TYPE.FadeText);

        fadeText.Start(txt, mode, dest, interp, dur, delay, startDel, del);
        return(fadeText);
    }