Exemplo n.º 1
0
        private void OnClickMask()
        {
            ITweenChain tween = TweenAllocate.Sequence();

            tween.Append(_animRectTrans.TweenAnchoredPositionTo(0.5f, new Vector2(800, 0)).SetLerp(LerpBezierFun));
            tween.Append(_animRectTrans.transform.TweenScaleTo(0.5f, Vector3.zero).SetEase(TweenEase.Bounce.EaseOut));
            tween.Execute(() => { UITools.CloseWindow <UIMap>(); });
            this.Go.PlayTween(tween);
        }
Exemplo n.º 2
0
        /// <summary>
        /// 播放一个补间动画
        /// </summary>
        /// <param name="tweenChain">补间根节点</param>
        /// <param name="go">游戏对象</param>
        /// <returns>补间动画唯一ID</returns>
        public long Play(ITweenChain tweenChain, UnityEngine.GameObject go = null)
        {
            ITweenNode tweenRoot = tweenChain as ITweenNode;

            if (tweenRoot == null)
            {
                throw new System.InvalidCastException();
            }

            return(Play(tweenRoot, go));
        }
Exemplo n.º 3
0
        /// <summary>
        /// 播放一个补间动画
        /// </summary>
        /// <param name="tweenChain">补间根节点</param>
        /// <param name="safeObject">安全游戏对象:如果安全游戏对象被销毁,补间动画会自动终止</param>
        /// <param name="groupID">补间组ID</param>
        /// <returns>补间动画唯一ID</returns>
        public long Play(ITweenChain tweenChain, UnityEngine.Object safeObject = null, int groupID = 0)
        {
            ITweenNode tweenRoot = tweenChain as ITweenNode;

            if (tweenRoot == null)
            {
                throw new System.InvalidCastException();
            }

            return(Play(tweenRoot, safeObject, groupID));
        }
Exemplo n.º 4
0
        private void OnClickMask()
        {
            // 窗口关闭动画

            /*
             * ITweenNode tween = SequenceNode.Allocate(
             *      _animRectTrans.TweenAnchoredPositionTo(0.5f, new Vector2(800, 0)).SetLerp(LerpBezierFun),
             *      _animRectTrans.transform.TweenScaleTo(0.5f, Vector3.zero).SetEase(TweenEase.Bounce.EaseOut),
             *      ExecuteNode.Allocate(() => { UITools.CloseWindow<UIMap>(); })
             *      );
             * TweenGrouper.Play(tween);
             */

            ITweenChain tween = SequenceNode.Allocate();

            tween.Append(_animRectTrans.TweenAnchoredPositionTo(0.5f, new Vector2(800, 0)).SetLerp(LerpBezierFun));
            tween.Append(_animRectTrans.transform.TweenScaleTo(0.5f, Vector3.zero).SetEase(TweenEase.Bounce.EaseOut));
            tween.Execute(() => { UITools.CloseWindow <UIMap>(); });
            TweenGrouper.Play(tween);
        }
Exemplo n.º 5
0
        /// <summary>
        /// 播放一个补间动画
        /// </summary>
        public long Play(ITweenChain tweenChain, UnityEngine.Object safeObject = null)
        {
            int groupID = this.GetHashCode();

            return(TweenManager.Instance.Play(tweenChain, safeObject, groupID));
        }
Exemplo n.º 6
0
 /// <summary>
 /// 持续计时节点
 /// </summary>
 public static ITweenChain Duration(this ITweenChain chain, float delay, float duration, System.Action triggerCallback = null)
 {
     return(chain.Append(TimerNode.AllocateDuration(delay, duration, triggerCallback)));
 }
Exemplo n.º 7
0
 /// <summary>
 /// 重复计时节点
 /// </summary>
 public static ITweenChain Repeat(this ITweenChain chain, float delay, float interval, long maxTriggerCount, System.Action triggerCallback = null)
 {
     return(chain.Append(TimerNode.AllocateRepeat(delay, interval, maxTriggerCount, triggerCallback)));
 }
Exemplo n.º 8
0
 /// <summary>
 /// 执行节点
 /// </summary>
 public static ITweenChain Execute(this ITweenChain chain, System.Action execute)
 {
     return(chain.Append(ExecuteNode.Allocate(execute)));
 }
Exemplo n.º 9
0
 /// <summary>
 /// 条件等待节点
 /// </summary>
 public static ITweenChain Until(this ITweenChain chain, System.Func <bool> condition)
 {
     return(chain.Append(UntilNode.Allocate(condition)));
 }
Exemplo n.º 10
0
 /// <summary>
 /// 添加节点
 /// </summary>
 public static ITweenChain Append(this ITweenChain chain, ITweenNode node)
 {
     return(chain.Append(node));
 }
 public static long PlayTween(this GameObject go, ITweenChain tween)
 {
     return(TweenManager.Instance.Play(tween, go));
 }
Exemplo n.º 12
0
 /// <summary>
 /// 重复计时节点
 /// </summary>
 public static ITweenChain Repeat(this ITweenChain chain, float delay, float interval, float duration, System.Action triggerCallback = null)
 {
     return(chain.Append(TweenAllocate.Repeat(delay, interval, duration, triggerCallback)));
 }
Exemplo n.º 13
0
 /// <summary>
 /// 延迟计时节点
 /// </summary>
 public static ITweenChain Delay(this ITweenChain chain, float delay, System.Action triggerCallback = null)
 {
     return(chain.Append(TweenAllocate.Delay(delay, triggerCallback)));
 }