public void clearBlocks(bool keepStoredData = false) { if (succesPopup.isAnimating() || failPopup.isAnimating()) { return; } if (roadPlacer != null) { if (roadPlacer.isActive()) { return; } roadPlacer.clearRoad(); } succesPopup.OutAnimation(); failPopup.OutAnimation(); foreach (Block block in level.getBlocks()) { block.setPos(null).setRotation(0); block.removeBlueprintPrefab(); } level.clear(); if (!keepStoredData) { level.saveToDevice(""); } }
private void getBlocks() { if (blocks == null) { blocks = new Dictionary <int, List <Block> > (); Level level = GameMode.getCurrentLevel(); foreach (Block block in level.getBlocks()) { if (!blocks.ContainsKey(block.getId())) { blocks.Add(block.getId(), new List <Block> ()); } blocks [block.getId()].Add(block); } } }