コード例 #1
0
        void Update()
        {
            if (grid == null || !invalid)
            {
                return;
            }
            float delta = Time.deltaTime;

            if (rowCount == 0)
            {
                Init();
            }
            for (int r = 0; r < rowCount; r++)
            {
                float old = rowDelay[r];
                rowDelay[r] = Math.Min(rowDelay[r] + delta * speed, 1);
                float time          = Math.Max(0, rowDelay[r]);
                float interpolation = TweenEasingFunctions.GetFunction(easeType)(time);
                for (int c = 0; c < colCount; c++)
                {
                    Transform t = grid.GetCell(r, c);
                    if (t != null)
                    {
                        animator(r, t, cellScales[r, c], cellPos[r, c], interpolation);
                    }
                }
                if (animateBackground)
                {
                    Transform bg = grid.GetBackground(r);
                    if (bg != null)
                    {
                        animator(r, bg, bgScales[r], bgPos[r], interpolation);
                    }
                }
                if (r >= grid.rowHeader && old <= 0 && time > 0)
                {
                    foreach (UITableAnimEventListener l in listeners)
                    {
                        l.OnRowAnimBegin(r - grid.rowHeader);
                    }
                }
                if (r >= grid.rowHeader && old < 1 && time >= 1)
                {
                    foreach (UITableAnimEventListener l in listeners)
                    {
                        l.OnRowAnimEnd(r - grid.rowHeader);
                    }
                }
            }
            if (rowCount > 0 && rowDelay[rowCount - 1] >= 1)
            {
                for (int r = 0; r < rowCount; r++)
                {
                    Transform bg = grid.GetBackground(r);
                    if (bg != null)
                    {
                        NGUIUtil.UpdateCollider(bg);
                    }
                }
                invalid = false;
                foreach (UITableAnimEventListener l in listeners)
                {
                    l.OnAnimEnd();
                }
            }
        }
コード例 #2
0
 public static void ResizeCollider()
 {
     NGUIUtil.UpdateCollider(Selection.activeGameObject.transform);
 }