Exemple #1
0
 private void update_progress()
 {
     if (((this.Progress_Me != null) && (this.Progress_Other != null)) && (this.Progress_Light != null))
     {
         if ((this.score_me == 0) && (this.score_other == 0))
         {
             this.Progress_Me.sizeDelta           = new Vector2(this.allwidth / 2f, this.height);
             this.Progress_Other.sizeDelta        = new Vector2(this.allwidth / 2f, this.height);
             this.Progress_Light.anchoredPosition = new Vector2(0f, 0f);
         }
         else if (this.score_other == 0)
         {
             this.Progress_Me.sizeDelta           = new Vector2(this.allwidth, this.height);
             this.Progress_Other.sizeDelta        = new Vector2(0f, this.height);
             this.Progress_Light.anchoredPosition = new Vector2(this.allwidth / 2f, 0f);
         }
         else
         {
             float num  = this.score_me + this.score_other;
             float num2 = ((float)this.score_me) / num;
             float x    = num2 * this.allwidth;
             this.Progress_Me.sizeDelta           = new Vector2(x, this.height);
             this.Progress_Other.sizeDelta        = new Vector2(this.allwidth - x, this.height);
             this.Progress_Light.anchoredPosition = new Vector2(x - (this.allwidth / 2f), 0f);
             Transform transform = null;
             if (this.score_other > this.score_me)
             {
                 transform = this.Text_Other_Name.transform;
             }
             else if (this.score_me > this.score_other)
             {
                 transform = this.Text_Me_Name.transform;
             }
             if (transform != null)
             {
                 if (transform != this.t_name)
                 {
                     this.KillSeq();
                     if (this.t_name != null)
                     {
                         this.t_name.localScale    = Vector3.one;
                         this.t_name.localRotation = Quaternion.identity;
                     }
                     this.t_name            = transform;
                     this.t_name.localScale = Vector3.one * 1.35f;
                     this.seq_name          = DOTween.Sequence();
                     TweenSettingsExtensions.Append(this.seq_name, ShortcutExtensions.DOScale(this.t_name, Vector3.one * 1.5f, 0.1f));
                     TweenSettingsExtensions.Join(this.seq_name, ShortcutExtensions.DOShakeRotation(this.t_name, 0.1f, 5f, 10, 90f, true));
                     TweenSettingsExtensions.SetEase <Sequence>(this.seq_name, 6);
                     TweenSettingsExtensions.SetLoops <Sequence>(this.seq_name, -1, 1);
                     TweenSettingsExtensions.SetUpdate <Sequence>(this.seq_name, true);
                 }
             }
             else
             {
                 this.KillSeq();
             }
         }
     }
 }
Exemple #2
0
 public static Tweener DOShakeRotation(Transform target, float duration, Vector3 strength, int vibrato = 10, float randomness = 90f)
 {
     return(ShortcutExtensions.DOShakeRotation(target, duration, strength, vibrato, randomness));
 }