Exemplo n.º 1
0
 public int addTask(TransformAnimationTask animationTask)
 {
     this.m_lastId++;
     this.m_tasks.Add(this.m_lastId, animationTask);
     this.m_queue.Enqueue(this.m_lastId);
     return(this.m_lastId);
 }
Exemplo n.º 2
0
 private void tick()
 {
     if (!this.m_paused)
     {
         int key = this.peekNext();
         if (key != -1)
         {
             TransformAnimationTask task = this.m_tasks[key];
             float progress = task.Progress;
             task.apply();
             if (((progress == 0f) && (task.Progress > 0f)) && (task.StartCallback != null))
             {
                 task.StartCallback(this);
             }
             if (task.Completed)
             {
                 this.m_tasks.Remove(key);
                 this.m_queue.Dequeue();
                 if (task.EndCallback != null)
                 {
                     task.EndCallback(this);
                 }
             }
         }
     }
 }
        private void animatedObjectScaling(GameObject go, Vector3 targetLocalScale)
        {
            go.SetActive(true);
            TransformAnimation     animation     = this.m_transformAnimations[go];
            TransformAnimationTask animationTask = new TransformAnimationTask(animation.transform, 0.3f, 0f, TimeUtil.DeltaTimeType.UNSCALED_DELTA_TIME);

            animationTask.scale(targetLocalScale, true, ConfigUi.MENU_EASING_OUT);
            animation.addTask(animationTask);
        }
Exemplo n.º 4
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;
 }
Exemplo n.º 5
0
 public void stopTask(TransformAnimationTask animationTask)
 {
     foreach (KeyValuePair <int, TransformAnimationTask> pair in this.m_tasks)
     {
         if (pair.Value.Equals(this.m_tasks))
         {
             if (pair.Value.CancelCallback != null)
             {
                 pair.Value.CancelCallback(pair.Key);
             }
             this.m_tasks.Remove(pair.Key);
             break;
         }
     }
 }
Exemplo n.º 6
0
 protected void Awake()
 {
     this.Tm = base.transform;
     this.TransformAnimation = base.gameObject.AddComponent <TransformAnimation>();
     this.m_taTask           = new TransformAnimationTask(this.Tm, ConfigUi.FLOATER_ENTRY_DURATION, 0f, TimeUtil.DeltaTimeType.UNSCALED_DELTA_TIME);
     this.m_taTask.scale(Vector3.one, true, Easing.Function.OUT_BACK);
     this.m_multikill3Text       = this.Multikill3.GetComponent <UnityEngine.UI.Text>();
     this.m_multikill4Text       = this.Multikill4.GetComponent <UnityEngine.UI.Text>();
     this.m_multikill5Text       = this.Multikill5.GetComponent <UnityEngine.UI.Text>();
     this.m_multikill6Text       = this.Multikill6.GetComponent <UnityEngine.UI.Text>();
     this.m_multikill7Text       = this.Multikill7.GetComponent <UnityEngine.UI.Text>();
     this.m_multikill8Text       = this.Multikill8.GetComponent <UnityEngine.UI.Text>();
     this.m_multikill9Text       = this.Multikill9.GetComponent <UnityEngine.UI.Text>();
     this.m_multikill10Text      = this.Multikill10.GetComponent <UnityEngine.UI.Text>();
     this.m_multikill3Text.text  = _.L(ConfigLoca.MULTIKILL3_ANNOUNCEMENT, null, false);
     this.m_multikill4Text.text  = _.L(ConfigLoca.MULTIKILL4_ANNOUNCEMENT, null, false);
     this.m_multikill5Text.text  = _.L(ConfigLoca.MULTIKILL5_ANNOUNCEMENT, null, false);
     this.m_multikill6Text.text  = _.L(ConfigLoca.MULTIKILL6_ANNOUNCEMENT, null, false);
     this.m_multikill7Text.text  = _.L(ConfigLoca.MULTIKILL7_ANNOUNCEMENT, null, false);
     this.m_multikill8Text.text  = _.L(ConfigLoca.MULTIKILL8_ANNOUNCEMENT, null, false);
     this.m_multikill9Text.text  = _.L(ConfigLoca.MULTIKILL9_ANNOUNCEMENT, null, false);
     this.m_multikill10Text.text = _.L(ConfigLoca.MULTIKILL10_ANNOUNCEMENT, null, false);
 }