Пример #1
0
        public void Register(RectInt area, Vector2Int mapSize, Cell[] cells)
        {
            //var bytes = SerializationUtility.SerializeValue(cells, DataFormat.Binary);
            if (count > MaxChanges)
            {
                changeData.RemoveAt(0);
                count--;
            }

            //Debug.Log($"Storing undo into position {count} covering area {area}");

            area.ClampToBounds(new RectInt(0, 0, mapSize.x, mapSize.y));

            var data = new MapSubsetData();

            data.Store(cells, mapSize, area);
            changeData.Add(data);
            //Debug.Log($"Adding {data} to changeData, new count is: {changeData.Count}");
            count++;
        }
Пример #2
0
 public void Copy(RectInt area)
 {
     copyData = new MapSubsetData();
     copyData.Store(GetCellData(), Size, area);
 }