public IEnumerator Paste(bool flipped = false) { float initTime = Mathf.Infinity; clearListOfSelectedObject(); List <WallObject> wallObjectsToCreate = new List <WallObject>(); foreach (WallObject wallObject in _clipboard) { if (wallObject.Time < initTime) { initTime = wallObject.Time; } } bool pasteWithoutProblems = canPasteWithoutProblems(initTime); if (!pasteWithoutProblems) { DialogsWindowsManager.Instance.ShowWindow(DialogsWindowsManager.Window.ConfirmPaste); while (!FinishPasteDialog) { yield return(null); } FinishPasteDialog = false; if (!ConfirmPaste) { yield break; } } foreach (WallObject wallObject in _clipboard) { float time = _cursorTime + wallObject.Time - initTime; if (!pasteWithoutProblems && time > ClipInfo.ClipTimeSize) { continue; } // time = time > ClipInfo.ClipTimeSize ? ClipInfo.ClipTimeSize : time; string newWallObjectID = flipped == true?WallsUtils.FlipWallObject(wallObject.WallObjectId) : wallObject.WallObjectId; WallObject currentWallObject = _songManager.CreateWallObject(newWallObjectID, time, true, this); addWallObjectToSelectedList(currentWallObject); currentWallObject.GetComponent <Transform>().Find("MarkLine").gameObject.SetActive(_zoom >= WallMarklineVisibleAtZoomLevel); currentWallObject.GetComponent <Transform>().Find("Toggle/Wall Id").gameObject.SetActive(_zoom >= WallIdVisibleAtZoomLevel); } yield break; }
public void Flip() { _clipboard = new HashSet <WallObject>(_selectedWallObjects); // clearListOfSelectedObject(); foreach (WallObject wallObject in _clipboard) { string flippedId = WallsUtils.FlipWallObject(wallObject.WallObjectId); if (_clipboard.Count == 1) { OnUpdateWallId(flippedId); } wallObject.WallObjectId = flippedId; } }