public void Reset() { cursor = new Point(-1, -1); nameStack.Clear(); cursorStack.Clear(); selectingEffect?.Finish(); selectingEffect = null; }
private void SetSelectingEffect() { try { // Choose different ISelectable depends on mode. Point l; Point s; if (mode == SelectMode.One) { if (matrices[matrixName][cursor.y, cursor.x] == null) { selectingEffect.Finish(); selectingEffect = null; return; } l = matrices[matrixName][cursor.y, cursor.x].GetLocation(); s = matrices[matrixName][cursor.y, cursor.x].GetSize(); } else if (mode == SelectMode.Row) { if (rowGroups[cursor.y] == null) { selectingEffect.Finish(); selectingEffect = null; return; } l = rowGroups[cursor.y].GetLocation(); s = rowGroups[cursor.y].GetSize(); } else { l = allGroup.GetLocation(); s = allGroup.GetSize(); } if (selectingEffect == null) { selectingEffect = new SelectingEffect(l.x, l.y, s.x, s.y, 2); topEffectLayer.elements.Add(selectingEffect); } else { selectingEffect.x = l.x; selectingEffect.y = l.y; selectingEffect.width = s.x; selectingEffect.height = s.y; } menuSelect_soundEffect.Play(0.2f, 0, 0); } catch (Exception e) { Console.WriteLine(e); selectingEffect?.Finish(); selectingEffect = null; return; } }