Example #1
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);
                    }
                }
            }
        }
Example #2
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);
            }
        }
Example #3
0
        public void resetTweenDirection(TweenDirection dir)
        {
            for (int i = 0; i < transitInTweener.Count; i++)
            {
                UITweener tw = transitInTweener[i];

                if (tw.direction != dir)
                {
                    tw.Toggle();
                    tw.enabled = false;
                }
            }
            for (int i = 0; i < transitOutTweener.Count; i++)
            {
                UITweener tw = transitOutTweener[i];

                if (tw.direction != dir)
                {
                    tw.Toggle();
                    tw.enabled = false;
                }
            }
            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.resetTweenDirection(dir);
                    }
                }
            }
        }