wei
2021-10-28 270b3d8539f6b4a991a9ebf3b3a9eceb436d61d5
HDL_ON/UI/UI0-Stan/Controls/CompoundControls/DirectionImageControl.cs
old mode 100755 new mode 100644
@@ -14,13 +14,13 @@
        #region ■ 变量声明___________________________
        /// <summary>
        /// 控制事件(不支持Enable和Disable,都归为Mid)
        /// 点击后自动还原状态的控制事件(只有Mid,left,right,up,down)
        /// </summary>
        public Action<DirectionEnum> ControlEvent = null;
        public Action<DirectionEnum> AutoRecoverControlEvent = null;
        /// <summary>
        /// 是否使用点击特效,一旦设置为true,则点击之后,会自动还原回Enable状态
        /// 点击后不会还原状态的控制事件(只有enable,Mid,left,right,up,down。 enable:手指松开方向键后触发)
        /// </summary>
        public bool UseClickStau = false;
        public Action<DirectionEnum> NotRecoverControlEvent = null;
        /// <summary>
        /// 能否控制方向
        /// </summary>
@@ -75,7 +75,8 @@
                //开启等待线程(不允许狂点)
                this.StartWaitThread();
                this.ControlEvent?.Invoke(DirectionEnum.Mid);
                this.AutoRecoverControlEvent?.Invoke(DirectionEnum.Mid);
                this.NotRecoverControlEvent?.Invoke(DirectionEnum.Mid);
            };
            //上按钮
@@ -161,7 +162,7 @@
                //不能控制方向
                this.CanDirection = false;
            }
            else if (direction == DirectionEnum.Enable)
            else
            {
                //能够控制方向
                this.CanDirection = true;
@@ -191,19 +192,21 @@
            }
            //如果使用特效的话
            if (this.UseClickStau == true)
            if (this.AutoRecoverControlEvent != null)
            {
                //切换图片
                this.SetDirectionImage(direction);
                //开启等待线程(不允许狂点)
                this.StartWaitThread();
                this.AutoRecoverControlEvent?.Invoke(direction);
            }
            else
            {
                //切换图片
                this.SetDirectionImage(DirectionEnum.Enable);
                this.NotRecoverControlEvent?.Invoke(DirectionEnum.Enable);
            }
            this.ControlEvent?.Invoke(direction);
        }
        /// <summary>
@@ -213,12 +216,13 @@
        private void DirectionDownClickEvent(DirectionEnum direction)
        {
            //如果不使用特效的话
            if (this.CanClick == false || this.CanDirection == false || this.UseClickStau == true)
            if (this.CanClick == false || this.CanDirection == false || this.NotRecoverControlEvent == null)
            {
                return;
            }
            //切换图片
            this.SetDirectionImage(direction);
            this.NotRecoverControlEvent?.Invoke(direction);
        }
        #endregion
@@ -237,7 +241,7 @@
                this.CanClick = true;
                //如果不使用特效的话
                if (this.UseClickStau == false)
                if (this.NotRecoverControlEvent != null)
                {
                    return;
                }