Пример #1
0
 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);
 }
 public override bool Start(GameObject sub, AnimParams parms)
 {
     if (sub == null)
     {
         return(false);
     }
     this.pingPong        = parms.pingPong;
     this.restartOnRepeat = parms.restartOnRepeat;
     this.repeatDelay     = parms.repeatDelay;
     this.Start(sub, sub.transform.localPosition, parms.vec, parms.vec2, parms.duration, parms.delay, null, new EZAnimation.CompletionDelegate(parms.transition.OnAnimEnd));
     return(true);
 }
Пример #3
0
 public void Copy(AnimParams src)
 {
     this.mode            = src.mode;
     this.delay           = src.delay;
     this.duration        = src.duration;
     this.easing          = src.easing;
     this.color           = src.color;
     this.vec             = src.vec;
     this.axis            = src.axis;
     this.floatVal        = src.floatVal;
     this.color2          = src.color2;
     this.vec2            = src.vec2;
     this.floatVal2       = src.floatVal2;
     this.strVal          = src.strVal;
     this.pingPong        = src.pingPong;
     this.repeatDelay     = src.repeatDelay;
     this.restartOnRepeat = src.restartOnRepeat;
 }
 public override bool Start(GameObject sub, AnimParams parms)
 {
     if (sub == null)
     {
         return(false);
     }
     this.pingPong        = parms.pingPong;
     this.restartOnRepeat = parms.restartOnRepeat;
     this.repeatDelay     = parms.repeatDelay;
     float[] delay = new float[]
     {
         parms.delay,
         parms.delay,
         parms.delay
     };
     this.Start(sub, parms.duration, delay, null, new EZAnimation.CompletionDelegate(parms.transition.OnAnimEnd));
     return(true);
 }
 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);
 }
 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);
 }
Пример #7
0
 public void SetAnimParameter(string param, object value)
 {
     AnimUtils.SetParameter(Animator, param, value, AnimParams.IsTrigger(param));
 }
 public abstract bool Start(GameObject sub, AnimParams parms);
 public void SetValue(AnimParams _name, float _value)
 {
     animator.SetFloat(_name.ToString(), _value);
 }
 public void SetValue(AnimParams _name, bool _value)
 {
     animator.SetBool(_name.ToString(), _value);
 }
 public void SetValue(AnimParams _name)
 {
     animator.SetTrigger(_name.ToString());
 }