コード例 #1
0
 public void Undo(EditorController ec)
 {
     ec.DoAddLine(sx, sy);
     foreach (var c in commands)
     {
         c.Undo(ec);
     }
 }
コード例 #2
0
 public void Redo(EditorController ec)
 {
     placed = ec.AddFromPalette(x, y, code);
     level  = ec.level;
     if (color.HasValue)
     {
         placed.color = color.Value;
     }
 }
コード例 #3
0
        public void Redo(EditorController ec)
        {
            ec.DoRemoveLine(sx, sy);
            List <GameObject> removedObject = new List <GameObject>();

            foreach (Transform eo in ec.level.objectsDomain)
            {
                if (!ec.level.IsValidCoord((int)eo.position.x, (int)eo.position.y))
                {
                    removedObject.Add(eo.gameObject);
                }
            }
            foreach (var eo in removedObject)
            {
                ICommand command = new RemoveObjectCommand(eo.gameObject);
                command.Redo(ec);
                commands.Push(command);
            }
        }
コード例 #4
0
 public void Undo(EditorController ec)
 {
     ec.DoRemoveLine(sx, sy);
 }
コード例 #5
0
 public void Redo(EditorController ec)
 {
     ec.DoAddLine(sx, sy);
 }
コード例 #6
0
 public void Undo(EditorController ec)
 {
     eo.transform.SetParent(_originParent, true);
 }
コード例 #7
0
 public void Redo(EditorController ec)
 {
     _originParent = eo.transform.parent;
     eo.transform.SetParent(ec.removedDomain, true);
 }
コード例 #8
0
 public void Undo(EditorController ec)
 {
     color = placed.color;
     GameObject.Destroy(placed.gameObject);
 }