public void OffsetPosition(Vector3 Offset) { Offset = SymmetryMatrix.MultiplyPoint(Offset); int count = Ids.Count; if (Current.SnapToGrid) { for (int i = 0; i < Positions.Length; i++) { /* * if (i >= count) * { * SelectionRings[i].transform.localPosition = ScmapEditor.SnapToGridCenter(Positions[i] + Offset, true, Current.SnapToWater); * } * else * { * Current.AffectedGameObjects[Ids[i]].transform.localPosition = ScmapEditor.SnapToGridCenter(Positions[i] + Offset, true, Current.SnapToWater); * SelectionRings[i].transform.localPosition = Current.AffectedGameObjects[Ids[i]].transform.localPosition; * }*/ Vector3 NewPos = Vector3.zero; if (Current.LastControlType == SelectionControlTypes.Marker) { if (i >= count) { NewPos = ScmapEditor.SnapToGridCenter(Positions[i] + Offset, true, Current.SnapToWater); } else { NewPos = ScmapEditor.SnapMarker(Positions[i] + Offset, Current.AffectedTypes[Ids[i]]); } } else { NewPos = ScmapEditor.SnapToGridCenter(Positions[i] + Offset, true, Current.SnapToWater); } SelectionRings[i].transform.localPosition = NewPos; if (CustomSnapAction != null) { CustomSnapAction(SelectionRings[i].transform, GetAffected(i)); NewPos = SelectionRings[i].transform.localPosition; } if (i < count) { Current.AffectedGameObjects[Ids[i]].transform.localPosition = NewPos; } } } else { for (int i = 0; i < Positions.Length; i++) { Vector3 NewPos = Positions[i] + Offset; SelectionRings[i].transform.localPosition = NewPos; if (CustomSnapAction != null) { CustomSnapAction(SelectionRings[i].transform, GetAffected(i)); NewPos = SelectionRings[i].transform.localPosition; } if (i < count) { Current.AffectedGameObjects[Ids[i]].transform.localPosition = NewPos; } } } }