public void PaintBlock(Block block, BlockDirection direction, bool isObject, int textureChip) { EditLayer layer = this.CurrentLayer; int oldTextureChip = block.GetTextureChip(direction, isObject); this.AddCommand(new Command( () => { block.SetTextureChip(direction, isObject, textureChip); layer.SetDirty(); }, () => { block.SetTextureChip(direction, isObject, oldTextureChip); layer.SetDirty(); })); }
public void SetEnterable(Block block, bool enterable) { EditLayer layer = this.CurrentLayer; bool oldEnterable = block.enterable; this.AddCommand(new Command( () => { block.enterable = enterable; layer.SetDirty(); this.RoutePath.dirtyMesh = true; }, () => { block.enterable = oldEnterable; layer.SetDirty(); this.RoutePath.dirtyMesh = true; })); }