Exemple #1
0
 public TransformAnimationTask(Transform tm, float duration, [Optional, DefaultParameterValue(0f)] float delay, [Optional, DefaultParameterValue(2)] TimeUtil.DeltaTimeType dtType)
 {
     this.m_transform     = tm;
     this.m_rectTransform = !(tm is RectTransform) ? null : ((RectTransform)tm);
     this.m_timer         = 0f;
     this.m_duration      = duration;
     this.m_delay         = delay;
     this.m_dtType        = dtType;
 }
Exemple #2
0
 public TransformAnimationTask(Transform tm, TransformAnimationTask preset, [Optional, DefaultParameterValue(2)] TimeUtil.DeltaTimeType dtType)
 {
     this.m_transform     = tm;
     this.m_rectTransform = !(tm is RectTransform) ? null : ((RectTransform)tm);
     if (preset.m_translation != null)
     {
         this.m_translation           = new Translation();
         this.m_translation.axis      = preset.m_translation.axis;
         this.m_translation.start     = !preset.m_translation.local ? this.m_transform.position : this.m_transform.localPosition;
         this.m_translation.target    = preset.m_translation.target;
         this.m_translation.local     = preset.m_translation.local;
         this.m_translation.easing    = preset.m_translation.easing;
         this.m_translation.algorithm = preset.m_translation.algorithm;
         this.m_translation.cp0       = preset.m_translation.cp0;
         this.m_translation.cp1       = preset.m_translation.cp1;
     }
     if (preset.m_translationAnchoredPosition != null)
     {
         this.m_translationAnchoredPosition           = new TranslationAnchoredPosition();
         this.m_translationAnchoredPosition.start     = this.m_rectTransform.anchoredPosition;
         this.m_translationAnchoredPosition.target    = preset.m_translationAnchoredPosition.target;
         this.m_translationAnchoredPosition.easing    = preset.m_translationAnchoredPosition.easing;
         this.m_translationAnchoredPosition.algorithm = preset.m_translationAnchoredPosition.algorithm;
     }
     if (preset.m_rotation != null)
     {
         this.m_rotation          = new Rotation();
         this.m_rotation.axis     = preset.m_rotation.axis;
         this.m_rotation.start    = !preset.m_rotation.local ? this.m_transform.rotation : this.m_transform.localRotation;
         this.m_rotation.target   = preset.m_rotation.target;
         this.m_rotation.rotateBy = preset.m_rotation.rotateBy;
         this.m_rotation.local    = preset.m_rotation.local;
         this.m_rotation.easing   = preset.m_rotation.easing;
         this.m_rotation.lazy     = preset.m_rotation.lazy;
     }
     if (preset.m_scaling != null)
     {
         this.m_scaling        = new Scaling();
         this.m_scaling.axis   = preset.m_scaling.axis;
         this.m_scaling.start  = !preset.m_scaling.local ? this.m_transform.lossyScale : this.m_transform.localScale;
         this.m_scaling.target = preset.m_scaling.target;
         this.m_scaling.local  = preset.m_scaling.local;
         this.m_scaling.easing = preset.m_scaling.easing;
     }
     this.m_timer    = 0f;
     this.m_duration = preset.m_duration;
     this.m_delay    = preset.m_delay;
     this.m_dtType   = dtType;
 }
Exemple #3
0
 public TransformAnimationTask(Transform tm, AnimationCurve animation, float duration, [Optional, DefaultParameterValue(0f)] float delay, [Optional, DefaultParameterValue(2)] TimeUtil.DeltaTimeType dtType)
 {
     if (animation == null)
     {
         Debug.LogError("Animation was null!");
     }
     else if (animation.keys.Length < 2)
     {
         Debug.LogError("Animation had less than two keyframes!");
     }
     this.m_transform     = tm;
     this.m_rectTransform = !(tm is RectTransform) ? null : ((RectTransform)tm);
     this.m_animation     = animation;
     AnimationCurveExtensions.SnapKeyToValue(this.m_animation, 0, 0f);
     AnimationCurveExtensions.SnapKeyToValue(this.m_animation, AnimationCurveExtensions.LastIndex(this.m_animation), 1f);
     this.m_timer    = 0f;
     this.m_duration = duration;
     this.m_delay    = delay;
     this.m_dtType   = dtType;
 }