コード例 #1
0
        public static void AddUndo(UndoDelegate dgtUndo, object[] aobArgs)
        {
            if (s_fGrouping)
                s_cElements++;

            s_stk.Push(aobArgs);
            s_stk.Push(dgtUndo);
        }
コード例 #2
0
 public void AddGauge(int gauge, UndoDelegate undoDelegate)
 {
     nowGauge += gauge;
     if (nowGauge >= MAX_GAUGE)
     {
         nowGauge = MAX_GAUGE;
         StartCoroutine(ThrownOut(undoDelegate));
     }
 }
コード例 #3
0
        public static void AddUndo(UndoDelegate dgtUndo, object[] aobArgs)
        {
            if (s_fGrouping)
            {
                s_cElements++;
            }

            s_stk.Push(aobArgs);
            s_stk.Push(dgtUndo);
        }
コード例 #4
0
 /// <summary>
 /// Same as PushAndDo(desc, redo, undo) but also calls the specified UpdateDelegate after
 /// both the undo and redo operation.
 ///
 /// This is to avoid code duplication if some UI elements needs to be updated in either case.
 /// </summary>
 /// <param name="description"></param>
 /// <param name="redo"></param>
 /// <param name="undo"></param>
 /// <param name="update"></param>
 public void PushAndDo(String description, RedoDelegate redo, UndoDelegate undo, UpdateDelegate update)
 {
     PushAndDo(description,
               () =>
     {
         redo();
         update();
     },
               () =>
     {
         undo();
         update();
     });
 }
コード例 #5
0
ファイル: UndoStack.cs プロジェクト: Kolky/open3mod
 /// <summary>
 /// Same as PushAndDo(desc, redo, undo) but also calls the specified UpdateDelegate after
 /// both the undo and redo operation.
 /// 
 /// This is to avoid code duplication if some UI elements needs to be updated in either case.
 /// </summary>
 /// <param name="description"></param>
 /// <param name="redo"></param>
 /// <param name="undo"></param>
 /// <param name="update"></param>
 public void PushAndDo(String description, RedoDelegate redo, UndoDelegate undo, UpdateDelegate update)
 {
     PushAndDo(description,
         () =>
         {
             redo();
             update();
         },
         () =>
         {
             undo();
             update();
         });
 }
コード例 #6
0
ファイル: UndoStack.cs プロジェクト: Kolky/open3mod
        /// <summary>
        /// Create an entry on the undo stack with the given delegates to undo and redo the operation.
        /// 
        /// Calls the "redo" delegate once.
        /// </summary>
        /// <param name="description">UI text, keep brief.</param>
        /// <param name="undo"></param>
        /// <param name="redo"></param>
        public void PushAndDo(String description, RedoDelegate redo, UndoDelegate undo)
        {
            if (_cursor == _stack.Count)
            {
                _stack.Add(new UndoStackEntry());
            }
            var entry = _stack[_cursor];
            entry.Description = description;
            entry.Redo = redo;
            entry.Undo = undo;
            redo();

            ++_cursor;
        }
コード例 #7
0
        /// <summary>
        /// Create an entry on the undo stack with the given delegates to undo and redo the operation.
        ///
        /// Calls the "redo" delegate once.
        /// </summary>
        /// <param name="description">UI text, keep brief.</param>
        /// <param name="undo"></param>
        /// <param name="redo"></param>
        public void PushAndDo(String description, RedoDelegate redo, UndoDelegate undo)
        {
            if (_cursor == _stack.Count)
            {
                _stack.Add(new UndoStackEntry());
            }
            var entry = _stack[_cursor];

            entry.Description = description;
            entry.Redo        = redo;
            entry.Undo        = undo;
            redo();

            ++_cursor;
        }
コード例 #8
0
    private IEnumerator ThrownOut(UndoDelegate undoDelegate)
    {
        int toLayer = player.OppositeLayer(player.ParentTimeLayer.layerNum);

        // 다른 레이어로 갈 수 있다면 시간을 바꾸고
        // 갈 수 없다면 죽인다
        if (player.CanSwitchingTime(toLayer))
        {
            player.DoTimeSwitch();
            yield return(StartCoroutine(followUpCamera.DoElasticEffect()));

            undoDelegate();
        }
        else
        {
            player.Dead(true);
        }
    }
コード例 #9
0
 public void AddElasticityGauge(int gauge, UndoDelegate undoDelegate)
 {
     elasticityGaugeManager.AddGauge(gauge, undoDelegate);
 }