public void BeginAnimating(TreeViewAnimationInput setup)
 {
     if (this.m_Setup != null)
     {
         if (this.m_Setup.item.id == setup.item.id)
         {
             if (this.m_Setup.elapsedTime >= 0.0)
             {
                 setup.elapsedTime = this.m_Setup.animationDuration - this.m_Setup.elapsedTime;
             }
             else
             {
                 Debug.LogError("Invaid duration " + this.m_Setup.elapsedTime);
             }
             this.m_Setup = setup;
         }
         else
         {
             this.m_Setup.FireAnimationEndedEvent();
             this.m_Setup = setup;
         }
         this.m_Setup.expanding = setup.expanding;
     }
     this.m_Setup = setup;
     if (this.m_Setup == null)
     {
         Debug.LogError("Setup is null");
     }
     if (this.printDebug)
     {
         Console.WriteLine("Begin animating: " + this.m_Setup);
     }
     this.m_CurrentClipRect = this.GetCurrentClippingRect();
 }
 public void BeginAnimating(TreeViewAnimationInput setup)
 {
     if (this.m_Setup != null)
     {
         if (this.m_Setup.item.id == setup.item.id)
         {
             if (this.m_Setup.elapsedTime >= 0.0)
             {
                 setup.elapsedTime = this.m_Setup.animationDuration - this.m_Setup.elapsedTime;
             }
             else
             {
                 Debug.LogError((object)("Invaid duration " + (object)this.m_Setup.elapsedTime));
             }
             this.m_Setup = setup;
         }
         else
         {
             this.m_Setup.FireAnimationEndedEvent();
             this.m_Setup = setup;
         }
         this.m_Setup.expanding = setup.expanding;
     }
     this.m_Setup = setup;
     if (this.m_Setup == null)
     {
         Debug.LogError((object)"Setup is null");
     }
     if (this.printDebug)
     {
         Console.WriteLine("Begin animating: " + (object)this.m_Setup);
     }
     this.m_CurrentClipRect = this.GetCurrentClippingRect();
 }
Exemplo n.º 3
0
 public void UserInputChangedExpandedState(TreeViewItem item, int row, bool expand)
 {
     if (this.useExpansionAnimation)
     {
         if (expand)
         {
             this.ChangeExpandedState(item, true);
         }
         int   num = row + 1;
         int   lastChildRowUnder      = this.GetLastChildRowUnder(row);
         float width                  = GUIClip.visibleRect.width;
         Rect  rectForRows            = this.GetRectForRows(num, lastChildRowUnder, width);
         float animationDuration      = this.GetAnimationDuration(rectForRows.height);
         TreeViewAnimationInput setup = new TreeViewAnimationInput
         {
             animationDuration = (double)animationDuration,
             startRow          = num,
             endRow            = lastChildRowUnder,
             startRowRect      = this.gui.GetRowRect(num, width),
             rowsRect          = rectForRows,
             startTime         = EditorApplication.timeSinceStartup,
             expanding         = expand,
             animationEnded    = new Action <TreeViewAnimationInput>(this.ExpansionAnimationEnded),
             item     = item,
             treeView = this
         };
         this.expansionAnimator.BeginAnimating(setup);
     }
     else
     {
         this.ChangeExpandedState(item, expand);
     }
 }
Exemplo n.º 4
0
 private void ExpansionAnimationEnded(TreeViewAnimationInput setup)
 {
     if (!setup.expanding)
     {
         this.ChangeExpandedState(setup.item, false);
     }
 }
Exemplo n.º 5
0
 public void OnBeforeAllRowsGUI()
 {
     if (this.isAnimating)
     {
         this.m_CurrentClipRect = this.GetCurrentClippingRect();
         if (this.m_Setup.elapsedTime > this.m_Setup.animationDuration)
         {
             this.m_Setup.FireAnimationEndedEvent();
             this.m_Setup = null;
             if (this.printDebug)
             {
                 Debug.Log("Animation ended");
             }
         }
     }
 }
 public void OnBeforeAllRowsGUI()
 {
     if (!this.isAnimating)
     {
         return;
     }
     this.m_CurrentClipRect = this.GetCurrentClippingRect();
     if (this.m_Setup.elapsedTime <= this.m_Setup.animationDuration)
     {
         return;
     }
     this.m_Setup.FireAnimationEndedEvent();
     this.m_Setup = (TreeViewAnimationInput)null;
     if (!this.printDebug)
     {
         return;
     }
     Debug.Log((object)"Animation ended");
 }
 public void OnBeforeAllRowsGUI()
 {
     if (this.isAnimating)
     {
         this.m_CurrentClipRect = this.GetCurrentClippingRect();
         if (this.m_Setup.elapsedTime > this.m_Setup.animationDuration)
         {
             this.m_Setup.FireAnimationEndedEvent();
             this.m_Setup = null;
             if (this.printDebug)
             {
                 Debug.Log("Animation ended");
             }
         }
     }
 }
 public void OnBeforeAllRowsGUI()
 {
   if (!this.isAnimating)
     return;
   this.m_CurrentClipRect = this.GetCurrentClippingRect();
   if (this.m_Setup.elapsedTime <= this.m_Setup.animationDuration)
     return;
   this.m_Setup.FireAnimationEndedEvent();
   this.m_Setup = (TreeViewAnimationInput) null;
   if (!this.printDebug)
     return;
   Debug.Log((object) "Animation ended");
 }
Exemplo n.º 9
0
 private void ExpansionAnimationEnded(TreeViewAnimationInput setup)
 {
   if (setup.expanding)
     return;
   this.ChangeExpandedState(setup.item, false);
 }