コード例 #1
0
 public override void ProcessTouchReleased()
 {
     if (isPressed)
     {
         base.ProcessTouchReleased();
         float num = 0f;
         foreach (string str  in  this._buttonElement.Keys)
         {
             LNNode node = (LNNode)CollectionUtils.Get(this._buttonElement, str);
             node.StopAllAction();
             if (this._touchClickedAction.ContainsKey(str))
             {
                 num = MathUtils.Max(num, ((LNAction)CollectionUtils.Get(this._touchClickedAction, str))
                                     .GetDuration());
                 node.RunAction((LNAction)CollectionUtils.Get(this._touchClickedAction, str));
             }
         }
         if (ActionCallBack != null)
         {
             if (num > 0f)
             {
                 base.RunAction(LNSequence.Action(LNDelay.Action(num),
                                                  LNCallFunc.Action(ActionCallBack)));
             }
             else
             {
                 base.RunAction(LNCallFunc.Action(ActionCallBack));
             }
         }
         isPressed = false;
     }
 }
コード例 #2
0
 public override void ProcessTouchDragged()
 {
     base.ProcessTouchDragged();
     foreach (string key in this._buttonElement.Keys)
     {
         LNNode node = (LNNode)CollectionUtils.Get(this._buttonElement, key);
         node.StopAllAction();
         if (this._touchBeganAction.ContainsKey(key))
         {
             node.RunAction((LNAction)CollectionUtils.Get(this._touchBeganAction, key));
         }
     }
     isDraging = true;
 }
コード例 #3
0
 public override void Update(float dt)
 {
     base.Update(dt);
     if (isDraging && !Touch.IsDrag())
     {
         foreach (string key  in  this._buttonElement.Keys)
         {
             LNNode node = (LNNode)CollectionUtils.Get(this._buttonElement, key);
             node.StopAllAction();
             if (this._touchMoveOutAction.ContainsKey(key))
             {
                 node.RunAction((LNAction)CollectionUtils.Get(this._touchMoveOutAction, key));
             }
         }
         isDraging = false;
     }
 }
コード例 #4
0
 public override void ProcessTouchPressed()
 {
     if (!isPressed)
     {
         base.ProcessTouchPressed();
         foreach (string str  in  this._buttonElement.Keys)
         {
             LNNode node = (LNNode)CollectionUtils.Get(this._buttonElement, str);
             node.StopAllAction();
             if (this._touchBeganAction.ContainsKey(str))
             {
                 node.RunAction((LNAction)CollectionUtils.Get(this._touchBeganAction, str));
             }
         }
         isPressed = true;
     }
 }