Пример #1
0
        /// <summary>
        /// 按钮每次显示之前,都需要初始化的一些内容
        /// </summary>
        public void InitToShow()
        {
            // 设置离开方式为普通
            transitOutGroup = 0;

            ClickTransit.resetTransit(false);
            NormalTransit.resetTransit(true);

            if (tweenScaleForPointEnter.direction != TweenDirection.Forward)
            {
                tweenScaleForPointEnter.Toggle();
            }
            tweenScaleForPointEnter.ResetToBeginning();
            tweenScaleForPointEnter.enabled = false;
        }
Пример #2
0
        public void resetTransit(bool isIn)
        {
            if (isIn)
            {
                for (int i = 0; i < transitInTweener.Count; i++)
                {
                    UITweener tw = transitInTweener[i];
                    ResetTween(tw, isIn);
                }
            }
            else
            {
                for (int i = 0; i < transitOutTweener.Count; i++)
                {
                    UITweener tw = transitOutTweener[i];
                    ResetTween(tw, isIn);
                }
            }

            if (needTransitChild)
            {
                TweenerGroupTransitObject[] list = GetComponentsInChildren <TweenerGroupTransitObject>(true);
                for (int i = 0; i < list.Length; i++)
                {
                    TweenerGroupTransitObject tobj = list[i];
                    if (tobj != this && tobj.transitGroup == this.transitGroup)
                    {
                        //tobj.tweenerGroup = this.tweenerGroup;
                        tobj.resetTransit(isIn);
                    }
                }
            }
        }
Пример #3
0
        /*
         * /// <summary>
         * /// 根据给定象限,计算按钮中心点位置
         * /// </summary>
         * /// <param name="q"></param>
         * /// <returns></returns>
         * public Vector2 GetCenterByQuadrant(QUADRANT q)
         * {
         *  Vector2 vt = new Vector2();
         *  switch (q)
         *  {
         *      case QUADRANT.First:
         *          vt.x = (ButtonWidth + ButtonInterval) / 2;
         *          vt.y = (ButtonHeight + ButtonInterval) / 2;
         *          break;
         *      case QUADRANT.Second:
         *          vt.x = -(ButtonWidth + ButtonInterval) / 2;
         *          vt.y = (ButtonHeight + ButtonInterval) / 2;
         *          break;
         *      case QUADRANT.Thrid:
         *          vt.x = -(ButtonWidth + ButtonInterval) / 2;
         *          vt.y = -(ButtonHeight + ButtonInterval) / 2;
         *          break;
         *      case QUADRANT.Fourth:
         *          vt.x = (ButtonWidth + ButtonInterval) / 2;
         *          vt.y = -(ButtonHeight + ButtonInterval) / 2;
         *          break;
         *  }
         *
         *  return vt;
         * }
         */

        /// <summary>

        public void ResetButton()
        {
            for (int i = 0; i < 4; i++)
            {
                BlockButton button = buttons[i];
                if (button == null)
                {
                    continue;
                }

                TweenerGroupTransitObject tObj = button.GetComponent <TweenerGroupTransitObject>();
                tObj.resetTransit(true);
            }
        }