private void NewPlaceableClick(Placeable placeable) { Placeable newPlaceable = Instantiate(placeable); newPlaceable.name = placeable.name; currentPlaceables.Add(newPlaceable); newPlaceable.transform.position = placeable.GetDefaultPosition(); selectedPlaceable = newPlaceable; SelectedPlaceableChanged?.Invoke(selectedPlaceable); }
private void Update() { if (Input.GetKeyDown(KeyCode.Delete)) { if (selectedPlaceable != null) { currentPlaceables.Remove(selectedPlaceable); Destroy(selectedPlaceable.gameObject); selectedPlaceable = null; SelectedPlaceableChanged?.Invoke(null); } } }