Пример #1
0
 public void Jump(float x, float y)
 {
     if (this.jumpWidgetInfoList.Count > 0)
     {
         return;
     }
     foreach (Widget current in this.Children)
     {
         Vector2 vector = this.GetCenterPos(current) - new Vector2(x, y);
         LiveJumpPanel.JumpWidgetInfo jumpWidgetInfo = new LiveJumpPanel.JumpWidgetInfo();
         jumpWidgetInfo.originalPivot = current.PivotType;
         jumpWidgetInfo.Widget        = current;
         current.PivotType            = PivotType.MiddleCenter;
         current.ZSort = true;
         jumpWidgetInfo.JumpDlayTime = vector.Length() * this.jumpDelayTime;
         jumpWidgetInfo.Axes         = new Vector3(vector.Y, -vector.X, 0f).Normalize();
         this.jumpWidgetInfoList.Add(jumpWidgetInfo);
     }
     this.totalElapsedTime = 0f;
     if (this.jumpTime < 1000f)
     {
         this.maxBlurTime   = 480f;
         this.blurBoundTime = 170f;
         return;
     }
     this.blurBoundDistance += (this.jumpTime - 1000f) / this.boundDistanceN;
     this.maxBlurTime        = this.jumpTime / 2f;
     this.blurBoundTime      = this.maxBlurTime / 3f;
 }
Пример #2
0
 protected override void OnUpdate(float elapsedTime)
 {
     base.OnUpdate(elapsedTime);
     if (this.jumpWidgetInfoList.Count > 0)
     {
         List <LiveJumpPanel.JumpWidgetInfo> list = new List <LiveJumpPanel.JumpWidgetInfo>();
         this.totalElapsedTime += elapsedTime;
         using (List <LiveJumpPanel.JumpWidgetInfo> .Enumerator enumerator = this.jumpWidgetInfoList.GetEnumerator())
         {
             while (enumerator.MoveNext())
             {
                 LiveJumpPanel.JumpWidgetInfo current = enumerator.Current;
                 float num = this.totalElapsedTime - current.JumpDlayTime;
                 if (num >= 0f)
                 {
                     if (num < this.jumpTime + this.maxBlurTime)
                     {
                         Widget  widget      = current.Widget;
                         Matrix4 transform3D = Matrix4.RotationAxis(current.Axes, this.GetRotationAngle(num));
                         transform3D.ColumnW = (new Vector4(widget.X, widget.Y, this.GetJumpDistance(num), 1f));
                         widget.Transform3D  = transform3D;
                     }
                     else
                     {
                         list.Add(current);
                     }
                 }
             }
         }
         using (List <LiveJumpPanel.JumpWidgetInfo> .Enumerator enumerator2 = list.GetEnumerator())
         {
             while (enumerator2.MoveNext())
             {
                 LiveJumpPanel.JumpWidgetInfo current2 = enumerator2.Current;
                 current2.Widget.Transform3D = Matrix4.Translation(new Vector3(current2.Widget.X, current2.Widget.Y, 0f));
                 current2.Widget.PivotType   = current2.originalPivot;
                 current2.Widget.ZSort       = false;
                 this.jumpWidgetInfoList.Remove(current2);
             }
         }
     }
 }